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

Use StorePathDescriptor to fetching from CA-only stores #3754

Draft
wants to merge 97 commits into
base: master
Choose a base branch
from

Conversation

Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Jun 26, 2020

This adds a StorePathDescriptor, which is like ContentAddress but additionally contains everything needed to create a store path. As such, it is like a combination of a name, a StorePath, and ValidPathInfo's "CA" and "References" fields, but without the other extraneous metadata from ValidPathInfo (such as timestamps or information that can be calculated from this).

The motivation is multi-fold:

  1. Be more cautious with references. When we just pass around ContentAddress, is easier to forget about CA data with references. With the ca-derivations work, we hope those become commonplace, and we want to support them right.

  2. Have StorePathDescriptor as an alternative to StorePath in internal interfaces. The idea is just a small step beyond Try to substitute builtins.fetch* #3721 and similar PRs, which have lots of StorePath, std::optional<ContentAddress> in arguments, and instead do std::variant<StorePath, StorePathDescriptor>.

  3. Eventually, do cross-store-dir substitutions of ca-references data, as when the store paths have the same length this should be possible.

  4. Add a new variant to StorePathDescriptor, corresponding to <drv-path>!<output-name> syntax, so we have a way to refer to the yet-unbuilt outputs of CA derivations.

depends on #3746

@Ericson2314 Ericson2314 changed the title WIP: FullContentAddress --- contains #3721 and #3746 WIP: FullContentAddress --- contains #3689 and #3746 Jun 26, 2020
Ericson2314 added a commit to obsidiansystems/nix that referenced this pull request Jun 29, 2020
auto dstPath = makeFixedOutputPath(name, FixedOutputInfo {
method,
h,
{},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you not have references with addToStoreFromDump?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matthewbauer I would say all those new {} are things that probably deserve auditing :)

@Ericson2314 Ericson2314 changed the title WIP: FullContentAddress --- contains #3689 and #3746 WIP: Better ContentAddress --- contains #3689 and #3746 Jul 2, 2020
@Ericson2314 Ericson2314 changed the title WIP: Better ContentAddress --- contains #3689 and #3746 WIP: StorePathDescriptor --- contains #3689 and #3746 Jul 14, 2020
@stale stale bot added the stale label Oct 29, 2022
@Ericson2314 Ericson2314 marked this pull request as draft February 2, 2023 14:56
@Ericson2314 Ericson2314 changed the title WIP: Use StorePathDescriptor to fetching from CA-only stores --- contains #3746 Use StorePathDescriptor to fetching from CA-only stores --- contains #3746 Feb 2, 2023
@stale stale bot removed the stale label Feb 2, 2023
@dpulls
Copy link

dpulls bot commented Apr 17, 2023

🎉 All dependencies have been resolved !

@Ericson2314 Ericson2314 changed the title Use StorePathDescriptor to fetching from CA-only stores --- contains #3746 Use StorePathDescriptor to fetching from CA-only stores --- contains #3746 Apr 19, 2023
@github-actions github-actions bot added fetching Networking with the outside (non-Nix) world new-cli Relating to the "nix" command store Issues and pull requests concerning the Nix store labels Apr 19, 2023
@Ericson2314 Ericson2314 changed the title Use StorePathDescriptor to fetching from CA-only stores --- contains #3746 Use StorePathDescriptor to fetching from CA-only stores Jun 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fetching Networking with the outside (non-Nix) world new-cli Relating to the "nix" command store Issues and pull requests concerning the Nix store
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants