-
-
Notifications
You must be signed in to change notification settings - Fork 145
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
feat: adds compiler_cache_folder config var #1897
Conversation
Related: ApeWorX/ape-solidity#62 |
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.
I tried using ManagerAccessMixin myself just to make sure and yeah you can't do it because it's loading still.
I can't really think of another way to do it either and this way if this problem again, we at least have a solution for it (rather than 1-off fix each time).
LGTM
|
I converted to a Draft just to make it less likely to merge until it's ready |
…y, tighten up cache_folder relative path handling, and prevent escape of project root
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.
LGTM - some nits, 1 question
My biggest takeaway is that we should probably change in 0.8 to using the base path as the project path. I know it is a big change; maybe we can offer another config so users can opt in the past approach when necessary.
src/ape_compile/__init__.py
Outdated
if self._config_manager.contracts_folder not in self.cache_folder.parents: | ||
return self._config_manager.PROJECT_FOLDER | ||
|
||
# Otherwise, we're defaulting to contracts folder for backwards compatibility. Chaning this |
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.
question: Thoughts on for 0.8 using the project path as the base regardless, as a breaking change?
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.
I have no issues with making this change. We may want to document the old way somehow so users can reconstruct their project to match the old ways (or just instruct them to use an old version of ape and its deps, if possible). It's hard to get a sense how important repeatable builds are.
I also think it's worth discussing the idea in #1912. The functionality in it could be used for some kinds of build stages to assemble the compilation directory structure. Then it wouldn't matter where users put things. And we wouldn't need to really put a dependency cache anywhere semi-permanently. It's possible we could introduce this in a way to not be breaking.
Co-authored-by: antazoey <[email protected]>
Co-authored-by: antazoey <[email protected]>
What I did
Adds the
cache_folder
config var for ape_compile. Compiler plugins will leverage this for various temporary build-storage (mostly dependency sources).Ref: #1335
Checklist