I’m trying to start working on a rust project, using flakes. Immediately after adding openssl as a dependency, I started getting errors:
rm: /nix/store/qjgj2642srlbr59wwdihnn66sw97ming-glibc-2.33-123/lib/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/ayfqsn6p97k8f953gxmwm3p3fyh3g99p-devshell-dir/lib/libcrypto.so.1.1)
rm: /nix/store/qjgj2642srlbr59wwdihnn66sw97ming-glibc-2.33-123/lib/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/ayfqsn6p97k8f953gxmwm3p3fyh3g99p-devshell-dir/lib/libcrypto.so.1.1)
cat: /nix/store/qjgj2642srlbr59wwdihnn66sw97ming-glibc-2.33-123/lib/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/ayfqsn6p97k8f953gxmwm3p3fyh3g99p-devshell-dir/lib/libcrypto.so.1.1)
rm: /nix/store/qjgj2642srlbr59wwdihnn66sw97ming-glibc-2.33-123/lib/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/ayfqsn6p97k8f953gxmwm3p3fyh3g99p-devshell-dir/lib/libcrypto.so.1.1)
nix: /nix/store/qjgj2642srlbr59wwdihnn66sw97ming-glibc-2.33-123/lib/libc.so.6: version `GLIBC_2.34' not found (required by /nix/store/ayfqsn6p97k8f953gxmwm3p3fyh3g99p-devshell-dir/lib/libcrypto.so.1.1)
My problem is I’m a beginner with nix and flakes, and glibc also isn’t something I know a lot about.
Things I tried/noticed:
- the
...-devshell-dir/lib/libcrypto.so.1.1
is linked from...-openssl-1.1.1o/lib/libcrypto.so.1.1
, does that mean a dependency to openssl was automatically added? - If openssl was automatically added, shouldn’t it depend on the correct glibc? I noticed the version it say is present (2.33) is the same as nixpkgs-21.11 has (my nixos system follow nixpkgs-21.11), and the version it wants is 2.34, same as nixpkgs-unstable has (nixpkgs-unstable is in the project’s flake.nix). That sounds to me like it’s trying to use the system one instead of the one in the flake. Shouldn’t nix flakes prevent such dependencies on the system environment? I don’t know a lot about nix, and almost nothing about glibc, so I’m not sure if this is significant or how to fix it or if this is completely off-track.
Replication:
A minimal verifiable example: Commits · j2ghz/repr-flake-glibc-nci-issues · GitHub
You can see the two commits, a working one before openssl is added, and a broken one afterwards.
The commands to run after you make a change and want to check if it works/breaks: git add -A; nix develop -c cargo generate-lockfile; nix develop -c menu; nix develop -c check
It’s a long command, but when I didn’t run all of these, but only e.g. nix develop
, it’d sometimes keep being broken after I’ve made a change that should have fixed it and vice versa.
I tried this on my nixos laptop, and nixos server.