-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
package manager: allow overriding dependencies with local cache #20348
base: master
Are you sure you want to change the base?
Conversation
Btw you should probably remove the draft marker |
I don't think it's ready to merge until I figure out at least a way to get tests integrated with the build system. |
I've added tests to the CI by directly modifying the CI scripts for linux and macos runners (I don't know the ps1 script syntax, so thought I'd better not mess with those). This seemed to be the simplest way to pass the cache-related flags to The downside of the approach taken is that running There also isn't a Windows equivalent of the |
490097a
to
a8b5691
Compare
This will conflict with the work being done in the |
31ad131
to
68d8cac
Compare
This resolves #20180 (the package overriding portion not the proposed command for examining the dependency tree). While the issue is not accepted I've found this very useful myself and should be mergeable (sans any issues with the testing approach explained below), so I expect to continue updating/rebasing this PR until the issue is either accepted or rejected.
The approach taken is to change the package root written to the generated
dependencies.zig
file to point into the local cache. In addition a new.local_override
field is added to facilitate warning messages produced by the build runner.I have some tests for verifying the behaviour of the package overriding at configure time (i.e. that the correct
build.zig
is used for the package) and compile time (that the correct version of the package is used), but I'm not sure at the moment how to integrate them into the test system as I don't think there is a way to get the effect of passing the--global-cache-dir
,--cache-dir
and--system
flags to standalone tests, which would be needed for checking that the right thing happens when these flags are passed tozig build
.PR #20281 implements the tool described in #20180 for examining the hashes of dependencies - it could be merged into this PR, but it is also useful separately and the two PRs are not inter-dependant.