!VRULIdgoKmKPzJZzjj:nixos.org

Nix Hackers

974 Members
For people hacking on the Nix package manager itself206 Servers

Load older messages


SenderMessageTime
10 Oct 2021
@balsoft:balsoft.rubalsoft Even referencing $out works 16:48:13
@balsoft:balsoft.rubalsoft
nix-repl> import (pkgs.runCommand "file.nix" {} ''echo "{ foo = $out; }" > $out'')
{ foo = /nix/store/56zm7p8bpnrxhpbw8plaxwngdr6y094y-file.nix; }
16:48:26
@balsoft:balsoft.rubalsoftI wonder what's special about crate2nix16:48:44
@tomberek:matrix.orgtomberekthis is happening in a primop, filterSource or path16:49:19
@balsoft:balsoft.rubalsoftYeah, I saw the commit message16:49:34
@tomberek:matrix.orgtomberek"addPath" is used by those, perhaps crate2nix uses one of them?16:49:38
@balsoft:balsoft.rubalsoftSo I'm looking for those in crate2nix16:49:38
@balsoft:balsoft.rubalsoftInterestingly, once it has been built once using older nix it then works with newer nix16:50:48
@balsoft:balsoft.rubalsoftAlthough I guess this is down to flake caching16:50:54
@balsoft:balsoft.rubalsoftYes16:51:35
@balsoft:balsoft.rubalsoft

Here's the trace

error: store path '/nix/store/d0vm5k50fa9d6cjlch6s9cw61gn80xds-himalaya-crate2nix' is not allowed to have references

       … while adding path '/nix/store/d0vm5k50fa9d6cjlch6s9cw61gn80xds-himalaya-crate2nix/crate'

       at /nix/store/v316zxg1w7x8343xs9lmhkh5hvjmprsq-source/lib/sources.nix:240:17:

          239|       inherit origSrc filter name;
          240|       outPath = builtins.path { inherit filter name; path = origSrc; };
             |                 ^
          241|     };

       … while evaluating the attribute 'src' of the derivation 'rust_himalaya-0.4.0'

       at /nix/store/v316zxg1w7x8343xs9lmhkh5hvjmprsq-source/pkgs/stdenv/generic/make-derivation.nix:203:11:

          202|         // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          203|           name =
             |           ^
          204|             let
16:51:45
@tomberek:matrix.orgtomberek Yeah. Caching is great??? But with a cleared cache and gc’ing the paths, should be able to remake the problem. Perhaps use “path” in the minimal example. 16:52:24
@balsoft:balsoft.rubalsoft
In reply to @tomberek:matrix.org
Yeah. Caching is great??? But with a cleared cache and gc’ing the paths, should be able to remake the problem. Perhaps use “path” in the minimal example.
Yeah with --no-eval-cache it fails successfully :D
16:53:02
@balsoft:balsoft.rubalsoftOh, hm, interesting. I wonder why it knows that derivation name16:53:51
@balsoft:balsoft.rubalsoft Even more interesting is that it tries to add only one directory, crate 16:55:03
@balsoft:balsoft.rubalsoft * Even more interesting is that it tries to add only one subdirectory, crate 16:55:06
@balsoft:balsoft.rubalsoft
In reply to @balsoft:balsoft.ru

Here's the trace

error: store path '/nix/store/d0vm5k50fa9d6cjlch6s9cw61gn80xds-himalaya-crate2nix' is not allowed to have references

       … while adding path '/nix/store/d0vm5k50fa9d6cjlch6s9cw61gn80xds-himalaya-crate2nix/crate'

       at /nix/store/v316zxg1w7x8343xs9lmhkh5hvjmprsq-source/lib/sources.nix:240:17:

          239|       inherit origSrc filter name;
          240|       outPath = builtins.path { inherit filter name; path = origSrc; };
             |                 ^
          241|     };

       … while evaluating the attribute 'src' of the derivation 'rust_himalaya-0.4.0'

       at /nix/store/v316zxg1w7x8343xs9lmhkh5hvjmprsq-source/pkgs/stdenv/generic/make-derivation.nix:203:11:

          202|         // (lib.optionalAttrs (attrs ? name || (attrs ? pname && attrs ? version)) {
          203|           name =
             |           ^
          204|             let
Ok, I actually looked at the trace now
16:56:30
@balsoft:balsoft.rubalsoft The derivation which we import via IFD is using cleanSourceWith 16:57:45
@balsoft:balsoft.rubalsoft So, I suppose, it takes issue with the fact that we're using builtins.path on a derivation output? 16:59:49
@balsoft:balsoft.rubalsoftBut then why how and why did it work before?17:00:06
@tomberek:matrix.orgtomberekBefore the check was if the context was empty. Now it is if the path has references. So we have a path with no context, but with references?17:06:46
@balsoft:balsoft.rubalsoftYeah, I have confirmed that the context is indeed empty19:04:16
@balsoft:balsoft.rubalsoftAnd yet there are references19:04:18
@tomberek:matrix.orgtomberekSo it’s all working as expected via the logic in that commit. Is that the wrong logic? How can we fix it? Check if references are already allowed?19:45:34
@balsoft:balsoft.rubalsoftI guess I'll try just not checking for references :D20:23:02
@balsoft:balsoft.rubalsoftIt seemed to work before...20:23:06
@balsoft:balsoft.rubalsoftYeah it evals and builds fine20:23:22
@tomberek:matrix.orgtomberek Well. You may be getting lucky that the references exist in your store already. It’s possible that can result in dangling references. 22:05:57
@balsoft:balsoft.rubalsoftThat's true22:06:12
@balsoft:balsoft.rubalsoft Maybe we should solve that with a simple stupid solution and just force all the references to be built in the addPath function? 22:06:57

Show newer messages


Back to Room ListRoom Version: 6