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

Make env-dep:RUSTC_BOOTSTRAP get listed in probe's dep-info #279

Merged
merged 1 commit into from
Jan 2, 2024

Conversation

dtolnay
Copy link
Owner

@dtolnay dtolnay commented Jan 2, 2024

I expect that this fixes #278.

Sccache looks at dep-info (the thing produced by --emit=dep-info) to decide what environment variables to hash into the cache key for a particular compilation. See https://github.com/mozilla/sccache/blob/v0.7.4/src/compiler/rust.rs#L1424-L1448.

// 7. Environment variables: Hash all environment variables listed in the rustc dep-info
//    output. Additionally also has all environment variables starting with `CARGO_`,
//    since those are not listed in dep-info but affect cacheability.

Without this PR, the following failure mode explains the symptom of #278:

  1. Cargo or something else compiles thiserror with a stable compiler and RUSTC_BOOTSTRAP set. (Apparently RustRover likes to do this. https://youtrack.jetbrains.com/issue/RUST-13133)
  2. The build script compiles probe.rs with RUSTC_BOOTSTRAP unset. This fails, and the failure is not cached by sccache.
  3. The build script compiles probe.rs with RUSTC_BOOTSTRAP set. This succeeds and is cached by sccache, but RUSTC_BOOTSTRAP is incorrectly absent from the cache key.
  4. In some other shell, Cargo or something else compiles thiserror with a stable compiler and RUSTC_BOOTSTRAP unset.
  5. The build script compiles probe.rs with RUSTC_BOOTSTRAP unset and sccache feeds it the improperly cached successful result from step 3, so build script thinks it compiled successfully, even though it should not have. Chaos.

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.

1.0.53 interacts badly with sccache: feature may not be used on the stable release channel
1 participant