NixOS/nix

builtins.fetchTarball breaks under local?root=

cleverca22 opened this issue · 4 comments

[clever@amd-nixos:~]$ nix-instantiate -E '(import (builtins.fetchTarball https://github.com/nixos/nixpkgs/archive/master.tar.gz) {}).hello' --store local?root=/home/clever/fakeroot/
unpacking 'https://github.com/nixos/nixpkgs/archive/master.tar.gz'...
nix-instantiate: src/libexpr/primops.cc:56: void nix::EvalState::realiseContext(const PathSet&): Assertion `store->isStorePath(ctx)' failed.
Aborted (core dumped)

related: #2125, #2174 and #2381

I had the same result while trying to bootstrap my system which uses home-manager, which uses fetchTarball also. Thanks for making the report.

[0.1/0.0 MiB DL] downloading 'https://github.com/rycee/home-manager/archive/master.tar.gz'nix: src/libe
xpr/primops.cc:56: void nix::EvalState::realiseContext(const PathSet&): Assertion `store->isStorePath(c
tx)' failed.                                                                                          
/run/current-system/sw/bin/nixos-install: line 98:  1680 Aborted                 nix build --out-link "
$outLink" --store "$mountPoint" "${extraBuildFlags[@]}" --extra-substituters "$sub" -f '<nixpkgs/nixos>
' system -I "nixos-config=$NIXOS_CONFIG"

Is this bug upstream? Is there an issue opened for it?

i think you can work around the problem by copying the output of fetchTarball from /nix/store to /mnt/nix/store using nix copy --to local?root=/mnt/ /nix/store/theoutput
but the hard part is finding what the output from fetchTarball was

Fixed in 06010ea.