compiletest: Add warning and comment about running tests without RUSTC
This commit is contained in:
parent
c86e523d97
commit
2462bd17a0
1 changed files with 16 additions and 1 deletions
|
|
@ -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)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue