My nix package is broken

My NixOS is on unstable channel and auto update is on. A few days ago, I noticed nix-shell is broken. Also is nix-build, but not everything of nix package.

NixOS conf:

  system = {
    stateVersion = "unstable";
    autoUpgrade.enable = true;
  };

Error:

$ nix-shell
nix-shell: /nix/store/ybjcla5bhj8g1y84998pn4a2drfxybkv-gcc-13.3.0-lib/lib/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by nix-shell)
nix-shell: /nix/store/ybjcla5bhj8g1y84998pn4a2drfxybkv-gcc-13.3.0-lib/lib/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by /nix/store/w6wybyfakrgnp1rb0mrj66xlj8118z8c-nix-2.24.11/lib/libnixexpr.so)
nix-shell: /nix/store/ybjcla5bhj8g1y84998pn4a2drfxybkv-gcc-13.3.0-lib/lib/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by /nix/store/w6wybyfakrgnp1rb0mrj66xlj8118z8c-nix-2.24.11/lib/libnixmain.so)
nix-shell: /nix/store/ybjcla5bhj8g1y84998pn4a2drfxybkv-gcc-13.3.0-lib/lib/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by /nix/store/w6wybyfakrgnp1rb0mrj66xlj8118z8c-nix-2.24.11/lib/libnixfetchers.so)
nix-shell: /nix/store/ybjcla5bhj8g1y84998pn4a2drfxybkv-gcc-13.3.0-lib/lib/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by /nix/store/w6wybyfakrgnp1rb0mrj66xlj8118z8c-nix-2.24.11/lib/libnixstore.so)
nix-shell: /nix/store/ybjcla5bhj8g1y84998pn4a2drfxybkv-gcc-13.3.0-lib/lib/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by /nix/store/w6wybyfakrgnp1rb0mrj66xlj8118z8c-nix-2.24.11/lib/libnixutil.so)
nix-shell: /nix/store/ybjcla5bhj8g1y84998pn4a2drfxybkv-gcc-13.3.0-lib/lib/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by /nix/store/w6wybyfakrgnp1rb0mrj66xlj8118z8c-nix-2.24.11/lib/libnixcmd.so)
nix-shell: /nix/store/ybjcla5bhj8g1y84998pn4a2drfxybkv-gcc-13.3.0-lib/lib/libstdc++.so.6: version `CXXABI_1.3.15' not found (required by /nix/store/2b13vwslx0bmnb41mn5xvn5zcj4fw0ww-aws-crt-cpp-0.29.4/lib/libaws-crt-cpp.so)

I tried to upgrade nixos and nixpkgs, nothing seems help. How to fix it?

Is the command nixos-rebuild broken as well?

It does not. I can run the command to update the system. But did not fix this.

Have you tried rebuilding the system with state version 24.11 at least once?

Yes, I did. I manually changed the channel, and state in conf. No errors other than some services failed to restart. And nix-shell is still broken.

I saw that in nixpkgs source, there is a newer version of nix pkg as 2.25. But I have network issue and could not clone the repo to try.

You are using the command nix-shell without any arguements?
I get the following response when doing nix-shell:

error: no argument specified and no 'shell.nix' or 'default.nix' file found in the working directory

If you are inside a directory with a shell.nix or a default.nix the required derivation can maybe not be found because of said network issues

I do not think that is the cause. I got the issue while loading a pkg and tested in empty folder.

A specific package or any package?

Any packages. And since nix-build breaks as well, I cannot use home-manager for some tasks as well.

Do not change stateVersion! That’s irrelevant.

@Magicloud have you rebooted since this happened?

1 Like

Yes, I think two or three times while I made a few changes to try. No luck.

@waffle8946 can we rule out that there is a problem with the nix store?

Have you restarted your computer since the update?

That was already answered. This sort of thing shouldn’t have any dependency on boot state anyways.

@Magicloud do you have any magic env vars set? Please check specifically LD_PRELOAD and LD_LIBRARY_PATH.

2 Likes

(This is not your problem, but this is super wrong. Please read the thing. "unstable" is not a valid value for this option; it should be set to the version of nixos that was originally installed, not the name of the channel you’re trying to use.)

Anyway, the actual issue looks like it might be related to the recent update to GCC 14. No idea how that would cause this, but it just seems related given the error message.

3 Likes

Thanks. Forgot LD_LIBRARY_PATH is set in home manager to pkgs.stdenv.cc.cc.lib.

Yikes, it should not do that.