Skip to content
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
wants to merge 14 commits into from
Closed

Content-addressed paths #3262

wants to merge 14 commits into from

Conversation

@regnat
Copy link
Contributor

regnat commented Dec 11, 2019

(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 ;) )

regnat added 14 commits Sep 23, 2019
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
@regnat regnat changed the title Conent-addressed paths Content-addressed paths Dec 11, 2019
@tomberek
Copy link

tomberek commented Jan 6, 2020

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 src/libstore/schema.sql, but does that also do a migration for people with a previous schema?

@regnat
Copy link
Contributor Author

regnat commented Apr 23, 2020

Closing in favor of #3528

@regnat regnat closed this Apr 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.