-
Notifications
You must be signed in to change notification settings - Fork 84
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
Incorrect cache behavior for nixpkgs_package
#17
Comments
nixpkgs_package
caching.nixpkgs_package
I see the problem but I don't know the solution. I suspect that bazel should be running the command in some sort of sandbox where external files are not available unless they are part of the rule input at which point they are cached as usual. This is the only sane way I can think of.
|
side-note: I don't have ability to label in this repo, can I get that back? Thanks. |
@Fuuzetsu should be good now. Had forgotten about this repo sorry. |
There is no much activity in this area since a few, so I guess that we can conclude that A pragmatic solution can be to add a |
I wouldn't be against such a well-documented workaround. |
Is it possible to have a rule modify one of its inputs? Maybe if it is not sandboxed? If so, it could be used to trigger any other rule that depends on it every time that bazel is executed. |
This is a solution for #17, the new `data` attribute references all the files needed to execute the nix expression, hence invalidating cache if they are modified.
#18 only partially solves this. There is another issue orthogonal to what #18 resolves but related to this ticket. If |
Note that |
@mboes I'll do a second PR to remove the implicit
For now this is not an issue because, as you said, #18 does not implement the proposed design. I think it is not possible until bazel proposes a solution for bazelbuild/bazel#3041. |
This is a solution for #17, the new attribute references all the files needed to execute the nix expression, so that the cache can properly be invalidated if they change.
nixpkgs_package
caching is based on the parameters of the rule, such asnix_file
ornix_file_content
. They can reference other files which are not taken into account by the cache.This mean that any change in these files does not invalidate the cache.
Proposed new design (I'll evaluate feasibility soon, bazel needs a way to force a rule to be run and control over the caching mecanism), the rule should always been build, but the caching / invalidation should be based on the result of the underlying
nix-build
command.The text was updated successfully, but these errors were encountered: