Repository navigation
feat(build-dir): Added the Cargo version to the inputs of workspace-path-hash - #15340
Closed
ranger-ross wants to merge 3 commits into
Closed
ranger-ross wants to merge 3 commits into
ranger-ross wants to merge 3 commits into
Conversation
workspace-path-hash
ranger-ross
force-pushed
the
cargo-version-in-hash
branch
from
March 21, 2025 15:05
feb5de8 to
95491b1
Compare
epage
approved these changes
Mar 24, 2025
19 of 22 tasks
Contributor
|
As noted at #14125 (comment), the aspect of this PR for including the cargo version in the hash is being deferred. I've not closed this in case you want to keep this PR for just the test change. |
ranger-ross
marked this pull request as draft
April 2, 2025 12:03
Collaborator
|
☔ The latest upstream changes (possibly 7ade57b) made this pull request unmergeable. Please resolve the merge conflicts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR try to resolve?
This PR adds the Cargo version to the hash inputs of
workspace-path-hashbuild-dir template variable.We only include the major, minor, and patch parts of the version in the hash inputs to avoid including the release channel causing new nightly's from creating many new build-dirs.
See this comment in #14125
How should we test and review this PR?
I added a test for this change.
The testing approach is to run
cargo buildtwice changing the versions between runs and then validating the build-dir changed between runs.Additional information
For testing I had to add a
__CARGO_TEST_CARGO_VERSIONvariable as that seemed to be the easiest way to test this.Adding
__CARGO_TEST_env vars for testing purposes appears to be an established pattern (ie.__CARGO_TESTS_ONLY_SRC_ROOT,__CARGO_TEST_MAX_UNPACK_SIZE, etc)r? @epage