Open teto opened 4 years ago
In that phase, nix-index
calls nix to determine which derivations are available. Can you check if the following terminates for you:
nix-env -qaP --out-path --xml --arg config '{}' --file '<nixpkgs>'
nix-env -qaP --out-path --xml --arg config '{}' --file '<nixpkgs>' -A xlibs
nix-env -qaP --out-path --xml --arg config '{}' --file '<nixpkgs>' -A haskellPackages
nix-env -qaP --out-path --xml --arg config '{}' --file '<nixpkgs>' -A rPackages
nix-env -qaP --out-path --xml --arg config '{}' --file '<nixpkgs>' -A nodePackages
nix-env -qaP --out-path --xml --arg config '{}' --file '<nixpkgs>' -A coqPackages
I've experienced several crashes with nixFlakes https://github.com/NixOS/nix/issues/3377 and it seems this is the root cause since:
`nix-env -qaP --out-path --xml --arg config '{}' --file '
zsh: segmentation fault (core dumped) nix-env -qaP --out-path --xml --arg config '{}' --file '
Ok, so while this is not a bug per-se in nix-index, it should give a better error message
This happens for me when nix-env prints warnings.
warning: unknown setting 'experimental-features'
warning: unknown setting 'extra-trusted-public-keys'
warning: Nix search path entry '/home/user/src/nixpkgs' does not exist, ignoring
I think overriding the nix to nixUnstable should fix this.
summary
The below issue has been tracked down to a segmentation fault in nix (NixOS/nix#3377). Nix-index should catch critical failures from nix-env and display a helpful error message in that case, not hang indefinitely.
original issue
As a reference I use nixFlakes on a nixpkgs of mine but the same happens with channel:nixos-unstable.
nix-index has been running for 40min without any other output than
querying available packages
I've straced it a bit and these are the last lines