Skip to content

Commit a74c790

Browse files
authored
Rollup merge of rust-lang#68019 - cuviper:in-tree-compiletest, r=Mark-Simulacrum
Build compiletest with in-tree libtest This updates compiletest to build in `Mode::ToolStd`, using the locally-built crates for `std` and especially `test`. This way we're immune to unstable differences in the bootstrap compiler crates, whether that's a prior-release stage0 or a current release local rebuild. Fixes rust-lang#59264. As a minor cleanup, this also removes the unused `llvm_tools` flag.
2 parents a491100 + 686d5f8 commit a74c790

File tree

2 files changed

+11
-13
lines changed

2 files changed

+11
-13
lines changed

src/bootstrap/tool.rs

+8-12
Original file line numberDiff line numberDiff line change
@@ -289,8 +289,8 @@ fn rustbook_features() -> Vec<String> {
289289
macro_rules! bootstrap_tool {
290290
($(
291291
$name:ident, $path:expr, $tool_name:expr
292-
$(,llvm_tools = $llvm:expr)*
293292
$(,is_external_tool = $external:expr)*
293+
$(,is_unstable_tool = $unstable:expr)*
294294
$(,features = $features:expr)*
295295
;
296296
)+) => {
@@ -301,15 +301,6 @@ macro_rules! bootstrap_tool {
301301
)+
302302
}
303303

304-
impl Tool {
305-
/// Whether this tool requires LLVM to run
306-
pub fn uses_llvm_tools(&self) -> bool {
307-
match self {
308-
$(Tool::$name => false $(|| $llvm)*,)+
309-
}
310-
}
311-
}
312-
313304
impl<'a> Builder<'a> {
314305
pub fn tool_exe(&self, tool: Tool) -> PathBuf {
315306
match tool {
@@ -350,7 +341,12 @@ macro_rules! bootstrap_tool {
350341
compiler: self.compiler,
351342
target: self.target,
352343
tool: $tool_name,
353-
mode: Mode::ToolBootstrap,
344+
mode: if false $(|| $unstable)* {
345+
// use in-tree libraries for unstable features
346+
Mode::ToolStd
347+
} else {
348+
Mode::ToolBootstrap
349+
},
354350
path: $path,
355351
is_optional_tool: false,
356352
source_type: if false $(|| $external)* {
@@ -377,7 +373,7 @@ bootstrap_tool!(
377373
Tidy, "src/tools/tidy", "tidy";
378374
Linkchecker, "src/tools/linkchecker", "linkchecker";
379375
CargoTest, "src/tools/cargotest", "cargotest";
380-
Compiletest, "src/tools/compiletest", "compiletest", llvm_tools = true;
376+
Compiletest, "src/tools/compiletest", "compiletest", is_unstable_tool = true;
381377
BuildManifest, "src/tools/build-manifest", "build-manifest";
382378
RemoteTestClient, "src/tools/remote-test-client", "remote-test-client";
383379
RustInstaller, "src/tools/rust-installer", "fabricate", is_external_tool = true;

src/tools/compiletest/src/main.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#![crate_name = "compiletest"]
2-
#![feature(test)]
32
#![deny(warnings)]
3+
// The `test` crate is the only unstable feature
4+
// allowed here, just to share similar code.
5+
#![feature(test)]
46

57
extern crate test;
68

0 commit comments

Comments
 (0)