| 10 Oct 2021 |
balsoft | Even referencing $out works | 16:48:13 |
balsoft | nix-repl> import (pkgs.runCommand "file.nix" {} ''echo "{ foo = $out; }" > $out'')
{ foo = /nix/store/56zm7p8bpnrxhpbw8plaxwngdr6y094y-file.nix; }
| 16:48:26 |
balsoft | I wonder what's special about crate2nix | 16:48:44 |
tomberek | this is happening in a primop, filterSource or path | 16:49:19 |
balsoft | Yeah, I saw the commit message | 16:49:34 |
tomberek | "addPath" is used by those, perhaps crate2nix uses one of them? | 16:49:38 |
balsoft | So I'm looking for those in crate2nix | 16:49:38 |
balsoft | Interestingly, once it has been built once using older nix it then works with newer nix | 16:50:48 |
balsoft | Although I guess this is down to flake caching | 16:50:54 |
balsoft | Yes | 16:51:35 |
balsoft | 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 | 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 | 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 | Oh, hm, interesting. I wonder why it knows that derivation name | 16:53:51 |
balsoft | Even more interesting is that it tries to add only one directory, crate | 16:55:03 |
balsoft | * Even more interesting is that it tries to add only one subdirectory, crate | 16:55:06 |
balsoft | 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 | The derivation which we import via IFD is using cleanSourceWith | 16:57:45 |
balsoft | So, I suppose, it takes issue with the fact that we're using builtins.path on a derivation output? | 16:59:49 |
balsoft | But then why how and why did it work before? | 17:00:06 |
tomberek | Before 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 | Yeah, I have confirmed that the context is indeed empty | 19:04:16 |
balsoft | And yet there are references | 19:04:18 |
tomberek | So 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 | I guess I'll try just not checking for references :D | 20:23:02 |
balsoft | It seemed to work before... | 20:23:06 |
balsoft | Yeah it evals and builds fine | 20:23:22 |
tomberek | 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 | That's true | 22:06:12 |
balsoft | 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 |