11use anyhow:: Context ;
22use camino:: { Utf8Path , Utf8PathBuf } ;
33use clap:: Parser ;
4+ use environment:: TestConfig ;
45use log:: LevelFilter ;
56use utils:: io;
67
@@ -158,6 +159,11 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec<String>)>
158159
159160 let is_aarch64 = target_triple. starts_with ( "aarch64" ) ;
160161
162+ // Parse the optional build components that impact the test environment.
163+ let rust_configure_args = std:: env:: var ( "RUST_CONFIGURE_ARGS" )
164+ . expect ( "RUST_CONFIGURE_ARGS environment variable missing" ) ;
165+ let test_config = TestConfig :: from_configure_args ( & rust_configure_args) ;
166+
161167 let checkout_dir = Utf8PathBuf :: from ( "/checkout" ) ;
162168 let env = EnvironmentBuilder :: default ( )
163169 . host_tuple ( target_triple)
@@ -172,6 +178,7 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec<String>)>
172178 . skipped_tests ( vec ! [ ] )
173179 . run_tests ( true )
174180 . fast_try_build ( is_fast_try_build)
181+ . test_config ( test_config)
175182 . build ( ) ?;
176183
177184 ( env, shared. build_args )
@@ -180,6 +187,11 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec<String>)>
180187 let target_triple =
181188 std:: env:: var ( "PGO_HOST" ) . expect ( "PGO_HOST environment variable missing" ) ;
182189
190+ // Parse the optional build components that impact the test environment.
191+ let rust_configure_args = std:: env:: var ( "RUST_CONFIGURE_ARGS" )
192+ . expect ( "RUST_CONFIGURE_ARGS environment variable missing" ) ;
193+ let test_config = TestConfig :: from_configure_args ( & rust_configure_args) ;
194+
183195 let checkout_dir: Utf8PathBuf = std:: env:: current_dir ( ) ?. try_into ( ) ?;
184196 let env = EnvironmentBuilder :: default ( )
185197 . host_tuple ( target_triple)
@@ -193,6 +205,7 @@ fn create_environment(args: Args) -> anyhow::Result<(Environment, Vec<String>)>
193205 . skipped_tests ( vec ! [ ] )
194206 . run_tests ( true )
195207 . fast_try_build ( is_fast_try_build)
208+ . test_config ( test_config)
196209 . build ( ) ?;
197210
198211 ( env, shared. build_args )
0 commit comments