-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
outPath is not right when __contentAddressed=true #6378
Comments
That’s a fundamental design tradeof with CA derivations: we can’t know the out path until we’ve built it (hence the weird placeholder). But indeed, $ NIX_PROFILE=$PWD/profile nix-env -i -f '<nixpkgs>' --arg config '{ contentAddressedByDefault = true; }' -A hello
installing 'hello-2.12'
error: path '/169040rvrkfnqnnddgmz3prbcwnk3sy62kj2x0zyhhynwgng0ziv' is not in the Nix store
at /nix/store/m0mp896mn6np6bvkrrljcg1ax416p670-f71alr07xb2swc37fiqjr5h416qcs6wr-source/lib/customisation.nix:157:13:
156| drvPath = assert condition; drv.${outputName}.drvPath;
157| outPath = assert condition; drv.${outputName}.outPath;
| ^
158| }; |
nix eval also creates rather unexpected outputs:
just because there is somewhere a content addressed derivation evolved. |
Can I in some way force the drv to be built? Maybe with IFD? |
@SuperSandro2000 that is again intention --- a placeholder to be replaced with the store path. You can force it to be a store path with IFD and a wrapper derivation and |
I think I would be less confused if the slash at the beginning wouldn't be there or the suffix would be something lika
I am evaluating my config locally, copying the drv to the remote and then building it there. I think I solved it in my deployment script by actually evaluating .drvPath which nix eval should probably fall back to in case it would generate the placeholder.
|
|
This is also a problem for
|
I was adding
__contentAddressed=true
to snack, a nix-based bulid tool."Fix IFD with CA derivations" (#5807) has dealt with some bugs already, so I just need to upgrade nix to fix a bug earlier.
However, now it's
outPath
that has problems with ca-derivations.to install snack (after adding __contentAddressed=true in derivations in code):
nix-env -f ./default.nix -iA snack-exe
Expected behavior
Get right outPath like /nix/store/xxx and run smoothly like non-ca derivations.
nix-env --version
outputnix-env (Nix) 2.7.0
** thoughts **
I think it's somewhere about installation in
nix-env
code that calledcustomisation.nix
and cause this. butnix-env ... --show-trace
didn't give more infos.The text was updated successfully, but these errors were encountered: