Closed lucc closed 1 year ago
@romanofski PTAL when able.
I think the problem is in .nix/nixpkgs.nix because it happens when I load this file alone in a repl:
$ nix repl --show-trace
Welcome to Nix 2.11.0. Type :? for help.
nix-repl> :l .nix/nixpkgs.nix
error: getting status of '/nix/store/rldh08aady2kz9md2li14da1kd04pd07-source': No such file or directory
… while evaluating anonymous lambda
at /home/luc/vcs/purebred/.nix/nixpkgs.nix:1:1:
1| { compiler ? null, nixpkgs ? null}:
| ^
2|
… from call site
nix-repl>
But I do not understand how this can affect a build via the nix flake because this file is only used in the default.nix file.
I just noticed that building with nix-build
instead of nix build
gives the same error:
$ nix-build --show-trace
error: getting status of '/nix/store/rldh08aady2kz9md2li14da1kd04pd07-source': No such file or directory
… while evaluating anonymous lambda
at /home/luc/vcs/purebred/.nix/nixpkgs.nix:1:1:
1| { compiler ? null, nixpkgs ? null}:
| ^
2|
… from call site
at /home/luc/vcs/purebred/default.nix:36:2:
35|
36| (import .nix/nixpkgs.nix args).purebred-with-packages
| ^
… while evaluating anonymous lambda
at /home/luc/vcs/purebred/default.nix:34:1:
33| #
34| { compiler ? null, nixpkgs ? null, with-icu ? false }@args:
| ^
35|
… from call site
Going out on a limb here, but do you have perhaps local modifications on the nix files? I can't reproduce your error, neither the CI, e.g.: https://github.com/purebred-mua/purebred/actions/runs/3063872557/jobs/4946426394
I do have trouble with the overlay and shell configuration (e.g. https://github.com/purebred-mua/purebred/action/runs/3063872556/jobs/4946426412#step:6:30703) but that seems to be only specific to the shell (dev env).
Are you able to build other flake based projects (e.g. https://github.com/cdepillabout/termonad) ?
I can nix build github:cdepillabout/termonad
just fine. I also can build purebred in a podman container and on another machine. My current hypothesis is that it either depends on the version of the nix daemon or something about my machine is broken in a very strange and local way that just the building of this flake fails.
For reference:
$ podman run -it --rm nixos/nix nix --version
nix (Nix) 2.5.1
$ podman run -it --rm nixos/nix nix build github:purebred-mua/purebred
works.
On nixos-22.05 with nix 2.8.1
$ nix --version
nix (Nix) 2.8.1
$ nix build github:purebred-mua/purebred
$ nix run nixpkgs#nixUnstable -- --version
nix (Nix) 2.11.0
$ nix run nixpkgs#nixUnstable -- build github:purebred-mua/purebred
works.
On nixos unstable with nix 2.11.0
$ nix --version
nix (Nix) 2.11.0
$ nix build github:purebred-mua/purebred
error: failed to open archive: Failed to open '/nix/store/d23x1rqviw440581axnrywgqyzxwz3gg-source'
(use '--show-trace' to show detailed location information)
$ nix run nixpkgs/nixos-22.05#nix -- --version
nix (Nix) 2.8.1
$ nix run nixpkgs/nixos-22.05#nix -- build github:purebred-mua/purebred
error: failed to open archive: Failed to open '/nix/store/d23x1rqviw440581axnrywgqyzxwz3gg-source'
(use '--show-trace' to show detailed location information)
both fail.
I conclude that this is some problem on my machine and we can close this issue.
I found the root cause: I had some "valid" paths in my database at /nix/var/nix/db/db.sqlite that did not exist on disk. I fixed it with nix store verify
and can now build purebred again.
Describe the bug
I am building with nix via the flake. This fails with the error message
To Reproduce
Try to build any of the packages provided by the flake
Expected behavior The build should succeed.
Additional context
I bisected this problem and it exists since ff75f5b24bac09b311ac547637f62f4f86ebc287. Even
nix flake show --show-trace
fails.output