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

env hack to deal with sccache issues #296

Merged
merged 1 commit into from
Dec 16, 2024
Merged

Conversation

timotheyca
Copy link
Contributor

What this does: adds CARGOZIGBUILD_RUSTC_VERSION (idk what else to name it) variable that is used by Zig::execute_compiler to avoid calling sccache rustc -vV in some cases

@timotheyca
Copy link
Contributor Author

addresses #295

Copy link
Member

@messense messense left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, let's call this CARGO_ZIGBUILD_RUSTC_VERSION.

@@ -106,7 +106,10 @@ impl Zig {
.and_then(|index| cmd_args.get(index + 1));
let target_info = TargetInfo::new(target);

let rustc_ver = rustc_version::version()?;
let rustc_ver = match env::var("CARGOZIGBUILD_RUSTC_VERSION") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let rustc_ver = match env::var("CARGOZIGBUILD_RUSTC_VERSION") {
let rustc_ver = match env::var("CARGO_ZIGBUILD_RUSTC_VERSION") {

@@ -512,6 +515,11 @@ impl Zig {
.map(|target| target.split_once('.').map(|(t, _)| t).unwrap_or(target))
.collect::<Vec<&str>>();
let rustc_meta = rustc_version::version_meta()?;
Self::add_env_if_missing(
cmd,
"CARGOZIGBUILD_RUSTC_VERSION",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
"CARGOZIGBUILD_RUSTC_VERSION",
"CARGO_ZIGBUILD_RUSTC_VERSION",

Copy link
Member

@messense messense left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do the rename locally

@messense messense merged commit 961227f into rust-cross:main Dec 16, 2024
36 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants