@@ -355,16 +355,7 @@ fn custom_build_env_var_rustc_linker_bad_host_target() {
355
355
target
356
356
) ,
357
357
)
358
- . file (
359
- "build.rs" ,
360
- r#"
361
- use std::env;
362
-
363
- fn main() {
364
- assert!(env::var("RUSTC_LINKER").unwrap().ends_with("/path/to/linker"));
365
- }
366
- "# ,
367
- )
358
+ . file ( "build.rs" , "fn main() {}" )
368
359
. file ( "src/lib.rs" , "" )
369
360
. build ( ) ;
370
361
@@ -467,16 +458,7 @@ fn custom_build_invalid_host_config_feature_flag() {
467
458
target
468
459
) ,
469
460
)
470
- . file (
471
- "build.rs" ,
472
- r#"
473
- use std::env;
474
-
475
- fn main() {
476
- assert!(env::var("RUSTC_LINKER").unwrap().ends_with("/path/to/linker"));
477
- }
478
- "# ,
479
- )
461
+ . file ( "build.rs" , "fn main() {}" )
480
462
. file ( "src/lib.rs" , "" )
481
463
. build ( ) ;
482
464
@@ -510,16 +492,7 @@ fn custom_build_env_var_rustc_linker_host_target_with_bad_host_config() {
510
492
target
511
493
) ,
512
494
)
513
- . file (
514
- "build.rs" ,
515
- r#"
516
- use std::env;
517
-
518
- fn main() {
519
- assert!(env::var("RUSTC_LINKER").unwrap().ends_with("/path/to/target/linker"));
520
- }
521
- "# ,
522
- )
495
+ . file ( "build.rs" , "fn main() {}" )
523
496
. file ( "src/lib.rs" , "" )
524
497
. build ( ) ;
525
498
@@ -554,16 +527,7 @@ fn custom_build_env_var_rustc_linker_bad_host() {
554
527
target
555
528
) ,
556
529
)
557
- . file (
558
- "build.rs" ,
559
- r#"
560
- use std::env;
561
-
562
- fn main() {
563
- assert!(env::var("RUSTC_LINKER").unwrap().ends_with("/path/to/target/linker"));
564
- }
565
- "# ,
566
- )
530
+ . file ( "build.rs" , "fn main() {}" )
567
531
. file ( "src/lib.rs" , "" )
568
532
. build ( ) ;
569
533
@@ -600,16 +564,7 @@ fn custom_build_env_var_rustc_linker_bad_host_with_arch() {
600
564
target, target
601
565
) ,
602
566
)
603
- . file (
604
- "build.rs" ,
605
- r#"
606
- use std::env;
607
-
608
- fn main() {
609
- assert!(env::var("RUSTC_LINKER").unwrap().ends_with("/path/to/target/linker"));
610
- }
611
- "# ,
612
- )
567
+ . file ( "build.rs" , "fn main() {}" )
613
568
. file ( "src/lib.rs" , "" )
614
569
. build ( ) ;
615
570
@@ -658,7 +613,8 @@ fn custom_build_env_var_rustc_linker_cross_arch_host() {
658
613
. file ( "src/lib.rs" , "" )
659
614
. build ( ) ;
660
615
661
- // build.rs should fail due to bad host linker being set
616
+ // build.rs should be built fine since cross target != host target.
617
+ // assertion should succeed since it's still passed the target linker
662
618
p. cargo ( "build -Z target-applies-to-host -Z host-config --verbose --target" )
663
619
. arg ( & target)
664
620
. masquerade_as_nightly_cargo ( )
@@ -684,16 +640,7 @@ fn custom_build_env_var_rustc_linker_bad_cross_arch_host() {
684
640
cross_target, target
685
641
) ,
686
642
)
687
- . file (
688
- "build.rs" ,
689
- r#"
690
- use std::env;
691
-
692
- fn main() {
693
- assert!(env::var("RUSTC_LINKER").unwrap().ends_with("/path/to/target/linker"));
694
- }
695
- "# ,
696
- )
643
+ . file ( "build.rs" , "fn main() {}" )
697
644
. file ( "src/lib.rs" , "" )
698
645
. build ( ) ;
699
646
0 commit comments