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
Content-addressed paths #3262
Closed
Closed
Content-addressed paths #3262
Conversation
This file contains 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
Allow marking derivations as `contentAddressed`. In that case the build outputs will be moved to paths determined by their content (like `add-to-store`). This support is still very basic: We can't atm depend on a ca derivation, and even how to retrie the actual path of the outputs isn't specified
That way we'll be able to find what an alias points to
Allows building dependencies of content-addressed derivations (though not transitive deps because we don't alias the dependencies correctly)
Remove the input drvs from the derivation before recomputing the output hash because otherwise these prevent early cutoff from happening
Allows to indirectly depend on a CA derivation
Otherwise fetching some (but not all) outputs of a derivation from the cache fails because we request the pathInfo for a non-existing store path
If we don't do that, the paths won't be added to the sandbox, and so the build will fail
When building with `--store`, we need to resolve the store paths to their actual on-disk location before doing any concrete operation on them
- Resolve aliases when computing the actual `bash` path - Rewrite the derivation like we do for building
Minimal testing seems promising. I'm not as strong in C++, but I can perform some testing, review, etc. I can see aliasOf added in |
Closing in favor of #3528 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
(draft) companion MR for NixOS/rfcs#62
Makes derivations with
contentAddressed = true
content-addressed in the store.You probably don't want to try this in an existing Nix installation since it requires a change in the database schema (and there's no guaranty that it won't corrupt the store ;) )