input-output-hk/stack2nix

stack2nix's nix version can be incompatible with the system nix version

Closed this issue · 2 comments

nh2 commented

Using stack2nix 0.2.

When trying to clone a git: extra-dep, I get:

error: current Nix store schema is version 10, but I only support 7

I think this is because on my system I use nix 2.0, while strace reveals that stack2nix is invoking nix-1.11.4.

Shouldn't stack2nix use my system's nix instead?

nh2 commented

Uh, turns out it's this:

% which nix-prefetch-git 
/home/niklas/.nix-profile/bin/nix-prefetch-git
% cat /home/niklas/.nix-profile/bin/nix-prefetch-git
#! /nix/store/mgdm9y2lhmyb74wwa42qhcl633vbwn26-bash-4.3-p46/bin/bash -e
export PATH=/nix/store/d7ad39clh5igyjikdraq758f19544p2v-git-2.10.1/bin${PATH:+:}$PATH
export PATH=/nix/store/d50cibb81mw35gy3dvbd7aa2wr76f97g-coreutils-8.25/bin${PATH:+:}$PATH
export PATH=/nix/store/2sspjgd4y45cagzsaqq6b5r60ypb38kp-gnused-4.2.2/bin${PATH:+:}$PATH
export PATH=/nix/store/122kpq5bl3r99l3cvmcryl48vlb48m48-nix-1.11.4/bin${PATH:+:}$PATH
export HOME=":"
exec -a "$0" /nix/store/f0izy52dlycxkqfgvxr44qbqvz2mb45f-nix-prefetch-git/bin/.nix-prefetch-git-wrapped "${extraFlagsArray[@]}" "$@"

Looks like nix-prefetch-git is out of date and uses old nix? How can that be?

nh2 commented

Fixed it by doing:

% ls -lah /home/niklas/.nix-profile/bin/nix-prefetch-git
lrwxrwxrwx 1 niklas niklas 85 Jan  1  1970 /home/niklas/.nix-profile/bin/nix-prefetch-git -> /nix/store/wk47vkfx515z0qrhy8ripwly6chw3r7i-nix-prefetch-scripts/bin/nix-prefetch-git*
% nix-env --uninstall /nix/store/wk47vkfx515z0qrhy8ripwly6chw3r7i-nix-prefetch-scripts
% nix-env -iA nixpkgs.nix-prefetch-git
% cat $(which nix-prefetch-git)
#! /nix/store/lw7xaqhakk0i1c631m3cvac3x4lc5gr5-bash-4.4-p12/bin/bash -e
export PATH='/nix/store/i1jdv6w0nd3lpv1nvg6hwlif34xqb0nl-git-2.16.4/bin:/nix/store/920k63py2w97xpfyb5ps9l6wbidvzfjz-coreutils-8.29/bin:/nix/store/wkgszaq2dkc4asapcbx6ypd7xdnzad9f-gnused-4.4/bin:/nix/store/ik6b9k2kxvzhpsw4nbjgrh4fbywprvh6-nix-2.0.4/bin'${PATH:+':'}$PATH
export HOME='/homeless-shelter'
exec -a "$0" "/nix/store/wcnw1zz7p1v5daf0xghdbx5v7di7g31h-nix-prefetch-git/bin/.nix-prefetch-git-wrapped"  "${extraFlagsArray[@]}" "$@"

So it's not stack2nix's fault after all.