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

fix(core): use relative config file path in hash #6872

Closed

Conversation

shihabuddin
Copy link
Contributor

When using NX_CACHE_DIRECTORY environment variable, the expectation is that
different git worktrees 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.

Current Behavior

Different git worktrees of the same project have their own caches.

Expected Behavior

Different git worktrees of the same project share the cache.

Related Issue(s)

Fixes #

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.
@vercel
Copy link

vercel bot commented Aug 27, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/nrwl/nx-dev/8A9Sgssf1pNb8z9Q43B6ZLXeJsVj
✅ Preview: Canceled

@FrozenPandaz
Copy link
Collaborator

@AgentEnder I don't think we actually need that property in the hashed config do we?

Copy link
Member

@AgentEnder AgentEnder left a 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

@FrozenPandaz
Copy link
Collaborator

@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

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants