After a nix-channel --update
I no longer have substitutes for various packages, some of which I can’t build from source, so my nix-env -u
is failing. This is my first time upgrading packages after installing Nix a few days ago, so I don’t really know how to diagnose or fix the issue myself.
I’m on nixpkgs-unstable, just using the default Nix install:
$ cat ~/.nix-channels
https://nixos.org/channels/nixpkgs-unstable nixpkgs
$ nix show-config | grep subst
builders-use-substitutes = false
extra-substituters =
substitute = true
substituters = https://cache.nixos.org/
trusted-substituters =
Here’s an example of a package for which no substitute is available and that I cannot build locally:
$ nix-env -qas python3
--- python3-3.10.0a5
--S python3-3.6.13
--S python3-3.6.13
--S python3-3.7.10
--S python3-3.7.10
-PS python3-3.8.8
--S python3-3.8.8
--S python3-3.8.8
-PS python3-3.8.8
--S python3-3.9.2
--S python3-3.9.2
$ nix-env -u python3
upgrading 'python3-3.8.8' to 'python3-3.10.0a5'
these derivations will be built:
/nix/store/3xx5xjrlmyia3kji1lrj08s98awk55c0-python3-3.10.0a5.drv
building '/nix/store/3xx5xjrlmyia3kji1lrj08s98awk55c0-python3-3.10.0a5.drv'...
unpacking sources
unpacking source archive /nix/store/6qjykfvkri219wk15gjijkfjs9ci0588-Python-3.10.0a5.tar.xz
source root is Python-3.10.0a5
setting SOURCE_DATE_EPOCH to timestamp 1612298741 of file Python-3.10.0a5/Misc/NEWS
patching sources
applying patch /nix/store/345r2zz7pgiyk91j89qlf7mhs95jrv6f-no-ldconfig.patch
patching file Lib/ctypes/util.py
applying patch /nix/store/9kwzs3pplms8sijf55sdryypzvic4x1s-python-3.x-distutils-C++.patch
patching file Lib/_osx_support.py
patching file Lib/distutils/cygwinccompiler.py
Hunk #1 succeeded at 123 (offset -2 lines).
Hunk #2 succeeded at 140 (offset -2 lines).
Hunk #3 succeeded at 170 (offset -2 lines).
Hunk #4 succeeded at 310 (offset -2 lines).
patching file Lib/distutils/sysconfig.py
Hunk #1 FAILED at 170.
Hunk #2 FAILED at 187.
Hunk #3 succeeded at 231 (offset 23 lines).
2 out of 3 hunks FAILED -- saving rejects to file Lib/distutils/sysconfig.py.rej
patching file Lib/distutils/unixccompiler.py
Hunk #3 FAILED at 183.
1 out of 3 hunks FAILED -- saving rejects to file Lib/distutils/unixccompiler.py.rej
patching file Makefile.pre.in
Hunk #1 succeeded at 619 (offset 35 lines).
builder for '/nix/store/3xx5xjrlmyia3kji1lrj08s98awk55c0-python3-3.10.0a5.drv' failed with exit code 1
error: build of '/nix/store/3xx5xjrlmyia3kji1lrj08s98awk55c0-python3-3.10.0a5.drv' failed
I have one other package that needs upgrading (according to nix-env -u --dry-run
) and also has no substitute:
$ nix-env -qas cabal-install-3.4.0.0
--- cabal-install-3.4.0.0
I don’t know if its build works, because I believe it would take several hours to complete.
I don’t really know what to do here: I thought that the channel lagged the nixpkgs repo by exactly long enough to populate the binary cache, but I have no idea “which” versions of which packages are put in the binary cache.
I tried to check the Hydra status:
$ cat ~/.nix-defexpr/channels/manifest.nix
[ { meta = { }; name = "nixpkgs-21.05pre274251.f5f6dc053b1"; out = { outPath = "/nix/store/mi0xpwzl81c7dgpr09qd67knbc24xab5-nixpkgs-21.05pre274251.f5f6dc053b1"; }; outPath = "/nix/store/mi0xpwzl81c7dgpr09qd67knbc24xab5-nixpkgs-21.05pre274251.f5f6dc053b1"; outputs = [ "out" ]; system = "x86_64-darwin"; type = "derivation"; } ]%
And I did manage to find it, but it says that it succeeded:
https://hydra.nixos.org/build/138335539
And now I really have no idea what else to check to understand what’s wrong.
It occurs to me in writing this question that nix-env -u
is trying to upgrade my python3
to something I probably don’t want. nixpkgs.python3
does not point to this alpha version, and I do still have a substitute for the version at nixpkgs.python3
. But that’s not the version to which nix-env -u
wants me to upgrade. This is making me think I should always just reinstall nixpkgs.whatever
instead of upgrading. Should I just not ever use nix-env -u
? What can I do to improve my experience here?
Note however that the newer version of cabal-install is the version at nixpkgs.cabal-install
, so that one is a top-level package that just doesn’t have a substitute for some reason. I am confused.