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

Fix IFD with CA derivations #5807

Merged
merged 2 commits into from
Dec 21, 2021
Merged

Fix IFD with CA derivations #5807

merged 2 commits into from
Dec 21, 2021

Conversation

thufschmitt
Copy link
Member

Rewrite the string taken by the IFD-like primops to contain the actual output paths of the derivations rather than the placeholders

Fix #5805

@thufschmitt thufschmitt added the ca-derivations Derivations with content addressed outputs label Dec 20, 2021
Rewrite the string taken by the IFD-like primops to contain the actual
output paths of the derivations rather than the placeholders

Fix #5805
return res;
}

static Path realisePath(EvalState & state, const Pos & pos, Value & v, bool requireAbsolutePath = true)
Copy link
Member

Choose a reason for hiding this comment

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

What does requireAbsolutePath mean? I.e. when is it okay for it to be a relative path, and what is it relative to?

Copy link
Member Author

Choose a reason for hiding this comment

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

requireAbsolutePath is here for the findFile primops (the desugaring of the angle brackets). Its first argument (the search path) can contain some strings with context, but these can be relative paths (which will then be relative to the cwd of the evaluator).

I’m not utterly happy having this flag just for that, but I’ve kept it to make sure to conserve the exact same semantics

(I had no idea that there could be strings-with-context here btw. Wonder whether that’s actually used anywhere)

@edolstra edolstra merged commit 89faff9 into master Dec 21, 2021
@edolstra edolstra deleted the 5805-ca-ifd branch December 21, 2021 17:47
@tomberek
Copy link
Contributor

tomberek commented Dec 23, 2021

I'm getting errors related to this commit:

error: access to absolute path '/.config/nixpkgs/overlays.nix' is forbidden in pure eval mode (use '--impure' to override)

The getEnv in impure.nix is resolving to the empty string, but is still trying to access the overlays.nix. It's related to imports/paths, but I'm not sure exactly what is the root cause.

ping: @regnat @edolstra

nix run github:nixos/nix/cbbd21ec073781f68029daff153dac2516dafc23#nix eval nixpkgs#coreutils.meta --substituters ''

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ca-derivations Derivations with content addressed outputs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CA-derivations aren’t compatible with IFD
4 participants