Hello!
I am trying to create a shell.nix for the sequoia project (Rust pgp implementation).
I need glibc 2.32 or greater. I thought I could simply pin a commit of nixpkgs-unstable that has 2.32 or greater but that does not seem to work.
I found 66e44425c6dfecbea68a5d6dc221ccd56561d4f1 from a PR to nixpkgs on GitHub.
I have the following:
# adapted from examples at https://nixos.wiki/wiki/Rust
let
# Pinned nixpkgs, deterministic
nixpkgs = import (fetchTarball ("https://github.com/NixOS/nixpkgs/archive/66e44425c6dfecbea68a5d6dc221ccd56561d4f1.tar.gz")) { };
# Rolling updates, not deterministic.
# pkgs = import (fetchTarball("channel:nixpkgs-unstable")) {};
in
nixpkgs.mkShell {
buildInputs = [
nixpkgs.rustup
nixpkgs.openssl
nixpkgs.pkgconfig
nixpkgs.capnproto
nixpkgs.gnumake
nixpkgs.sqlite
nixpkgs.nettle
nixpkgs.clang
nixpkgs.glibc
];
}
anyone see what I am doing wrong? I also tried specifying glibc-2_32 and variants but that did not work.
So I may have the correct shell.nix but something else is off.
I executed nix-shell --pure.
I then echoed $PATH and do see only glibc 2.32 and greater available.
The error persists after cargo clean, then cargo test.
The error I see is:
error: /nix/store/q53f5birhik4dxg3q3r2g5f324n7r5mc-glibc-2.31-74/lib/libc.so.6: version `GLIBC_2.32' not found (required by sequoia/target/debug/deps/libproc_macro_hack-4d3ccf889f1c0a1c.so)
error: /nix/store/q53f5birhik4dxg3q3r2g5f324n7r5mc-glibc-2.31-74/lib/libc.so.6: version `GLIBC_2.32' not found (required by futures-rs/target/debug/deps/libproc_macro_hack-c3f554c71dd3bf18.so)
--> futures-macro/src/lib.rs:16:5
I am running stable nixOS.
I believe the main problem is that my nixOS glibc takes precedence over what I declare in shell.nix for some reason.
Yes! Thank you for this insight. I have rustup declared in my configuration.nix. I have imperatively installed toolchains using rustup.
I’ve also run nix-collect-garbage -d a few times since.
This sounds perfect! Rustup is not a requirement.
I approached this from what the nixos wiki had. But oxalica/rust-overlay solves my problem even more cleanly.
I tested nix-shell -p rust-bin.stable.latest.rust in a simplified project and it solved the GLIBC_2.32' not found compilation error. I am most certainly switching to that overly for Rust development on nixOS.