nix-shell -i doesn't respect store config value #565

Open
opened 2024-10-31 14:16:39 +00:00 by kfearsoff · 0 comments
Member

Describe the bug

nix-shell -i takes an interpreter from /nix/store hardcoded. When changing the store with store config value, -i ignores it and tries to look at hardcoded /nix/store. This leads to brokenness and failures.

Discovered while working on tests for CL#2062

Steps To Reproduce

  1. Create a test dir: mktemp -d and cd into it
  2. Create script shebang.sh:
#! /usr/bin/env nix-shell
#! nix-shell -i bash -p hello
hello
  1. chmod +x shebang.sh
  2. mkdir -p nix/store
  3. export NIX_CONFIG='store = /tmp/<tmpdir>
  4. ./shebang.sh
  5. See error:
these 47 paths will be fetched (70.76 MiB download, 331.30 MiB unpacked):
  /nix/store/11v1wxbbp0gc196q0rlc3cq5k1bpzqsx-acl-2.3.1
  /nix/store/ykzqv6i5z0m8hwlqg0gjgn1jw021g74q-attr-2.5.1
  /nix/store/xfb3ykw9r5hpayd05sr0cizwadzq1d8q-bash-5.2-p15
  /nix/store/j1bznhli95dsjwgcpvaxgkaivzc1wqc3-bash-interactive-5.2-p15
  /nix/store/fx1h3mmzl2hjci3nn15n26r57mc3cs3z-binutils-2.40
  /nix/store/zrljf6fvil9ircbgcvdnw43hxp4ynl7v-binutils-2.40-lib
  /nix/store/vrhv7hg2jqvj78zd8xk42n70bf17i6hb-binutils-wrapper-2.40
  /nix/store/hiyfgknrcqdkr4py2x8scfn3qya807dn-bzip2-1.0.8
  /nix/store/jniy9n8nlcl8qr3c5gyhf0a4zr50373g-bzip2-1.0.8-bin
  /nix/store/mnjksxz8alkwf6pa74a9j04h93p3y2sy-coreutils-9.3
  /nix/store/rcqdcdca7f6kfvg20dppw5164cmrcizn-diffutils-3.9
  /nix/store/0hm9hyjspmkj1i498dbsbmsc3rjk8dvv-ed-1.19
  /nix/store/p6gidpg60rhrgjdp54xfbzisifz5b2mn-expand-response-params
  /nix/store/sgqwnn555n5dl9vj97gaydgp62vqdgqj-file-5.44
  /nix/store/ng1nxslr5vfachs9rhiaa007l7danl6i-findutils-4.9.0
  /nix/store/gwzahrpi1i5g3plffv4hxcbrgmm64ldq-gawk-5.2.1
  /nix/store/2vwipws2crqcjxfzjyq9rjpk61iqf7pf-gcc-12.3.0
  /nix/store/n7pvb7gdf1g6dvj7sl92i882qjl4kyx9-gcc-12.3.0-lib
  /nix/store/v75y3qd2i450dgpmd2i9qk9vwmn0qmrh-gcc-12.3.0-libgcc
  /nix/store/frxg2hvacachpkv3ywdpmfl5pl2yg5y6-gcc-wrapper-12.3.0
  /nix/store/flf14c3ibr83jsa070j25hg5gjapydhl-glibc-2.37-8
  /nix/store/bh2ywx08i5nn434m9b9m40fmfkshbp08-glibc-2.37-8-bin
  /nix/store/i29k9pvl90385mpsavifqvm4rag684dn-glibc-2.37-8-dev
  /nix/store/kzwglqcjxdgm9wd4f765imp23fg8lwn1-gmp-6.2.1
  /nix/store/gwmmh9hjjr1f2fnv7ygl7fr3x97krf0q-gmp-with-cxx-6.2.1
  /nix/store/bjbvd4drv2awzyx66m5hkarkrvj389pi-gnugrep-3.11
  /nix/store/s2kbmc692imlf0l21q5hs1j0ck7m3j7q-gnumake-4.4.1
  /nix/store/c6bvswjq3hmy69wd7nsf3cjv8b7v221s-gnused-4.9
  /nix/store/dfj2ws0dha05x36klk1kw79jwzg15z2q-gnutar-1.34
  /nix/store/b4212fn6w9agbxpj3i16wiy8l0il2kr3-gzip-1.12
  /nix/store/2g3jazymqbjw9c390c3b7vw8xq3r8iny-hello-2.12.1
  /nix/store/76ni01d3z506896ha3vsa924aby1p1j0-isl-0.20
  /nix/store/4b3rnvq1cl5ihavg96gkwjr61857d67g-libidn2-2.3.4
  /nix/store/ihyzbgqnmh85jr3z0pwgfj1k2clwfb5y-libmpc-1.3.1
  /nix/store/gsxrw0g0as0j40q4513igx9c2g0qf5s4-libunistring-1.1
  /nix/store/0zskr8vlaa77alvcahg4wzwpcdjwmyyn-linux-headers-6.3
  /nix/store/nld8lfblqxdhk6z5s5pkqgqqjz6l0bv4-mpfr-4.2.0
  /nix/store/fh7aqzj11ky8sggaf9sd2sk5yvxa6b1h-ncurses-6.4
  /nix/store/z92f3csj3f2milw6bvyfg02sijbzvhcx-patch-2.7.6
  /nix/store/lgapq71q5prr2b8ksz43wyxmk2bg83j9-patchelf-0.15.0
  /nix/store/fz42p8ap25rxlxhxdyr4lc794lx0nsk3-pcre2-10.42
  /nix/store/4ms9ygl7pjqv5x3y4rs2599jfhr4pjvs-readline-8.2p1
  /nix/store/74l4x6m97bvry7ccxv51h952ayvg2j46-stdenv-linux
  /nix/store/8jq7wailfnal1f7mwfzg76jbmccba5ml-xgcc-12.3.0-libgcc
  /nix/store/vaz5x08kr132jcws790vrrr4lpflb2pb-xz-5.4.3
  /nix/store/iwm337bvpvqk8lbijszc6l92n928s3rd-xz-5.4.3-bin
  /nix/store/k54w79m79x2hkc1i8ps7l4fry576dpvs-zlib-1.2.13
copying path '/nix/store/8jq7wailfnal1f7mwfzg76jbmccba5ml-xgcc-12.3.0-libgcc' from 'https://cache.nixos.org'...
copying path '/nix/store/gsxrw0g0as0j40q4513igx9c2g0qf5s4-libunistring-1.1' from 'https://cache.nixos.org'...
copying path '/nix/store/0zskr8vlaa77alvcahg4wzwpcdjwmyyn-linux-headers-6.3' from 'https://cache.nixos.org'...
copying path '/nix/store/v75y3qd2i450dgpmd2i9qk9vwmn0qmrh-gcc-12.3.0-libgcc' from 'https://cache.nixos.org'...
copying path '/nix/store/4b3rnvq1cl5ihavg96gkwjr61857d67g-libidn2-2.3.4' from 'https://cache.nixos.org'...
copying path '/nix/store/flf14c3ibr83jsa070j25hg5gjapydhl-glibc-2.37-8' from 'https://cache.nixos.org'...
copying path '/nix/store/xfb3ykw9r5hpayd05sr0cizwadzq1d8q-bash-5.2-p15' from 'https://cache.nixos.org'...
copying path '/nix/store/2g3jazymqbjw9c390c3b7vw8xq3r8iny-hello-2.12.1' from 'https://cache.nixos.org'...
copying path '/nix/store/fh7aqzj11ky8sggaf9sd2sk5yvxa6b1h-ncurses-6.4' from 'https://cache.nixos.org'...
copying path '/nix/store/c6bvswjq3hmy69wd7nsf3cjv8b7v221s-gnused-4.9' from 'https://cache.nixos.org'...
copying path '/nix/store/gwzahrpi1i5g3plffv4hxcbrgmm64ldq-gawk-5.2.1' from 'https://cache.nixos.org'...
copying path '/nix/store/s2kbmc692imlf0l21q5hs1j0ck7m3j7q-gnumake-4.4.1' from 'https://cache.nixos.org'...
copying path '/nix/store/fz42p8ap25rxlxhxdyr4lc794lx0nsk3-pcre2-10.42' from 'https://cache.nixos.org'...
copying path '/nix/store/bh2ywx08i5nn434m9b9m40fmfkshbp08-glibc-2.37-8-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/n7pvb7gdf1g6dvj7sl92i882qjl4kyx9-gcc-12.3.0-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/p6gidpg60rhrgjdp54xfbzisifz5b2mn-expand-response-params' from 'https://cache.nixos.org'...
copying path '/nix/store/vaz5x08kr132jcws790vrrr4lpflb2pb-xz-5.4.3' from 'https://cache.nixos.org'...
copying path '/nix/store/hiyfgknrcqdkr4py2x8scfn3qya807dn-bzip2-1.0.8' from 'https://cache.nixos.org'...
copying path '/nix/store/k54w79m79x2hkc1i8ps7l4fry576dpvs-zlib-1.2.13' from 'https://cache.nixos.org'...
copying path '/nix/store/0hm9hyjspmkj1i498dbsbmsc3rjk8dvv-ed-1.19' from 'https://cache.nixos.org'...
copying path '/nix/store/kzwglqcjxdgm9wd4f765imp23fg8lwn1-gmp-6.2.1' from 'https://cache.nixos.org'...
copying path '/nix/store/ykzqv6i5z0m8hwlqg0gjgn1jw021g74q-attr-2.5.1' from 'https://cache.nixos.org'...
copying path '/nix/store/jniy9n8nlcl8qr3c5gyhf0a4zr50373g-bzip2-1.0.8-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/11v1wxbbp0gc196q0rlc3cq5k1bpzqsx-acl-2.3.1' from 'https://cache.nixos.org'...
copying path '/nix/store/z92f3csj3f2milw6bvyfg02sijbzvhcx-patch-2.7.6' from 'https://cache.nixos.org'...
copying path '/nix/store/sgqwnn555n5dl9vj97gaydgp62vqdgqj-file-5.44' from 'https://cache.nixos.org'...
copying path '/nix/store/zrljf6fvil9ircbgcvdnw43hxp4ynl7v-binutils-2.40-lib' from 'https://cache.nixos.org'...
copying path '/nix/store/dfj2ws0dha05x36klk1kw79jwzg15z2q-gnutar-1.34' from 'https://cache.nixos.org'...
copying path '/nix/store/iwm337bvpvqk8lbijszc6l92n928s3rd-xz-5.4.3-bin' from 'https://cache.nixos.org'...
copying path '/nix/store/76ni01d3z506896ha3vsa924aby1p1j0-isl-0.20' from 'https://cache.nixos.org'...
copying path '/nix/store/nld8lfblqxdhk6z5s5pkqgqqjz6l0bv4-mpfr-4.2.0' from 'https://cache.nixos.org'...
copying path '/nix/store/b4212fn6w9agbxpj3i16wiy8l0il2kr3-gzip-1.12' from 'https://cache.nixos.org'...
copying path '/nix/store/bjbvd4drv2awzyx66m5hkarkrvj389pi-gnugrep-3.11' from 'https://cache.nixos.org'...
copying path '/nix/store/4ms9ygl7pjqv5x3y4rs2599jfhr4pjvs-readline-8.2p1' from 'https://cache.nixos.org'...
copying path '/nix/store/i29k9pvl90385mpsavifqvm4rag684dn-glibc-2.37-8-dev' from 'https://cache.nixos.org'...
copying path '/nix/store/ihyzbgqnmh85jr3z0pwgfj1k2clwfb5y-libmpc-1.3.1' from 'https://cache.nixos.org'...
copying path '/nix/store/j1bznhli95dsjwgcpvaxgkaivzc1wqc3-bash-interactive-5.2-p15' from 'https://cache.nixos.org'...
copying path '/nix/store/lgapq71q5prr2b8ksz43wyxmk2bg83j9-patchelf-0.15.0' from 'https://cache.nixos.org'...
copying path '/nix/store/2vwipws2crqcjxfzjyq9rjpk61iqf7pf-gcc-12.3.0' from 'https://cache.nixos.org'...
copying path '/nix/store/gwmmh9hjjr1f2fnv7ygl7fr3x97krf0q-gmp-with-cxx-6.2.1' from 'https://cache.nixos.org'...
copying path '/nix/store/fx1h3mmzl2hjci3nn15n26r57mc3cs3z-binutils-2.40' from 'https://cache.nixos.org'...
copying path '/nix/store/mnjksxz8alkwf6pa74a9j04h93p3y2sy-coreutils-9.3' from 'https://cache.nixos.org'...
copying path '/nix/store/ng1nxslr5vfachs9rhiaa007l7danl6i-findutils-4.9.0' from 'https://cache.nixos.org'...
copying path '/nix/store/rcqdcdca7f6kfvg20dppw5164cmrcizn-diffutils-3.9' from 'https://cache.nixos.org'...
copying path '/nix/store/vrhv7hg2jqvj78zd8xk42n70bf17i6hb-binutils-wrapper-2.40' from 'https://cache.nixos.org'...
copying path '/nix/store/frxg2hvacachpkv3ywdpmfl5pl2yg5y6-gcc-wrapper-12.3.0' from 'https://cache.nixos.org'...
copying path '/nix/store/74l4x6m97bvry7ccxv51h952ayvg2j46-stdenv-linux' from 'https://cache.nixos.org'...
error: executing shell '/nix/store/j1bznhli95dsjwgcpvaxgkaivzc1wqc3-bash-interactive-5.2-p15/bin/bash': No such file or directory
  1. unset NIX_CONFIG
  2. ./shebang.sh
  3. See success:
these 4 paths will be fetched (1.76 MiB download, 11.13 MiB unpacked):
  /nix/store/j1bznhli95dsjwgcpvaxgkaivzc1wqc3-bash-interactive-5.2-p15
  /nix/store/2g3jazymqbjw9c390c3b7vw8xq3r8iny-hello-2.12.1
  /nix/store/fh7aqzj11ky8sggaf9sd2sk5yvxa6b1h-ncurses-6.4
  /nix/store/4ms9ygl7pjqv5x3y4rs2599jfhr4pjvs-readline-8.2p1
copying path '/nix/store/2g3jazymqbjw9c390c3b7vw8xq3r8iny-hello-2.12.1' from 'https://cache.nixos.org'...
copying path '/nix/store/fh7aqzj11ky8sggaf9sd2sk5yvxa6b1h-ncurses-6.4' from 'https://cache.nixos.org'...
copying path '/nix/store/4ms9ygl7pjqv5x3y4rs2599jfhr4pjvs-readline-8.2p1' from 'https://cache.nixos.org'...
copying path '/nix/store/j1bznhli95dsjwgcpvaxgkaivzc1wqc3-bash-interactive-5.2-p15' from 'https://cache.nixos.org'...
Hello, world!

Expected behavior

With NIX_CONFIG set, the shebang should still succeed: interpreter should be taken from the store config value, not from /nix/store.

nix --version output

nix (Lix, like Nix) 2.92.0-dev-pre20241020-068f4b1

Additional context

Platform is x86_64-linux, auto-optimise-store = true is enabled.

## Describe the bug `nix-shell -i` takes an interpreter from `/nix/store` hardcoded. When changing the store with `store` config value, `-i` ignores it and tries to look at hardcoded `/nix/store`. This leads to brokenness and failures. Discovered while working on tests for [CL#2062](https://gerrit.lix.systems/c/lix/+/2062) ## Steps To Reproduce 1. Create a test dir: `mktemp -d` and `cd` into it 2. Create script `shebang.sh`: ```bash #! /usr/bin/env nix-shell #! nix-shell -i bash -p hello hello ``` 3. `chmod +x shebang.sh` 4. `mkdir -p nix/store` 5. `export NIX_CONFIG='store = /tmp/<tmpdir>` 6. `./shebang.sh` 7. See error: ``` these 47 paths will be fetched (70.76 MiB download, 331.30 MiB unpacked): /nix/store/11v1wxbbp0gc196q0rlc3cq5k1bpzqsx-acl-2.3.1 /nix/store/ykzqv6i5z0m8hwlqg0gjgn1jw021g74q-attr-2.5.1 /nix/store/xfb3ykw9r5hpayd05sr0cizwadzq1d8q-bash-5.2-p15 /nix/store/j1bznhli95dsjwgcpvaxgkaivzc1wqc3-bash-interactive-5.2-p15 /nix/store/fx1h3mmzl2hjci3nn15n26r57mc3cs3z-binutils-2.40 /nix/store/zrljf6fvil9ircbgcvdnw43hxp4ynl7v-binutils-2.40-lib /nix/store/vrhv7hg2jqvj78zd8xk42n70bf17i6hb-binutils-wrapper-2.40 /nix/store/hiyfgknrcqdkr4py2x8scfn3qya807dn-bzip2-1.0.8 /nix/store/jniy9n8nlcl8qr3c5gyhf0a4zr50373g-bzip2-1.0.8-bin /nix/store/mnjksxz8alkwf6pa74a9j04h93p3y2sy-coreutils-9.3 /nix/store/rcqdcdca7f6kfvg20dppw5164cmrcizn-diffutils-3.9 /nix/store/0hm9hyjspmkj1i498dbsbmsc3rjk8dvv-ed-1.19 /nix/store/p6gidpg60rhrgjdp54xfbzisifz5b2mn-expand-response-params /nix/store/sgqwnn555n5dl9vj97gaydgp62vqdgqj-file-5.44 /nix/store/ng1nxslr5vfachs9rhiaa007l7danl6i-findutils-4.9.0 /nix/store/gwzahrpi1i5g3plffv4hxcbrgmm64ldq-gawk-5.2.1 /nix/store/2vwipws2crqcjxfzjyq9rjpk61iqf7pf-gcc-12.3.0 /nix/store/n7pvb7gdf1g6dvj7sl92i882qjl4kyx9-gcc-12.3.0-lib /nix/store/v75y3qd2i450dgpmd2i9qk9vwmn0qmrh-gcc-12.3.0-libgcc /nix/store/frxg2hvacachpkv3ywdpmfl5pl2yg5y6-gcc-wrapper-12.3.0 /nix/store/flf14c3ibr83jsa070j25hg5gjapydhl-glibc-2.37-8 /nix/store/bh2ywx08i5nn434m9b9m40fmfkshbp08-glibc-2.37-8-bin /nix/store/i29k9pvl90385mpsavifqvm4rag684dn-glibc-2.37-8-dev /nix/store/kzwglqcjxdgm9wd4f765imp23fg8lwn1-gmp-6.2.1 /nix/store/gwmmh9hjjr1f2fnv7ygl7fr3x97krf0q-gmp-with-cxx-6.2.1 /nix/store/bjbvd4drv2awzyx66m5hkarkrvj389pi-gnugrep-3.11 /nix/store/s2kbmc692imlf0l21q5hs1j0ck7m3j7q-gnumake-4.4.1 /nix/store/c6bvswjq3hmy69wd7nsf3cjv8b7v221s-gnused-4.9 /nix/store/dfj2ws0dha05x36klk1kw79jwzg15z2q-gnutar-1.34 /nix/store/b4212fn6w9agbxpj3i16wiy8l0il2kr3-gzip-1.12 /nix/store/2g3jazymqbjw9c390c3b7vw8xq3r8iny-hello-2.12.1 /nix/store/76ni01d3z506896ha3vsa924aby1p1j0-isl-0.20 /nix/store/4b3rnvq1cl5ihavg96gkwjr61857d67g-libidn2-2.3.4 /nix/store/ihyzbgqnmh85jr3z0pwgfj1k2clwfb5y-libmpc-1.3.1 /nix/store/gsxrw0g0as0j40q4513igx9c2g0qf5s4-libunistring-1.1 /nix/store/0zskr8vlaa77alvcahg4wzwpcdjwmyyn-linux-headers-6.3 /nix/store/nld8lfblqxdhk6z5s5pkqgqqjz6l0bv4-mpfr-4.2.0 /nix/store/fh7aqzj11ky8sggaf9sd2sk5yvxa6b1h-ncurses-6.4 /nix/store/z92f3csj3f2milw6bvyfg02sijbzvhcx-patch-2.7.6 /nix/store/lgapq71q5prr2b8ksz43wyxmk2bg83j9-patchelf-0.15.0 /nix/store/fz42p8ap25rxlxhxdyr4lc794lx0nsk3-pcre2-10.42 /nix/store/4ms9ygl7pjqv5x3y4rs2599jfhr4pjvs-readline-8.2p1 /nix/store/74l4x6m97bvry7ccxv51h952ayvg2j46-stdenv-linux /nix/store/8jq7wailfnal1f7mwfzg76jbmccba5ml-xgcc-12.3.0-libgcc /nix/store/vaz5x08kr132jcws790vrrr4lpflb2pb-xz-5.4.3 /nix/store/iwm337bvpvqk8lbijszc6l92n928s3rd-xz-5.4.3-bin /nix/store/k54w79m79x2hkc1i8ps7l4fry576dpvs-zlib-1.2.13 copying path '/nix/store/8jq7wailfnal1f7mwfzg76jbmccba5ml-xgcc-12.3.0-libgcc' from 'https://cache.nixos.org'... copying path '/nix/store/gsxrw0g0as0j40q4513igx9c2g0qf5s4-libunistring-1.1' from 'https://cache.nixos.org'... copying path '/nix/store/0zskr8vlaa77alvcahg4wzwpcdjwmyyn-linux-headers-6.3' from 'https://cache.nixos.org'... copying path '/nix/store/v75y3qd2i450dgpmd2i9qk9vwmn0qmrh-gcc-12.3.0-libgcc' from 'https://cache.nixos.org'... copying path '/nix/store/4b3rnvq1cl5ihavg96gkwjr61857d67g-libidn2-2.3.4' from 'https://cache.nixos.org'... copying path '/nix/store/flf14c3ibr83jsa070j25hg5gjapydhl-glibc-2.37-8' from 'https://cache.nixos.org'... copying path '/nix/store/xfb3ykw9r5hpayd05sr0cizwadzq1d8q-bash-5.2-p15' from 'https://cache.nixos.org'... copying path '/nix/store/2g3jazymqbjw9c390c3b7vw8xq3r8iny-hello-2.12.1' from 'https://cache.nixos.org'... copying path '/nix/store/fh7aqzj11ky8sggaf9sd2sk5yvxa6b1h-ncurses-6.4' from 'https://cache.nixos.org'... copying path '/nix/store/c6bvswjq3hmy69wd7nsf3cjv8b7v221s-gnused-4.9' from 'https://cache.nixos.org'... copying path '/nix/store/gwzahrpi1i5g3plffv4hxcbrgmm64ldq-gawk-5.2.1' from 'https://cache.nixos.org'... copying path '/nix/store/s2kbmc692imlf0l21q5hs1j0ck7m3j7q-gnumake-4.4.1' from 'https://cache.nixos.org'... copying path '/nix/store/fz42p8ap25rxlxhxdyr4lc794lx0nsk3-pcre2-10.42' from 'https://cache.nixos.org'... copying path '/nix/store/bh2ywx08i5nn434m9b9m40fmfkshbp08-glibc-2.37-8-bin' from 'https://cache.nixos.org'... copying path '/nix/store/n7pvb7gdf1g6dvj7sl92i882qjl4kyx9-gcc-12.3.0-lib' from 'https://cache.nixos.org'... copying path '/nix/store/p6gidpg60rhrgjdp54xfbzisifz5b2mn-expand-response-params' from 'https://cache.nixos.org'... copying path '/nix/store/vaz5x08kr132jcws790vrrr4lpflb2pb-xz-5.4.3' from 'https://cache.nixos.org'... copying path '/nix/store/hiyfgknrcqdkr4py2x8scfn3qya807dn-bzip2-1.0.8' from 'https://cache.nixos.org'... copying path '/nix/store/k54w79m79x2hkc1i8ps7l4fry576dpvs-zlib-1.2.13' from 'https://cache.nixos.org'... copying path '/nix/store/0hm9hyjspmkj1i498dbsbmsc3rjk8dvv-ed-1.19' from 'https://cache.nixos.org'... copying path '/nix/store/kzwglqcjxdgm9wd4f765imp23fg8lwn1-gmp-6.2.1' from 'https://cache.nixos.org'... copying path '/nix/store/ykzqv6i5z0m8hwlqg0gjgn1jw021g74q-attr-2.5.1' from 'https://cache.nixos.org'... copying path '/nix/store/jniy9n8nlcl8qr3c5gyhf0a4zr50373g-bzip2-1.0.8-bin' from 'https://cache.nixos.org'... copying path '/nix/store/11v1wxbbp0gc196q0rlc3cq5k1bpzqsx-acl-2.3.1' from 'https://cache.nixos.org'... copying path '/nix/store/z92f3csj3f2milw6bvyfg02sijbzvhcx-patch-2.7.6' from 'https://cache.nixos.org'... copying path '/nix/store/sgqwnn555n5dl9vj97gaydgp62vqdgqj-file-5.44' from 'https://cache.nixos.org'... copying path '/nix/store/zrljf6fvil9ircbgcvdnw43hxp4ynl7v-binutils-2.40-lib' from 'https://cache.nixos.org'... copying path '/nix/store/dfj2ws0dha05x36klk1kw79jwzg15z2q-gnutar-1.34' from 'https://cache.nixos.org'... copying path '/nix/store/iwm337bvpvqk8lbijszc6l92n928s3rd-xz-5.4.3-bin' from 'https://cache.nixos.org'... copying path '/nix/store/76ni01d3z506896ha3vsa924aby1p1j0-isl-0.20' from 'https://cache.nixos.org'... copying path '/nix/store/nld8lfblqxdhk6z5s5pkqgqqjz6l0bv4-mpfr-4.2.0' from 'https://cache.nixos.org'... copying path '/nix/store/b4212fn6w9agbxpj3i16wiy8l0il2kr3-gzip-1.12' from 'https://cache.nixos.org'... copying path '/nix/store/bjbvd4drv2awzyx66m5hkarkrvj389pi-gnugrep-3.11' from 'https://cache.nixos.org'... copying path '/nix/store/4ms9ygl7pjqv5x3y4rs2599jfhr4pjvs-readline-8.2p1' from 'https://cache.nixos.org'... copying path '/nix/store/i29k9pvl90385mpsavifqvm4rag684dn-glibc-2.37-8-dev' from 'https://cache.nixos.org'... copying path '/nix/store/ihyzbgqnmh85jr3z0pwgfj1k2clwfb5y-libmpc-1.3.1' from 'https://cache.nixos.org'... copying path '/nix/store/j1bznhli95dsjwgcpvaxgkaivzc1wqc3-bash-interactive-5.2-p15' from 'https://cache.nixos.org'... copying path '/nix/store/lgapq71q5prr2b8ksz43wyxmk2bg83j9-patchelf-0.15.0' from 'https://cache.nixos.org'... copying path '/nix/store/2vwipws2crqcjxfzjyq9rjpk61iqf7pf-gcc-12.3.0' from 'https://cache.nixos.org'... copying path '/nix/store/gwmmh9hjjr1f2fnv7ygl7fr3x97krf0q-gmp-with-cxx-6.2.1' from 'https://cache.nixos.org'... copying path '/nix/store/fx1h3mmzl2hjci3nn15n26r57mc3cs3z-binutils-2.40' from 'https://cache.nixos.org'... copying path '/nix/store/mnjksxz8alkwf6pa74a9j04h93p3y2sy-coreutils-9.3' from 'https://cache.nixos.org'... copying path '/nix/store/ng1nxslr5vfachs9rhiaa007l7danl6i-findutils-4.9.0' from 'https://cache.nixos.org'... copying path '/nix/store/rcqdcdca7f6kfvg20dppw5164cmrcizn-diffutils-3.9' from 'https://cache.nixos.org'... copying path '/nix/store/vrhv7hg2jqvj78zd8xk42n70bf17i6hb-binutils-wrapper-2.40' from 'https://cache.nixos.org'... copying path '/nix/store/frxg2hvacachpkv3ywdpmfl5pl2yg5y6-gcc-wrapper-12.3.0' from 'https://cache.nixos.org'... copying path '/nix/store/74l4x6m97bvry7ccxv51h952ayvg2j46-stdenv-linux' from 'https://cache.nixos.org'... error: executing shell '/nix/store/j1bznhli95dsjwgcpvaxgkaivzc1wqc3-bash-interactive-5.2-p15/bin/bash': No such file or directory ``` 8. `unset NIX_CONFIG` 9. `./shebang.sh` 10. See success: ``` these 4 paths will be fetched (1.76 MiB download, 11.13 MiB unpacked): /nix/store/j1bznhli95dsjwgcpvaxgkaivzc1wqc3-bash-interactive-5.2-p15 /nix/store/2g3jazymqbjw9c390c3b7vw8xq3r8iny-hello-2.12.1 /nix/store/fh7aqzj11ky8sggaf9sd2sk5yvxa6b1h-ncurses-6.4 /nix/store/4ms9ygl7pjqv5x3y4rs2599jfhr4pjvs-readline-8.2p1 copying path '/nix/store/2g3jazymqbjw9c390c3b7vw8xq3r8iny-hello-2.12.1' from 'https://cache.nixos.org'... copying path '/nix/store/fh7aqzj11ky8sggaf9sd2sk5yvxa6b1h-ncurses-6.4' from 'https://cache.nixos.org'... copying path '/nix/store/4ms9ygl7pjqv5x3y4rs2599jfhr4pjvs-readline-8.2p1' from 'https://cache.nixos.org'... copying path '/nix/store/j1bznhli95dsjwgcpvaxgkaivzc1wqc3-bash-interactive-5.2-p15' from 'https://cache.nixos.org'... Hello, world! ``` ## Expected behavior With `NIX_CONFIG` set, the shebang should still succeed: interpreter should be taken from the `store` config value, not from `/nix/store`. ## `nix --version` output `nix (Lix, like Nix) 2.92.0-dev-pre20241020-068f4b1` ## Additional context Platform is `x86_64-linux`, `auto-optimise-store = true` is enabled.
kfearsoff added the
bug
label 2024-10-31 14:16:39 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: lix-project/lix#565
No description provided.