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
fix(core): use relative config file path in hash #6872
fix(core): use relative config file path in hash #6872
Conversation
When using `NX_CACHE_DIRECTORY` environment variable, the expectation is that different `git worktree`s of the same project should share the cache. But, the project hash used for caching includes the absolute path of `project.json`. Now we use the relative path instead.
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/nrwl/nx-dev/8A9Sgssf1pNb8z9Q43B6ZLXeJsVj |
Nx Cloud ReportCI ran the following commands for commit 565c84d. Click to see the status, the terminal output, and the build insights. 📂 See all runs for this branch Sent with 💌 from NxCloud. |
@AgentEnder I don't think we actually need that property in the hashed config do we? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this property should not be making it into the hash. @shihabuddin Thanks for the contribution, but the change here needs to happen in the hasher instead. Do you care to make the change there instead? Where it is hashing the project configuration you should be able to do something like
const {configFilePath: _, ...config} = projectConfig
or just delete projectConfig.configFilePath
@AgentEnder will take a look at this. I'm going to close this PR. Thank you for attempting a fix! You can follow the status in this issue: #6880 |
This pull request has already been merged/closed. If you experience issues related to these changes, please open a new issue referencing this pull request. |
When using
NX_CACHE_DIRECTORY
environment variable, the expectation is thatdifferent
git worktree
s of the same project should share the cache. But, theproject hash used for caching includes the absolute path of
project.json
.Now we use the relative path instead.
Current Behavior
Different
git worktree
s of the same project have their own caches.Expected Behavior
Different
git worktree
s of the same project share the cache.Related Issue(s)
Fixes #