-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issues with repo's flake.nix #102
Comments
Glibc version mismatches are a bit of a drag. However, my guess is that this is not necessarily a problem of flakes. The problem is likely a hole in the development environment. I tried to reproduce this on my system (which also uses glibc 2.38), but it all worked alright. # Here's the ldd output of `target/debug/rix`:
% ldd target/debug/rix
linux-vdso.so.1 (0x00007ffc84596000)
libgcc_s.so.1 => /nix/store/v286z87irid5vn13y2z6fphfrzmgj0kf-gcc-12.3.0-lib/lib/libgcc_s.so.1 (0x00007f4946853000)
libm.so.6 => /nix/store/3n58xw4373jp0ljirf06d8077j15pc4j-glibc-2.37-8/lib/libm.so.6 (0x00007f4946773000)
libc.so.6 => /nix/store/3n58xw4373jp0ljirf06d8077j15pc4j-glibc-2.37-8/lib/libc.so.6 (0x00007f4944c1a000)
/nix/store/3n58xw4373jp0ljirf06d8077j15pc4j-glibc-2.37-8/lib/ld-linux-x86-64.so.2 => /nix/store/3n58xw4373jp0ljirf06d8077j15pc4j-glibc-2.37-8/lib64/ld-linux-x86-64.so.2 (0x00007f4946876000)
# Here's the ldd of my system's shell:
% ldd $SHELL
linux-vdso.so.1 (0x00007ffdf4587000)
libpcre.so.1 => /nix/store/xgzy8655cm1xq92wy74w8hqs3gqga3hy-pcre-8.45/lib/libpcre.so.1 (0x00007f0720f77000)
libdl.so.2 => /nix/store/xmprbk52mlcdsljz66m8yf7cf0xf36n1-glibc-2.38-44/lib/libdl.so.2 (0x00007f0720f72000)
libncursesw.so.6 => /nix/store/2q5w8vspj27v1ah0ggljhb2i8dkdwjg5-ncurses-6.4/lib/libncursesw.so.6 (0x00007f0720efe000)
librt.so.1 => /nix/store/xmprbk52mlcdsljz66m8yf7cf0xf36n1-glibc-2.38-44/lib/librt.so.1 (0x00007f0720ef9000)
libm.so.6 => /nix/store/xmprbk52mlcdsljz66m8yf7cf0xf36n1-glibc-2.38-44/lib/libm.so.6 (0x00007f0720e19000)
libc.so.6 => /nix/store/xmprbk52mlcdsljz66m8yf7cf0xf36n1-glibc-2.38-44/lib/libc.so.6 (0x00007f0720c2e000)
/nix/store/xmprbk52mlcdsljz66m8yf7cf0xf36n1-glibc-2.38-44/lib/ld-linux-x86-64.so.2 => /nix/store/xmprbk52mlcdsljz66m8yf7cf0xf36n1-glibc-2.38-44/lib64/ld-linux-x86-64.so.2 (0x00007f0720ff3000) Note that the glibc versions are different, but I was able to run the This is obviously not the way to reproduce your problem. So, let's try to repro it. In order to do so, I would have to know the exact steps you took to build
|
I did both direnv, and nix develop. Both lead to the same result.
I had a preinstalled rustup, but I rebuilt my system without a preinstalled rustup to make sure. Both led to the same result.
Nope One possibility is that this could be due to some other compilation toolchain stuff I have installed, such as the linker, etc. The main weird part is that it compiles in the path of glibc 2.37, but expects to find 2.38 in that path. I'm not really sure what could be the cause. |
Oh my, yeah, there must be some sort of a hole in the direnv development environment setup. We rely on I'll try to reproduce this problem by deleting all my rust toolchains, initializing a Rust toolchain outside of |
I attempted manually reinstalling the toolchains iirc, and it still broke. The main thing I wonder about is where does it decide to pull the glibc |
Hey, just FYI, I've been trying to get this running locally (with the goal of potentially contributing), and it seems like rustc has weird behaviour when building a flake.nix is used for the dev environment.
Here's the error that I was running into:
Having many other rust projects around, I tried narrowing down what the cause might be. All my other rust projects use a shell.nix, and they were running fine.
Using
readelf -d ./target/debug/rix
showed that it had a RUNPATH pointing to 2.37, which was identical to the RUNPATH of the rustc that the dev flake required. However, my system rustc's RUNPATH was 2.38.I tried removing my system's rustup, but that didn't fix it. Compiling inside
nix develop -i
didn't fix it either. I still haven't found a fix for this, assuming the same flake.lock file.The only fix was to update the lockfile.
Ideally, it would be good to use a shell.nix as it just inherits the environment's channel which generally avoids issues like this. I understand that a shell.nix isn't as pure as a flake.nix, but purity is hard to implement and implementation issues lead to problems like above.
Also, using flakes for development isn't ideal in general due to issues like this: NixOS/nix#3121
A flake copies the entire non-gitignored environment across, which includes basically the entire repo, even if you don't need it to. A shell.nix on the other hand just runs in-place.
For now I'll just have an updated flake.lock uncommitted in my local repo, but yeah just FYI about this.
The text was updated successfully, but these errors were encountered: