Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compiletest: use target cfg instead of hard-coded tables #100260

Merged
merged 3 commits into from
Aug 10, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
compiletest: Add warning and comment about running tests without RUSTC
ehuss committed Aug 9, 2022
commit 2462bd17a029e8333796bb7190bce4bdfc4da91b
17 changes: 16 additions & 1 deletion src/tools/compiletest/src/header/tests.rs
Original file line number Diff line number Diff line change
@@ -58,7 +58,22 @@ fn config() -> Config {
];
let mut args: Vec<String> = args.iter().map(ToString::to_string).collect();
args.push("--rustc-path".to_string());
args.push(std::env::var("RUSTC").unwrap_or_else(|_| "rustc".to_string()));
// This is a subtle/fragile thing. On rust-lang CI, there is no global
// `rustc`, and Cargo doesn't offer a convenient way to get the path to
// `rustc`. Fortunately bootstrap sets `RUSTC` for us, which is pointing
// to the stage0 compiler.
//
// Otherwise, if you are running compiletests's tests manually, you
// probably don't have `RUSTC` set, in which case this falls back to the
// global rustc. If your global rustc is too far out of sync with stage0,
// then this may cause confusing errors. Or if for some reason you don't
// have rustc in PATH, that would also fail.
args.push(std::env::var("RUSTC").unwrap_or_else(|_| {
eprintln!(
"warning: RUSTC not set, using global rustc (are you not running via bootstrap?)"
);
"rustc".to_string()
}));
crate::parse_config(args)
}