-
Notifications
You must be signed in to change notification settings - Fork 201
Custom cache directory name #543
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
Merged
TheLartians
merged 3 commits into
cpm-cmake:master
from
gerhardol:feature/i542-custom-cache-dir
Apr 8, 2024
Merged
Changes from 1 commit
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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.
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.
Currently the cache directory is a hash of all used arguments to guarantee that the dependency is actually present in precisely the requested version. How would we avoid conflicts here if users could set custom directories? E.g. say I have two projects that both use
foo
as a custom cache dir, but they use different versions?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.
Version must be handled manually (like with a combination of the download version and a manual sha of the patch_command files).
The current sha will not work when e.g. patch_command refers to external files, so it is not fool proof either.
Is the description in the readme clear enough?
My use case with some more details:
I would have used SOURCE_DIR for this change if not compatibility had been broken...
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.
That's true, patch commands using external files will definitely create issues. I'm still unsure about how I feel about applying patches in the cache as it can create very hard to track issues. In the JavaScript world using
npm
oryarn
, dependencies are copied from the cache to a project-specific location and any patches are applied there. That way the original cache remains valid no matter how the patch is applied. Maybe a mechanism like that would make sense as well here?I'm also not completely against this approach, just the name could be confusing as it seems to imply an absolute path. How about calling it something like
CUSTOM_CACHE_KEY
instead?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.
Maybe, even if my several GB packages should not be copied.
That would men to intercept and handle the fetch content arguments.
A bigger feature, I believe this can coexist without maintenance issues.
Fine, I pushed a change.