11use anyhow:: Context ;
22use camino:: { Utf8Path , Utf8PathBuf } ;
33use clap:: Parser ;
4+ use environment:: TestConfig ;
45use log:: LevelFilter ;
56use utils:: io;
67
@@ -148,6 +149,11 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec<String>)>
148149
149150 let is_aarch64 = target_triple. starts_with ( "aarch64" ) ;
150151
152+ // Parse the optional build components that impact the test environment.
153+ let rust_configure_args = std:: env:: var ( "RUST_CONFIGURE_ARGS" )
154+ . expect ( "RUST_CONFIGURE_ARGS environment variable missing" ) ;
155+ let test_config = TestConfig :: from_configure_args ( & rust_configure_args) ;
156+
151157 let checkout_dir = Utf8PathBuf :: from ( "/checkout" ) ;
152158 let env = EnvironmentBuilder :: default ( )
153159 . host_tuple ( target_triple)
@@ -160,6 +166,7 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec<String>)>
160166 // FIXME: Enable bolt for aarch64 once it's fixed upstream. Broken as of December 2024.
161167 . use_bolt ( !is_aarch64)
162168 . skipped_tests ( vec ! [ ] )
169+ . test_config ( test_config)
163170 . build ( ) ?;
164171
165172 ( env, shared. build_args )
@@ -168,6 +175,11 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec<String>)>
168175 let target_triple =
169176 std:: env:: var ( "PGO_HOST" ) . expect ( "PGO_HOST environment variable missing" ) ;
170177
178+ // Parse the optional build components that impact the test environment.
179+ let rust_configure_args = std:: env:: var ( "RUST_CONFIGURE_ARGS" )
180+ . expect ( "RUST_CONFIGURE_ARGS environment variable missing" ) ;
181+ let test_config = TestConfig :: from_configure_args ( & rust_configure_args) ;
182+
171183 let checkout_dir: Utf8PathBuf = std:: env:: current_dir ( ) ?. try_into ( ) ?;
172184 let env = EnvironmentBuilder :: default ( )
173185 . host_tuple ( target_triple)
@@ -179,6 +191,7 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec<String>)>
179191 . shared_llvm ( false )
180192 . use_bolt ( false )
181193 . skipped_tests ( vec ! [ ] )
194+ . test_config ( test_config)
182195 . build ( ) ?;
183196
184197 ( env, shared. build_args )
0 commit comments