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

WIP: fetchTree: substitute from binary caches before trying to fetch #4149

Closed
wants to merge 1 commit into from

Conversation

@andir
Copy link
Member

@andir andir commented Oct 15, 2020

This allows fetching the referred sources from a binary cache in
addition to the original source Uri. In cases where accessing the
upstream is expensive, slow or unreliable and the soures are within on
of the trusted binary caches we can now subsitute them from there.

TODOs:

  • mostly a copy of what substitution-goal.cc does, this might mean we should refactor the entire substitution code to be useable for cases like this?
  • figure out which of the headers clangd pulled in on the fly are
    actually required for this
  • what are the downsides of having getPublicKeys public? It
    appears that at least one of the friend class cases only existed
    because it was not public.

Relates to #2114

This allows fetching the referred sources from a binary cache in
addition to the original source Uri. In cases where accessing the
upstream is expensive, slow or unreliable and the soures are within on
of the trusted binary caches we can now subsitute them from there.

TODOs:
 - [ ] mostly a copy of what substitution-goal.cc does
 - [ ] figure out which of the headers clangd pulled in on the fly are
       actually required for this
 - [ ] what are the downsides of having getPublicKeys public? It
       appears that at least one of the friend class cases only existed
       because it was not public.

Relates to NixOS#2114
@Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Oct 15, 2020

mostly a copy of what substitution-goal.cc does, this might mean we should refactor the entire substitution code to be useable for cases like this?

Check out #3754, which among many other changes does this without copying that stuff.

@Ericson2314
Copy link
Member

@Ericson2314 Ericson2314 commented Oct 15, 2020

In fact

store->ensurePath(storePath);
is supposed to try substitutors already. We should figure out why it's not working for you.

@andir
Copy link
Member Author

@andir andir commented Oct 15, 2020

In fact

store->ensurePath(storePath);

is supposed to try substitutors already. We should figure out why it's not working for you.

The reason might be that I'm using a release version of Nix (2.3.7) and didn't expect this to have been changed.

@andir
Copy link
Member Author

@andir andir commented Oct 15, 2020

mostly a copy of what substitution-goal.cc does, this might mean we should refactor the entire substitution code to be useable for cases like this?

Check out #3754, which among many other changes does this without copying that stuff.

That indeed looks much nicer! Looking forward to play with that once it's merged/released 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants