@@ -643,7 +643,9 @@ def build_bootstrap(self):
643
643
env ["LIBRARY_PATH" ] = os .path .join (self .bin_root (), "lib" ) + \
644
644
(os .pathsep + env ["LIBRARY_PATH" ]) \
645
645
if "LIBRARY_PATH" in env else ""
646
- env ["RUSTFLAGS" ] = "-Cdebuginfo=2 "
646
+ # preserve existing RUSTFLAGS
647
+ env .setdefault ("RUSTFLAGS" , "" )
648
+ env ["RUSTFLAGS" ] += " -Cdebuginfo=2"
647
649
648
650
build_section = "target.{}" .format (self .build_triple ())
649
651
target_features = []
@@ -652,13 +654,13 @@ def build_bootstrap(self):
652
654
elif self .get_toml ("crt-static" , build_section ) == "false" :
653
655
target_features += ["-crt-static" ]
654
656
if target_features :
655
- env ["RUSTFLAGS" ] += "-C target-feature=" + ("," .join (target_features )) + " "
657
+ env ["RUSTFLAGS" ] += " -C target-feature=" + ("," .join (target_features ))
656
658
target_linker = self .get_toml ("linker" , build_section )
657
659
if target_linker is not None :
658
- env ["RUSTFLAGS" ] += "-C linker=" + target_linker + " "
659
- env ["RUSTFLAGS" ] += " -Wrust_2018_idioms -Wunused_lifetimes "
660
+ env ["RUSTFLAGS" ] += " -C linker=" + target_linker
661
+ env ["RUSTFLAGS" ] += " -Wrust_2018_idioms -Wunused_lifetimes"
660
662
if self .get_toml ("deny-warnings" , "rust" ) != "false" :
661
- env ["RUSTFLAGS" ] += "-Dwarnings "
663
+ env ["RUSTFLAGS" ] += " -Dwarnings"
662
664
663
665
env ["PATH" ] = os .path .join (self .bin_root (), "bin" ) + \
664
666
os .pathsep + env ["PATH" ]
0 commit comments