-
Notifications
You must be signed in to change notification settings - Fork 89
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
Build fails when using rust-overlay
due to some dependencies being built with Nixpkgs Rust when cross-compiling
#359
Comments
rust-overlay
due to some dependencies being built with Nixpkgs Rustrust-overlay
due to some dependencies being built with Nixpkgs Rust when cross-compiling
I cannot reproduce this when commenting out |
I was able to reproduce this when setting |
I decided to see what would happen if I ran a build with Rust 1.80.1 and then 1.80.0. It seems that crate2nix only ever rebuilds the main crate and leaves all dependencies unchanged, so it looks like setting the overlay with Removing |
Rather than overriding
what if you tried just
This is what I have in my setup which seems to work. I am also using |
Same result with |
What if you remove the |
|
If I build with
|
Ah, you are using flakes. I don't know much about flakes. But I have my nixpkgs pinned to 4f3a074422623781034daf8b1a966ee556587539 right now. Maybe you could try that one and see if it "used to work"? |
|
Based on #348 (comment) the issue might be caused by |
I'm mystified. You can see my code here: https://github.com/apoelstra/local-nix-ci/blob/main/andrew-utils.nix#L520-L532 and the README on the rust-overlay repo says that you should be able to override |
The |
I don't know why, but this worked: rustToolchain = pkgs.rust-bin.stable."1.80.1".default;
buildRustCrateForPkgs =
crate:
pkgs.buildRustCrate.override {
rustc = rustToolchain;
cargo = rustToolchain;
}; Worked insofar as the build now fails because the linker can't find OpenSSL. I'll have to see what I did in Crane to fix that but I fear that I'll just get hit by #266. |
I'm going to leave this open since I'll raise a PR to have the process for correctly applying Also, didn't get hit by #266, telling |
Probably worth mentioning that it did previously exist per https://github.com/NixOS/nixpkgs/blob/4f3a074422623781034daf8b1a966ee556587539/pkgs/build-support/rust/build-rust-crate/default.nix#L7-L17 |
I have a simple derivation using
crate2nix
:When I try to build this, I get this error:
If I downgrade the Rust overlay to 1.80.0, I get the same error but with 'this' compiler correctly appearing as 1.80.0.
It seems like
crate2nix
is still building some of the dependencies with the Nixpkgs version of Rust.In my Flake,
pkgs
is defined as follows:The text was updated successfully, but these errors were encountered: