@@ -8,7 +8,6 @@ fn main() {
8
8
block_on ( ( uefi_main ( ) , bios_main ( ) ) . join ( ) ) ;
9
9
}
10
10
11
- #[ cfg( not( docsrs_dummy_build) ) ]
12
11
#[ cfg( feature = "bios" ) ]
13
12
async fn bios_main ( ) {
14
13
let out_dir = PathBuf :: from ( std:: env:: var ( "OUT_DIR" ) . unwrap ( ) ) ;
@@ -17,6 +16,7 @@ async fn bios_main() {
17
16
// BIOS crates don't have enough dependencies to utilize all cores on modern
18
17
// CPUs. So by running the build commands in parallel, we increase the number
19
18
// of utilized cores.)
19
+ #[ cfg( not( docsrs_dummy_build) ) ]
20
20
let ( bios_boot_sector_path, bios_stage_2_path, bios_stage_3_path, bios_stage_4_path) = (
21
21
build_bios_boot_sector ( & out_dir) ,
22
22
build_bios_stage_2 ( & out_dir) ,
@@ -25,6 +25,14 @@ async fn bios_main() {
25
25
)
26
26
. join ( )
27
27
. await ;
28
+ // dummy implementations because docsrs builds have no network access
29
+ #[ cfg( docsrs_dummy_build) ]
30
+ let ( bios_boot_sector_path, bios_stage_2_path, bios_stage_3_path, bios_stage_4_path) = (
31
+ PathBuf :: new ( ) ,
32
+ PathBuf :: new ( ) ,
33
+ PathBuf :: new ( ) ,
34
+ PathBuf :: new ( ) ,
35
+ ) ;
28
36
println ! (
29
37
"cargo:rustc-env=BIOS_BOOT_SECTOR_PATH={}" ,
30
38
bios_boot_sector_path. display( )
@@ -43,11 +51,16 @@ async fn bios_main() {
43
51
) ;
44
52
}
45
53
46
- #[ cfg( not( docsrs_dummy_build) ) ]
47
54
#[ cfg( feature = "uefi" ) ]
48
55
async fn uefi_main ( ) {
49
56
let out_dir = PathBuf :: from ( std:: env:: var ( "OUT_DIR" ) . unwrap ( ) ) ;
57
+
58
+ #[ cfg( not( docsrs_dummy_build) ) ]
50
59
let uefi_path = build_uefi_bootloader ( & out_dir) . await ;
60
+ // dummy implementation because docsrs builds have no network access
61
+ #[ cfg( docsrs_dummy_build) ]
62
+ let uefi_path = PathBuf :: new ( ) ;
63
+
51
64
println ! (
52
65
"cargo:rustc-env=UEFI_BOOTLOADER_PATH={}" ,
53
66
uefi_path. display( )
@@ -295,9 +308,3 @@ async fn convert_elf_to_bin(elf_path: PathBuf) -> PathBuf {
295
308
}
296
309
flat_binary_path
297
310
}
298
-
299
- // dummy implementations because docsrs builds have no network access
300
- #[ cfg( any( not( feature = "bios" ) , docsrs_dummy_build) ) ]
301
- async fn bios_main ( ) { }
302
- #[ cfg( any( not( feature = "uefi" ) , docsrs_dummy_build) ) ]
303
- async fn uefi_main ( ) { }
0 commit comments