Skip to content

Commit 2383e9d

Browse files
committed
compiletest/rmake: prune useless env vars and explain passed rustc options and env vars
1 parent f5488f0 commit 2383e9d

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/tools/compiletest/src/runtest.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3611,24 +3611,23 @@ impl<'test> TestCx<'test> {
36113611
// FIXME(jieyouxu): audit these env vars. some of them only makes sense for make, not rustc!
36123612
let mut rustc = Command::new(&self.config.rustc_path);
36133613
rustc
3614+
// Specify output path
36143615
.arg("-o")
36153616
.arg(&recipe_bin)
3617+
// Specify library search paths for `run_make_support`.
36163618
.arg(format!("-Ldependency={}", &support_lib_path.parent().unwrap().to_string_lossy()))
36173619
.arg(format!("-Ldependency={}", &support_lib_deps.to_string_lossy()))
36183620
.arg(format!("-Ldependency={}", &support_lib_deps_deps.to_string_lossy()))
3621+
// Provide `run_make_support` as extern prelude, so test writers don't need to write
3622+
// `extern run_make_support;`.
36193623
.arg("--extern")
36203624
.arg(format!("run_make_support={}", &support_lib_path.to_string_lossy()))
3625+
// Default to Edition 2021.
36213626
.arg("--edition=2021")
3627+
// The recipe file itself.
36223628
.arg(&self.testpaths.file.join("rmake.rs"))
3623-
.env("TARGET", &self.config.target)
3624-
.env("PYTHON", &self.config.python)
3625-
.env("RUST_BUILD_STAGE", &self.config.stage_id)
3626-
.env("RUSTC", &self.config.rustc_path)
3627-
.env("LD_LIB_PATH_ENVVAR", dylib_env_var())
3628-
.env(dylib_env_var(), &env::join_paths(host_dylib_search_paths).unwrap())
3629-
.env("HOST_RPATH_DIR", &self.config.compile_lib_path)
3630-
.env("TARGET_RPATH_DIR", &self.config.run_lib_path)
3631-
.env("LLVM_COMPONENTS", &self.config.llvm_components);
3629+
// Provide necessary library search paths for rustc.
3630+
.env(dylib_env_var(), &env::join_paths(host_dylib_search_paths).unwrap());
36323631

36333632
// In test code we want to be very pedantic about values being silently discarded that are
36343633
// annotated with `#[must_use]`.

0 commit comments

Comments
 (0)