Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -519,7 +519,7 @@ pub fn std_cargo(builder: &Builder<'_>, target: TargetSelection, cargo: &mut Car
// Query rustc for the deployment target, and the associated env var.
// The env var is one of the standard `*_DEPLOYMENT_TARGET` vars, i.e.
// `MACOSX_DEPLOYMENT_TARGET`, `IPHONEOS_DEPLOYMENT_TARGET`, etc.
let mut cmd = command(builder.rustc(cargo.compiler()));
let mut cmd = builder.rustc_cmd(cargo.compiler());
cmd.arg("--target").arg(target.rustc_target_arg());
cmd.arg("--print=deployment-target");
let output = cmd.run_capture_stdout(builder).stdout();
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/src/core/build_steps/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ fn generate_target_spec_json_schema(builder: &Builder<'_>, sysroot: &Path) {
// We do this by using the stage 1 compiler, which is always compiled for the host,
// even in a cross build.
let stage1_host = builder.compiler(1, builder.host_target);
let mut rustc = command(builder.rustc(stage1_host)).fail_fast();
let mut rustc = builder.rustc_cmd(stage1_host).fail_fast();
rustc
.env("RUSTC_BOOTSTRAP", "1")
.args(["--print=target-spec-json-schema", "-Zunstable-options"]);
Expand Down
3 changes: 1 addition & 2 deletions src/bootstrap/src/core/build_steps/synthetic_targets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
use crate::Compiler;
use crate::core::builder::{Builder, ShouldRun, Step};
use crate::core::config::TargetSelection;
use crate::utils::exec::command;

#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub(crate) struct MirOptPanicAbortSyntheticTarget {
Expand Down Expand Up @@ -55,7 +54,7 @@ fn create_synthetic_target(
return TargetSelection::create_synthetic(&name, path.to_str().unwrap());
}

let mut cmd = command(builder.rustc(compiler));
let mut cmd = builder.rustc_cmd(compiler);
cmd.arg("--target").arg(base.rustc_target_arg());
cmd.args(["-Zunstable-options", "--print", "target-spec-json"]);

Expand Down
6 changes: 2 additions & 4 deletions src/bootstrap/src/core/builder/cargo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -728,10 +728,8 @@ impl Builder<'_> {
// Build proc macros both for the host and the target unless proc-macros are not
// supported by the target.
if target != compiler.host && cmd_kind != Kind::Check {
let mut rustc_cmd = command(self.rustc(compiler));
self.add_rustc_lib_path(compiler, &mut rustc_cmd);

let error = rustc_cmd
let error = self
.rustc_cmd(compiler)
.arg("--target")
.arg(target.rustc_target_arg())
.arg("--print=file-names")
Expand Down
8 changes: 8 additions & 0 deletions src/bootstrap/src/core/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1605,6 +1605,14 @@ Alternatively, you can set `build.local-rebuild=true` and use a stage0 compiler
}
}

/// Gets a command to run the compiler specified, including the dynamic library
/// path in case the executable has not been build with `rpath` enabled.
pub fn rustc_cmd(&self, compiler: Compiler) -> BootstrapCommand {
let mut cmd = command(self.rustc(compiler));
self.add_rustc_lib_path(compiler, &mut cmd);
cmd
}

/// Gets the paths to all of the compiler's codegen backends.
fn codegen_backends(&self, compiler: Compiler) -> impl Iterator<Item = PathBuf> {
fs::read_dir(self.sysroot_codegen_backends(compiler))
Expand Down
Loading