Skip to content

Commit bc549ad

Browse files
committed
compiletest/rmake: prune unused RUST_BUILD_STAGE and explain env vars passed to recipes
1 parent 0a22767 commit bc549ad

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

src/tools/compiletest/src/runtest.rs

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3701,20 +3701,37 @@ impl<'test> TestCx<'test> {
37013701

37023702
// FIXME(jieyouxu): explain what the hecc we are doing here.
37033703
// FIXME(jieyouxu): audit these env vars. some of them only makes sense for make, not rustc!
3704+
// FIXME(jieyouxu): please rename `TARGET_RPATH_ENV`, `HOST_RPATH_DIR` and
3705+
// `TARGET_RPATH_DIR`, it is **extremely** confusing!
37043706
let mut cmd = Command::new(&recipe_bin);
37053707
cmd.current_dir(&rmake_out_dir)
37063708
.stdout(Stdio::piped())
37073709
.stderr(Stdio::piped())
3710+
// Provide the target-specific env var that is used to record dylib search paths. For
3711+
// example, this could be `LD_LIBRARY_PATH` on some linux distros but `PATH` on Windows.
37083712
.env("LD_LIB_PATH_ENVVAR", dylib_env_var())
3709-
.env("TARGET_RPATH_ENV", &env::join_paths(target_runtime_dylib_search_paths).unwrap())
3713+
// Provide the dylib search paths.
37103714
.env(dylib_env_var(), &env::join_paths(recipe_dylib_search_paths).unwrap())
3715+
// Provide runtime dylib search paths.
3716+
.env("TARGET_RPATH_ENV", &env::join_paths(target_runtime_dylib_search_paths).unwrap())
3717+
// Provide the target.
37113718
.env("TARGET", &self.config.target)
3719+
// Some tests unfortunately still need Python, so provide path to a Python interpreter.
37123720
.env("PYTHON", &self.config.python)
3721+
// Provide path to checkout root. This is the top-level directory containing
3722+
// rust-lang/rust checkout.
37133723
.env("SOURCE_ROOT", &source_root)
3714-
.env("RUST_BUILD_STAGE", &self.config.stage_id)
3724+
// Provide path to stage-corresponding rustc.
37153725
.env("RUSTC", &self.config.rustc_path)
3726+
// Provide the directory to libraries that are needed to run the *compiler*. This is not
3727+
// to be confused with `TARGET_RPATH_ENV` or `TARGET_RPATH_DIR`. This is needed if the
3728+
// recipe wants to invoke rustc.
37163729
.env("HOST_RPATH_DIR", &self.config.compile_lib_path)
3730+
// Provide the directory to libraries that might be needed to run compiled binaries
3731+
// (further compiled by the recipe!).
37173732
.env("TARGET_RPATH_DIR", &self.config.run_lib_path)
3733+
// Provide which LLVM components are available (e.g. which LLVM components are provided
3734+
// through a specific CI runner).
37183735
.env("LLVM_COMPONENTS", &self.config.llvm_components);
37193736

37203737
if let Some(ref rustdoc) = self.config.rustdoc_path {

0 commit comments

Comments
 (0)