(None, "bootstrap", None),
(Some(Mode::Rustc), "parallel_compiler", None),
(Some(Mode::ToolRustc), "parallel_compiler", None),
- (Some(Mode::Std), "miri", None),
(Some(Mode::Std), "stdarch_intel_sde", None),
(Some(Mode::Std), "no_fp_fmt_parse", None),
(Some(Mode::Std), "no_global_oom_handling", None),
(Some(Mode::Std), "freebsd12", None),
(Some(Mode::Std), "backtrace_in_libstd", None),
+ /* Extra values not defined in the built-in targets yet, but used in std */
+ (Some(Mode::Std), "target_env", Some(&["libnx"])),
+ (Some(Mode::Std), "target_os", Some(&["watchos"])),
+ (
+ Some(Mode::Std),
+ "target_arch",
+ Some(&["asmjs", "spirv", "nvptx", "nvptx64", "le32", "xtensa"]),
+ ),
+ /* Extra names used by dependencies */
// FIXME: Used by rustfmt is their test but is invalid (neither cargo nor bootstrap ever set
// this config) should probably by removed or use a allow attribute.
(Some(Mode::ToolRustc), "release", None),
// Properties derived from the above configuration
src: PathBuf,
out: PathBuf,
+ bootstrap_out: PathBuf,
rust_info: channel::GitInfo,
cargo_info: channel::GitInfo,
rls_info: channel::GitInfo,
.expect("failed to read src/version");
let version = version.trim();
+ let bootstrap_out = if std::env::var("BOOTSTRAP_PYTHON").is_ok() {
+ out.join("bootstrap").join("debug")
+ } else {
+ let workspace_target_dir = std::env::var("CARGO_TARGET_DIR")
+ .map(PathBuf::from)
+ .unwrap_or_else(|_| src.join("target"));
+ let bootstrap_out = workspace_target_dir.join("debug");
+ if !bootstrap_out.join("rustc").exists() {
+ // this restriction can be lifted whenever https://github.com/rust-lang/rfcs/pull/3028 is implemented
+ panic!("run `cargo build --bins` before `cargo run`")
+ }
+ bootstrap_out
+ };
+
let mut build = Build {
initial_rustc: config.initial_rustc.clone(),
initial_cargo: config.initial_cargo.clone(),
version: version.to_string(),
src,
out,
+ bootstrap_out,
rust_info,
cargo_info,
}
if let Subcommand::Setup { profile } = &self.config.cmd {
- return setup::setup(&self.config.src, *profile);
+ return setup::setup(&self.config, *profile);
}
{