X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Fbootstrap%2Ftest.rs;h=a69979d7f073a83d7ae2da771110c0ef39cc52da;hb=aff003becd8b6bf803202e958623031274ad69c9;hp=2b2257b72ae79f37d47e8b453dbe9805573a3942;hpb=6e819af3a79b20a31d582aff0b626769a4955ae9;p=rust.git diff --git a/src/bootstrap/test.rs b/src/bootstrap/test.rs index 2b2257b72ae..a69979d7f07 100644 --- a/src/bootstrap/test.rs +++ b/src/bootstrap/test.rs @@ -473,7 +473,7 @@ pub fn build_miri_sysroot( miri: &Path, target: TargetSelection, ) -> String { - let miri_sysroot = builder.out.join(compiler.host.triple).join("miri-sysrot"); + let miri_sysroot = builder.out.join(compiler.host.triple).join("miri-sysroot"); let mut cargo = tool::prepare_tool_cargo( builder, compiler, @@ -508,7 +508,7 @@ pub fn build_miri_sysroot( cargo.arg("--print-sysroot"); // FIXME: Is there a way in which we can re-use the usual `run` helpers? - if builder.config.dry_run { + if builder.config.dry_run() { String::new() } else { builder.verbose(&format!("running: {:?}", cargo)); @@ -1011,6 +1011,8 @@ fn run(self, builder: &Builder<'_>) { // instead of hard-coding this test if entry.file_name() == "link_to_definition" { cargo.env("RUSTDOCFLAGS", "-Zunstable-options --generate-link-to-definition"); + } else if entry.file_name() == "scrape_examples" { + cargo.arg("-Zrustdoc-scrape-examples=examples"); } builder.run(&mut cargo); } @@ -1401,6 +1403,7 @@ fn run(self, builder: &Builder<'_>) { cmd.arg("--src-base").arg(builder.src.join("src/test").join(suite)); cmd.arg("--build-base").arg(testdir(builder, compiler.host).join(suite)); + cmd.arg("--sysroot-base").arg(builder.sysroot(compiler)); cmd.arg("--stage-id").arg(format!("stage{}-{}", compiler.stage, target)); cmd.arg("--suite").arg(suite); cmd.arg("--mode").arg(mode); @@ -1537,7 +1540,7 @@ fn run(self, builder: &Builder<'_>) { let mut copts_passed = false; if builder.config.llvm_enabled() { let llvm_config = builder.ensure(native::Llvm { target: builder.config.build }); - if !builder.config.dry_run { + if !builder.config.dry_run() { let llvm_version = output(Command::new(&llvm_config).arg("--version")); let llvm_components = output(Command::new(&llvm_config).arg("--components")); // Remove trailing newline from llvm-config output. @@ -1555,14 +1558,14 @@ fn run(self, builder: &Builder<'_>) { // requirement, but the `-L` library path is not propagated across // separate compilations. We can add LLVM's library path to the // platform-specific environment variable as a workaround. - if !builder.config.dry_run && suite.ends_with("fulldeps") { + if !builder.config.dry_run() && suite.ends_with("fulldeps") { let llvm_libdir = output(Command::new(&llvm_config).arg("--libdir")); add_link_lib_path(vec![llvm_libdir.trim().into()], &mut cmd); } // Only pass correct values for these flags for the `run-make` suite as it // requires that a C++ compiler was configured which isn't always the case. - if !builder.config.dry_run && matches!(suite, "run-make" | "run-make-fulldeps") { + if !builder.config.dry_run() && matches!(suite, "run-make" | "run-make-fulldeps") { // The llvm/bin directory contains many useful cross-platform // tools. Pass the path to run-make tests so they can use them. let llvm_bin_path = llvm_config @@ -1590,7 +1593,7 @@ fn run(self, builder: &Builder<'_>) { // Only pass correct values for these flags for the `run-make` suite as it // requires that a C++ compiler was configured which isn't always the case. - if !builder.config.dry_run && matches!(suite, "run-make" | "run-make-fulldeps") { + if !builder.config.dry_run() && matches!(suite, "run-make" | "run-make-fulldeps") { cmd.arg("--cc") .arg(builder.cc(target)) .arg("--cxx") @@ -1670,6 +1673,10 @@ fn run(self, builder: &Builder<'_>) { cmd.arg("--channel").arg(&builder.config.channel); + if let Some(commit) = builder.config.download_rustc_commit() { + cmd.env("FAKE_DOWNLOAD_RUSTC_PREFIX", format!("/rustc/{commit}")); + } + builder.ci_env.force_coloring_in_ci(&mut cmd); builder.info(&format!(