Skip to content

Issues with repo's flake.nix #102

@arduano

Description

@arduano

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:

target/debug/rix: /nix/store/3n58xw4373jp0ljirf06d8077j15pc4j-glibc-2.37-8/lib/libm.so.6: version `GLIBC_2.38' not found (required by target/debug/rix)

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions