Closed bdesham closed 6 months ago
Same here on
$ nix-shell -p nix-info --run "nix-info -m"
- system: `"aarch64-darwin"`
- host os: `Darwin 23.2.0, macOS 14.2`
- multi-user?: `yes`
- sandbox: `no`
- version: `nix-env (Nix) 2.11.1`
- channels(thebitstick): `"nixpkgs"`
- channels(root): `""`
- nixpkgs: `/Users/thebitstick/.nix-defexpr/channels/nixpkgs`
I was experiencing this on an existing macOS installation. Re-installing Nix (via the official install script) solved the problem.
In my case, the same symptom repeats even if I uninstall and reinstall nix.
$ nix-env --upgrade --dry-run --show-trace
(dry run; not doing anything)
error:
… while trying to find an upgrade for 'zoxide-unstable-2023-11-20'
… from call site
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/pkgs/stdenv/generic/make-derivation.nix:530:10:
529|
530| meta = checkMeta.commonMeta { inherit validity attrs pos references; };
| ^
531| validity = checkMeta.assertValidity { inherit meta attrs; };
… while calling 'commonMeta'
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/pkgs/stdenv/generic/check-meta.nix:452:16:
451| # validity = checkMeta.assertValidity { inherit meta attrs; };
452| commonMeta = { validity, attrs, pos ? null, references ? [ ] }:
| ^
453| let
… from call site
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/pkgs/top-level/all-packages.nix:7349:21:
7348| cudaPackages_11_8 = callPackage ./cuda-packages.nix { cudaVersion = "11.8"; };
7349| cudaPackages_11 = recurseIntoAttrs cudaPackages_11_8;
| ^
7350|
… while calling 'recurseIntoAttrs'
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/lib/attrsets.nix:1169:5:
1168| # An attribute set to scan for derivations.
1169| attrs:
| ^
1170| attrs // { recurseForDerivations = true; };
… from call site
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/pkgs/top-level/all-packages.nix:7348:23:
7347| cudaPackages_11_7 = callPackage ./cuda-packages.nix { cudaVersion = "11.7"; };
7348| cudaPackages_11_8 = callPackage ./cuda-packages.nix { cudaVersion = "11.8"; };
| ^
7349| cudaPackages_11 = recurseIntoAttrs cudaPackages_11_8;
… while calling 'callPackageWith'
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/lib/customisation.nix:153:35:
152| */
153| callPackageWith = autoArgs: fn: args:
| ^
154| let
… from call site
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/lib/trivial.nix:440:7:
439| { # TODO: Should we add call-time "type" checking like built in?
440| __functor = self: f;
| ^
441| __functionArgs = args;
… while calling anonymous lambda
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/lib/customisation.nix:96:17:
95| in
96| mirrorArgs (origArgs:
| ^
97| let
… from call site
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/lib/customisation.nix:98:16:
97| let
98| result = f origArgs;
| ^
99|
… while calling anonymous lambda
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/pkgs/top-level/cuda-packages.nix:23:1:
22| # I've (@connorbaker) attempted to do that, though I'm unsure of how this will interact with overrides.
23| {
| ^
24| callPackage,
… from call site
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/pkgs/top-level/cuda-packages.nix:118:18:
117|
118| cudaPackages = customisation.makeScope newScope (
| ^
119| fixedPoints.extends composedExtension passthruFunction
… while calling 'makeScope'
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/lib/customisation.nix:317:25:
316| */
317| makeScope = newScope: f:
| ^
318| let self = f self // {
… from call site
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/lib/customisation.nix:318:16:
317| makeScope = newScope: f:
318| let self = f self // {
| ^
319| newScope = scope: newScope (self // scope);
… while calling 'extends'
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/lib/fixed-points.nix:141:24:
140| */
141| extends = f: rattrs: self: let super = rattrs self; in super // f self super;
| ^
142|
… from call site
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/lib/fixed-points.nix:141:67:
140| */
141| extends = f: rattrs: self: let super = rattrs self; in super // f self super;
| ^
142|
… while calling 'composeExtensions'
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/lib/fixed-points.nix:149:18:
148| composeExtensions =
149| f: g: final: prev:
| ^
150| let fApplied = f final prev;
… from call site
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/lib/fixed-points.nix:152:22:
151| prev' = prev // fApplied;
152| in fApplied // g final prev';
| ^
153|
… while calling 'composeExtensions'
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/lib/fixed-points.nix:149:18:
148| composeExtensions =
149| f: g: final: prev:
| ^
150| let fApplied = f final prev;
… from call site
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/lib/fixed-points.nix:152:22:
151| prev' = prev // fApplied;
152| in fApplied // g final prev';
| ^
153|
… while calling 'composeExtensions'
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/lib/fixed-points.nix:149:18:
148| composeExtensions =
149| f: g: final: prev:
| ^
150| let fApplied = f final prev;
… from call site
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/lib/fixed-points.nix:152:22:
151| prev' = prev // fApplied;
152| in fApplied // g final prev';
| ^
153|
… while calling 'composeExtensions'
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/lib/fixed-points.nix:149:18:
148| composeExtensions =
149| f: g: final: prev:
| ^
150| let fApplied = f final prev;
… from call site
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/lib/fixed-points.nix:150:22:
149| f: g: final: prev:
150| let fApplied = f final prev;
| ^
151| prev' = prev // fApplied;
… while calling 'extension'
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/pkgs/development/cuda-modules/generic-builders/multiplex.nix:104:12:
103| extension =
104| final: _:
| ^
105| let
… from call site
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/pkgs/development/cuda-modules/generic-builders/multiplex.nix:86:36:
85| # newestToOldestSupportedPackage :: List (AttrSet Packages)
86| newestToOldestSupportedPackage = lists.reverseList supportedPackages;
| ^
87|
… while calling 'reverseList'
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/lib/lists.nix:510:17:
509| */
510| reverseList = xs:
| ^
511| let l = length xs; in genList (n: elemAt xs (l - n - 1)) l;
… from call site
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/pkgs/development/cuda-modules/generic-builders/multiplex.nix:79:16:
78| # Get all of the packages for our given platform.
79| redistArch = flags.getRedistArch hostPlatform.system;
| ^
80|
… while calling 'getRedistArch'
at /nix/store/55swk71whn1hppd70x14ld9k6f0413dw-nixpkgs/nixpkgs/pkgs/development/cuda-modules/flags.nix:136:5:
135| getRedistArch =
136| nixSystem:
| ^
137| if nixSystem == "aarch64-linux" then
error: Unsupported Nix system: aarch64-darwin
$ nix-shell -p nix-info --run "nix-info -m"
- system: `"aarch64-darwin"`
- host os: `Darwin 23.2.0, macOS 14.2.1`
- multi-user?: `yes`
- sandbox: `no`
- version: `nix-env (Nix) 2.19.2`
- channels(root): `"nixpkgs"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
In my case, I uninstalled all packages, then upgraded/replaced Nix, then started reinstalling packages.
I'm having the same issue. I think it occurs during updates but not when installing new packages. I can install packages without any issues but I cannot update them with nix-env -u
.
@philipmw maybe thats why you didn't experience the problem after reinstalling nix, because you were reinstalling the packages as well instead of updating them.
It's consistent with what's happening on my side. I've made kind-of workaround (? sorry it's really hacky; I still consider myself nix noob).
sys info:
root# nix-shell -p nix-info --run "nix-info -m"
- system: `"aarch64-darwin"`
- host os: `Darwin 23.2.0, macOS 14.2.1`
- multi-user?: `yes`
- sandbox: `no`
- version: `nix-env (Nix) 2.19.2`
- channels(root): `"nixpkgs"`
- nixpkgs: `/var/root/.nix-defexpr/channels/nixpkgs`
root# nix-shell -q
everything seems to work if using nix-env --upgrade --attr nixpkgs.<versionless package name> --attr ...
so I've hacked some shell magic which prepares the input for nix-env --upgrade
, stripping off the version info (yes it's stupid but I dunno of the better way:) ).
Also it's hardcoded to patch things like:
nix-shell -p ripgrep --run sh < <(cat <<'EOF'
nix-env -q | rg -o '^([a-zA-Z-]+)[.-](?:[\d.-]+)*' --replace '--attr nixpkgs.$1' | sed -e 's/-i/I/g;s/-min/Min/g;s/nss-//g;s/-unstable//g'
EOF
)
and now - the actual upgrade command:
nix-shell -p ripgrep gnused --run sh < <(cat <<'EOF'
nix-env -q | rg -o '^([a-zA-Z-]+)[.-](?:[\d.-]+)*' --replace '--attr nixpkgs.$1' | sed -e 's/-i/I/g;s/-min/Min/g;s/nss-//g;s/-unstable//g' | xargs nix-env --upgrade
EOF
)
it works fine (note gnused
, it's needed because macOS sed
doesn't support chaining, apparently)
But: i found something strange, e.g. for zstd
package:
nix-env --upgrade --attr nixpkgs.zstd
works as expected, but
nix-env --upgrade zstd
does something different:
upgrading 'zstd-1.5.5' to 'zstd-20230618-git'
this derivation will be built:
/nix/store/dhzys44yfkcb19m3h96jgn4x7i791vmd-zstd-20230618-git.drv
...
BUILD FAILED: Unable to load foreign library (LIBZSTD).
Error opening shared object "libzstd.dylib":
dlopen(libzstd.dylib, 0x000A): tried: 'libzstd.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibzstd.dylib' (no such file), '/usr/lib/libzstd.dylib' (no such file, not in dyld cache), 'libzstd.dylib' (no such file).
error: builder for '/nix/store/dhzys44yfkcb19m3h96jgn4x7i791vmd-zstd-20230618-git.drv' failed with exit code 1
which results in build failure (but that's another story).
I guess this invocation is close to what nix-env --upgrade
or nix-env --upgrade '.*'
does?
Again, I might be misunderstanding things because of noobness, on the other hand it's not really obvious contract.
Same here, but it breaks on the nss-cacert
package, after successfully running sudo -i nix-channel --update
:
❯ sudo -i nix-channel --list
nixpkgs https://nixos.org/channels/nixpkgs-unstable
❯ sudo -i nix-env -u
error:
… while trying to find an upgrade for 'nss-cacert-3.92'
… in the right operand of the update (//) operator
at /nix/store/j8sh7dkdp9lrlw6qhyj415zzy8vg2ds2-nixpkgs/nixpkgs/pkgs/stdenv/generic/check-meta.nix:479:5:
478| }
479| // attrs.meta or { }
| ^
480| # Fill `meta.position` to identify the source location of the package.
… in the left operand of the update (//) operator
at /nix/store/j8sh7dkdp9lrlw6qhyj415zzy8vg2ds2-nixpkgs/nixpkgs/pkgs/stdenv/generic/check-meta.nix:481:5:
480| # Fill `meta.position` to identify the source location of the package.
481| // optionalAttrs (pos != null) {
| ^
482| position = pos.file + ":" + toString pos.line;
(stack trace truncated; use '--show-trace' to show the full trace)
error: Unsupported Nix system: aarch64-darwin
As recommended above, explicitly asking for the individual packages to upgrade did work:
❯ sudo -i nix-env --upgrade nss-cacert
upgrading 'nss-cacert-3.92' to 'nss-cacert-3.95'
these 2 paths will be fetched (0.32 MiB download, 0.93 MiB unpacked):
/nix/store/f7nd6i5yzspkrhmqilmzf886mxw7h4gr-nss-cacert-3.95-p11kit
/nix/store/4f7kdya0mnkabmpa03lb007bwcw2c8p6-nss-cacert-3.95-unbundled
copying path '/nix/store/f7nd6i5yzspkrhmqilmzf886mxw7h4gr-nss-cacert-3.95-p11kit' from 'https://cache.nixos.org'...
copying path '/nix/store/4f7kdya0mnkabmpa03lb007bwcw2c8p6-nss-cacert-3.95-unbundled' from 'https://cache.nixos.org'...
building '/nix/store/4akp26vp3gnkysfwvgfdifx2m72pkms8-user-environment.drv'...
❯ sudo -i nix-env --upgrade nix
...
copying path '/nix/store/h3h900clwa2sri36pi4fwhzy2pq8p3iw-nix-2.19.2' from 'https://cache.nixos.org'...
copying path '/nix/store/hymkh0h91khxr6x8h2zgk28vhd63jr2q-nix-2.19.2-dev' from 'https://cache.nixos.org'...
building '/nix/store/h8lhvml2ns2yvwcgxrdc4gzfg6yfj05h-user-environment.drv'...
but upgrade on its own still fails with the same errors, even after these manual upgrades:
❯ sudo -i nix-env -u
error:
… while trying to find an upgrade for 'nss-cacert-3.95'
...
nix-shell -p nix-info --run "nix-info -m"
:
- system: `"aarch64-darwin"`
- host os: `Darwin 23.2.0, macOS 14.2.1`
- multi-user?: `yes`
- sandbox: `no`
- version: `nix-env (Nix) 2.19.2`
- channels(root): `"nixpkgs"`
- nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixpkgs`
@onetom yes, I guess it's a matter of bisecting some commit ~2 weeks ago or so? And fix it. Only if it's not a feature :)
As far as I can tell, the problem was not present in nixpkgs commit 8a5b9ee7b7a2b38267c9481f5c629c015108ab0d, and it was present by commit 41ac0bd371618db6dd67fd952cc5b3d6a9955a15. I would bisect, but it’s not clear to me how to point nix-env
toward a specific commit. (According to this page, nix-env
ignores NIX_PATH
.)
Over on #276413, @holymonson notes that the problems seems to have been introduced in 8e800cedaf24f5ad9717463b809b0beef7677000.
FWIW I just reinstalled nix
and the upgrade worked just fine.
Should have been resolved by mid-January. Issue was caused by Darwin evaluating cudaPackages more deeply than I had expected and throwing as a result (stack trace in https://github.com/NixOS/nixpkgs/issues/274817#issuecomment-1868228718).
Describe the bug
When I run
I get the following output:
Metadata:
I tried to roll back to an environment with an earlier version of Nix, but I got essentially the same result:
The metadata for that environment was: