NixOS / nix

Nix, the purely functional package manager
https://nixos.org/
GNU Lesser General Public License v2.1
12.8k stars 1.52k forks source link

Nix substituters break if using a different store #7373

Open domenkozar opened 1 year ago

domenkozar commented 1 year ago

Fails

nix-store -v -r /nix/store/68la8h705hzcq0wn3b6kqragg4nzy3i0-foo.drv --store file:///tmp/tmp-store --substituters 'https://hercules-ci.cachix.org' --trusted-public-keys 'hercules-ci.cachix.org-1:ZZeDl9Va+xe9j+KqdzoBZMFJHVQ42Uu/c/1/KMC5Lw0='
don't know how to build these paths:
  /nix/store/68la8h705hzcq0wn3b6kqragg4nzy3i0-foo.drv
warning: the substitute for '/nix/store/68la8h705hzcq0wn3b6kqragg4nzy3i0-foo.drv' from 'https://hercules-ci.cachix.org' is not signed by any of the keys in 'trusted-public-keys'
error: cannot build missing derivation '/nix/store/68la8h705hzcq0wn3b6kqragg4nzy3i0-foo.drv'

Works

$ nix-store -v -r /nix/store/68la8h705hzcq0wn3b6kqragg4nzy3i0-foo.drv --substituters 'https://hercules-ci.cachix.org' --trusted-public-keys 'hercules-ci.cachix.org-1:ZZeDl9Va+xe9j+KqdzoBZMFJHVQ42Uu/c/1/KMC5Lw0='
don't know how to build these paths:
  /nix/store/68la8h705hzcq0wn3b6kqragg4nzy3i0-foo.drv
querying info about '/nix/store/1zjz27vbf2am8lszc0yvlxzqyb65g528-setup.sh' on 'https://hercules-ci.cachix.org'...
downloading 'https://hercules-ci.cachix.org/1zjz27vbf2am8lszc0yvlxzqyb65g528.narinfo'...
domenkozar commented 1 year ago

~This seems to happen because there's a mismatch between the .drv system and the one running locally. But that shouldn't prevent substitution of the .drv file.~

thufschmitt commented 1 year ago

There's still an issue (if only with the error message, probably with the logic too), but I guess you mean --store /tmp/tmp-store rather than --store file:///tmp/tmp-store. The latter will create a binary cache under /tmp/tmp-store and not a proper chrooted store