Skip to content

Omit some arguments with paths from Rust hash calculation. Fixes #207, #196 - #345

Merged
luser merged 1 commit into
mozilla:masterfrom
luser:rust-no-paths-in-hash-2
Dec 17, 2018
Merged

Omit some arguments with paths from Rust hash calculation. Fixes #207, #196#345
luser merged 1 commit into
mozilla:masterfrom
luser:rust-no-paths-in-hash-2

Conversation

@luser

@luser luser commented Dec 17, 2018

Copy link
Copy Markdown
Contributor

Some rustc arguments like --out-dir, -L, and --extern contain absolute paths
which make building the same crate (from crates.io) in different projects
unable to get cache hits despite being otherwise the same. This patch omits
those arguments from the hash calculation which makes sccache much more useful
for local development.

For additional safety we add the cwd to the hash key, since that winds up in
the rlib and otherwise this patch could result in some compiles returning invalid results from cache.

…lla#207

Some rustc arguments like --out-dir, -L, and --extern contain absolute paths
which make building the same crate (from crates.io) in different projects
unable to get cache hits despite being otherwise the same. This patch omits
those arguments from the hash calculation which makes sccache much more useful
for local development.

For additional safety we add the cwd to the hash key, since that winds up in
the rlib and otherwise this patch could result in some compiles returning invalid results from cache.
@luser luser changed the title Omit some arguments with paths from Rust hash calculation. Fixes #207 Omit some arguments with paths from Rust hash calculation. Fixes #207, #196 Dec 17, 2018
@luser
luser merged commit 1087c20 into mozilla:master Dec 17, 2018
tottoto pushed a commit to tottoto/sccache that referenced this pull request Feb 6, 2026
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 participant