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

Inform build scripts of rustc compiler context #9601

Merged
merged 19 commits into from
Jul 20, 2021
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
Next Next commit
Don't set RUSTC_WRAPPER if not configured
  • Loading branch information
Jon Gjengset committed Jun 18, 2021
commit bdf49cb17599a4cd8cb5578da0ca6bfa844a8971
7 changes: 3 additions & 4 deletions src/cargo/core/compiler/custom_build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -250,10 +250,9 @@ fn build_work(cx: &mut Context<'_, '_>, unit: &Unit) -> CargoResult<Job> {
}

// Also inform the build script of the rustc compiler context.
cmd.env(
"CARGO_RUSTC_WRAPPER",
bcx.rustc().wrapper.as_deref().unwrap_or(Path::new("")),
);
if let Some(wrapper) = bcx.rustc().wrapper.as_ref() {
cmd.env("CARGO_RUSTC_WRAPPER", wrapper);
jonhoo marked this conversation as resolved.
Show resolved Hide resolved
}
jonhoo marked this conversation as resolved.
Show resolved Hide resolved
cmd.env("CARGO_RUSTFLAGS", bcx.rustflags_args(unit).join(" "));

// Gather the set of native dependencies that this package has along with
Expand Down