naersk
naersk copied to clipboard
Doesn't eval in chroot store.
The docs around chroot stores are basically non-existant so I may be doing it wrong but it appears as though the following should work but doesn't. It is also possible that the bug is in nix not naersk.
% nix-build --eval-store /tmp/store --store /tmp/store --show-trace error: Naersk requires Cargo.lock to be available in root. Check that it is not in .gitignore and stage it when using git to filter sources (which flakes does)
--show-trace output
… while evaluating the attribute '<font color="#A347BA"><b>cargolock</b></font>' <font color="#12488B"><b>at </b></font><font color="#A347BA"><b>/tmp/store/nix/store/hjypddv3hislmga0hrwyy6fi2mkqaazp-source/config.nix:352:5</b></font>: 351| # The cargo lock 352| cargolock = | <font color="#C01C28"><b>^</b></font> 353| let … while evaluating <font color="#A347BA"><b>'mkVersions'</b></font> <font color="#12488B"><b>at </b></font><font color="#A347BA"><b>/tmp/store/nix/store/hjypddv3hislmga0hrwyy6fi2mkqaazp-source/lib.nix:13:16</b></font>: 12| # [ { name = "wabt", version = "2.0.6", sha256 = "..." } ] 13| mkVersions = cargolock: | <font color="#C01C28"><b>^</b></font> 14| if builtins.hasAttr "metadata" cargolock then … from call site <font color="#12488B"><b>at </b></font><font color="#A347BA"><b>/tmp/store/nix/store/hjypddv3hislmga0hrwyy6fi2mkqaazp-source/config.nix:243:25</b></font>: 242| # [ { name = "wabt", version = "2.0.6", sha256 = "..." } ] 243| crateDependencies = libb.mkVersions buildPlanConfig.cargolock; | <font color="#C01C28"><b>^</b></font> 244| }; … while evaluating the attribute '<font color="#A347BA"><b>paths</b></font>' of the derivation '<font color="#A347BA"><b>crates-io</b></font>' <font color="#12488B"><b>at </b></font><font color="#A347BA"><b>/nix/store/i9i9cr2mdyh1slzgqlw32idbngqk12c1-nixos-22.05pre338578.a2e281f5770/nixos/pkgs/stdenv/generic/make-derivation.nix:205:7</b></font>: 204| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) { 205| name = | <font color="#C01C28"><b>^</b></font> 206| let … while evaluating <font color="#A347BA"><b>'outputVal'</b></font> <font color="#12488B"><b>at </b></font><font color="#A347BA"><b>/tmp/store/nix/store/hjypddv3hislmga0hrwyy6fi2mkqaazp-source/builtins/to-toml.nix:41:15</b></font>: 40| 41| outputVal = v: | <font color="#C01C28"><b>^</b></font> 42| let … from call site <font color="#12488B"><b>at </b></font><font color="#A347BA"><b>/tmp/store/nix/store/hjypddv3hislmga0hrwyy6fi2mkqaazp-source/builtins/to-toml.nix:39:9</b></font>: 38| "{ ${valsStr} }" else 39| outputVal v; | <font color="#C01C28"><b>^</b></font> 40| … while evaluating <font color="#A347BA"><b>'outputValInner'</b></font> <font color="#12488B"><b>at </b></font><font color="#A347BA"><b>/tmp/store/nix/store/hjypddv3hislmga0hrwyy6fi2mkqaazp-source/builtins/to-toml.nix:28:20</b></font>: 27| 28| outputValInner = v: | <font color="#C01C28"><b>^</b></font> 29| let … from call site <font color="#12488B"><b>at </b></font><font color="#A347BA"><b>/tmp/store/nix/store/hjypddv3hislmga0hrwyy6fi2mkqaazp-source/builtins/to-toml.nix:69:42</b></font>: 68| vals = mapAttrsToList 69| (k': v': "${quoteKey k'} = ${outputValInner v'}") v; | <font color="#C01C28"><b>^</b></font> 70| valsStr = concatStringsSep ", " vals; … while evaluating <font color="#A347BA"><b>anonymous lambda</b></font> <font color="#12488B"><b>at </b></font><font color="#A347BA"><b>/tmp/store/nix/store/hjypddv3hislmga0hrwyy6fi2mkqaazp-source/builtins/to-toml.nix:69:18</b></font>: 68| vals = mapAttrsToList 69| (k': v': "${quoteKey k'} = ${outputValInner v'}") v; | <font color="#C01C28"><b>^</b></font> 70| valsStr = concatStringsSep ", " vals; … from call site <font color="#12488B"><b>at </b></font><font color="#A347BA"><b>/nix/store/i9i9cr2mdyh1slzgqlw32idbngqk12c1-nixos-22.05pre338578.a2e281f5770/nixos/lib/attrsets.nix:259:16</b></font>: 258| mapAttrsToList = f: attrs: 259| map (name: f name attrs.${name}) (attrNames attrs); | <font color="#C01C28"><b>^</b></font> 260| … while evaluating <font color="#A347BA"><b>anonymous lambda</b></font> <font color="#12488B"><b>at </b></font><font color="#A347BA"><b>/nix/store/i9i9cr2mdyh1slzgqlw32idbngqk12c1-nixos-22.05pre338578.a2e281f5770/nixos/lib/attrsets.nix:259:10</b></font>: 258| mapAttrsToList = f: attrs: 259| map (name: f name attrs.${name}) (attrNames attrs); | <font color="#C01C28"><b>^</b></font> 260| … from call site … while evaluating <font color="#A347BA"><b>anonymous lambda</b></font> <font color="#12488B"><b>at </b></font><font color="#A347BA"><b>/tmp/store/nix/store/hjypddv3hislmga0hrwyy6fi2mkqaazp-source/builtins/to-toml.nix:133:10</b></font>: 132| concatMapStringsSep "\n" 133| (kv: concatStringsSep "\n" (outputKeyVal kv.k kv.v)) | <font color="#C01C28"><b>^</b></font> 134| ( … from call site … while evaluating <font color="#A347BA"><b>'concatMapStringsSep'</b></font> <font color="#12488B"><b>at </b></font><font color="#A347BA"><b>/nix/store/i9i9cr2mdyh1slzgqlw32idbngqk12c1-nixos-22.05pre338578.a2e281f5770/nixos/lib/strings.nix:110:5</b></font>: 109| # List of input strings 110| list: concatStringsSep sep (map f list); | <font color="#C01C28"><b>^</b></font> 111| … from call site <font color="#12488B"><b>at </b></font><font color="#A347BA"><b>/tmp/store/nix/store/hjypddv3hislmga0hrwyy6fi2mkqaazp-source/builtins/to-toml.nix:132:7</b></font>: 131| in 132| concatMapStringsSep "\n" | <font color="#C01C28"><b>^</b></font> 133| (kv: concatStringsSep "\n" (outputKeyVal kv.k kv.v)) … while evaluating <font color="#A347BA"><b>'toTOML'</b></font> <font color="#12488B"><b>at </b></font><font color="#A347BA"><b>/tmp/store/nix/store/hjypddv3hislmga0hrwyy6fi2mkqaazp-source/builtins/to-toml.nix:119:12</b></font>: 118| 119| toTOML = attrs: | <font color="#C01C28"><b>^</b></font> 120| assert (typeOf attrs == "set"); … from call site <font color="#12488B"><b>at </b></font><font color="#A347BA"><b>/tmp/store/nix/store/hjypddv3hislmga0hrwyy6fi2mkqaazp-source/build.nix:154:19</b></font>: 153| # and git dependencies. 154| cargoconfig = builtinz.toTOML { | <font color="#C01C28"><b>^</b></font> 155| source = { … while evaluating the attribute '<font color="#A347BA"><b>cargoconfig</b></font>' of the derivation '<font color="#A347BA"><b>feed-test-deps-0.1.0</b></font>' <font color="#12488B"><b>at </b></font><font color="#A347BA"><b>/nix/store/i9i9cr2mdyh1slzgqlw32idbngqk12c1-nixos-22.05pre338578.a2e281f5770/nixos/pkgs/stdenv/generic/make-derivation.nix:205:7</b></font>: 204| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) { 205| name = | <font color="#C01C28"><b>^</b></font> 206| let … while evaluating the attribute '<font color="#A347BA"><b>builtDependencies</b></font>' of the derivation '<font color="#A347BA"><b>feed-test-0.1.0</b></font>' <font color="#12488B"><b>at </b></font><font color="#A347BA"><b>/nix/store/i9i9cr2mdyh1slzgqlw32idbngqk12c1-nixos-22.05pre338578.a2e281f5770/nixos/pkgs/stdenv/generic/make-derivation.nix:205:7</b></font>: 204| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) { 205| name = | <font color="#C01C28"><b>^</b></font> 206| let … while evaluating the attribute '<font color="#A347BA"><b>text</b></font>' of the derivation '<font color="#A347BA"><b>feed-test-config.json</b></font>' <font color="#12488B"><b>at </b></font><font color="#A347BA"><b>/nix/store/i9i9cr2mdyh1slzgqlw32idbngqk12c1-nixos-22.05pre338578.a2e281f5770/nixos/pkgs/stdenv/generic/make-derivation.nix:205:7</b></font>: 204| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) { 205| name = | <font color="#C01C28"><b>^</b></font> 206| let … while evaluating the attribute '<font color="#A347BA"><b>baseJson</b></font>' of the derivation '<font color="#A347BA"><b>docker-image-feed-test.tar.gz</b></font>' <font color="#12488B"><b>at </b></font><font color="#A347BA"><b>/nix/store/i9i9cr2mdyh1slzgqlw32idbngqk12c1-nixos-22.05pre338578.a2e281f5770/nixos/pkgs/stdenv/generic/make-derivation.nix:205:7</b></font>: 204| // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) { 205| name = | <font color="#C01C28"><b>^</b></font> 206| let
This was performed in a clean checkout of https://gitlab.com/kevincox/feed-test but seems to happen on all naersk repos.
I also tried with just --store and just --eval-store and got the same error.
The source does appear to be in the chroot store so I don't know what is going wrong.
% l /tmp/store/nix/store/115xvqbgrn9np9nll1d18961d32rwh63-feed-test
total 64K
-r--r--r-- 2 kevincox users 45K 1969-12-31 19:00 Cargo.lock
-r--r--r-- 2 kevincox users 487 1969-12-31 19:00 Cargo.toml
-r--r--r-- 2 kevincox users 2.3K 1969-12-31 19:00 kube.ecl
-r--r--r-- 2 kevincox users 273 1969-12-31 19:00 README.md
-r--r--r-- 2 kevincox users 121 1969-12-31 19:00 renovate.json5
dr-xr-xr-x 2 kevincox users 140 1969-12-31 19:00 src
dr-xr-xr-x 2 kevincox users 60 1969-12-31 19:00 static
% l /nix/store/115xvqbgrn9np9nll1d18961d32rwh63-feed-test
ls: cannot access '/nix/store/115xvqbgrn9np9nll1d18961d32rwh63-feed-test': No such file or directory
It is worth noting that running the build once outside of the chroot store makes the problem go away. Presumably because it is accidentally reading the sources from the host store.
This can be worked around by passing --eval-store local along with --store /whatever.