-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Overriding nixpkgs' rust/cargo to rust-overlay's toolchain causes evaluation failures #153
Comments
Could you provide the repro code? I tried to override a random package to use the toolchain from rust-overlay, and it compiles without any issue. Seems there's a with import <nixpkgs> { overlays = [ (import /path/to/rust-overlay) ]; };
pkgs.cargo-asm.override {
rustPlatform = makeRustPlatform {
cargo = rust-bin.stable.latest.minimal;
rustc = rust-bin.stable.latest.minimal;
};
} |
I have made https://github.com/Fuuzetsu/rust-overlay-auditable-repro as a repro. You can comment/uncomment the I have experimented a little and found that it Just Works™ if I remove this bit: cargo = rustChannel;
rustPlatform = pkgs.makeRustPlatform {
rustc = rustChannel;
cargo = rustChannel;
}; In our original code we have a larger block like so: rustToolchain = pkgs:
let
rustChannel = (pkgs.rust-bin.fromRustupToolchainFile ../rust-toolchain).override {
extensions = [
"clippy"
"rust-analysis"
"rust-docs"
"rust-src"
"rustfmt"
];
};
in
{
rustc = rustChannel;
cargo = rustChannel;
rust-fmt = rustChannel;
rust-std = rustChannel;
clippy = rustChannel;
rustPlatform = pkgs.makeRustPlatform {
rustc = rustChannel;
cargo = rustChannel;
};
}; I don't completely remember why it was done this way, maybe it's no longer necessary and we should just be keeping the |
Overriding nixpkgs' root
|
That's a bit sad because one needs to very carefully override everything rust-based explicitly or end up with 2 versions of rust in the dependency tree... "Use specific rust version for nixpkgs" doesn't seem like it should be that wild of a use-case, right? Maybe we're in the minority... |
After we updated nixpkgs recently, we start seeing this error again. We followed the suggestion to stop overriding the toolchain for all of nixpkgs and it's all OK for now. So for us at least it's less priority than it was... I still think it should probably be possible to do this but if it's not supported, maybe just adding some info about why in README is good enough. |
The queuing script was written by ChatGPT and has at least one bug (it spinloops when it runs out of stuff to do). But it works well enough for daily work so I'll commit it for now. This also updates crate2nix/tools.nix, which has many improvements including upstreaming one of my patches and making another (lockfile overrides) much simpler to implement. Also updates nixpkgs. It turns out that cargo 1.77 somehow breaks crate2nix in the case of git dependencies; there is a maybe-related bug nix-community/crate2nix#207 ... ok, so we need to pin rustc in crate2nix. Turns out we can only do this by editing tools.nix; you can't overlay rustc and cargo anymore; see this oxalica/rust-overlay#153 which is basically WONTFIX. This commit leaves the giant comment in andrew-utils.nix intact, though it is now outdated (latest supported nixpkgs and crate2nix). As I am still bisecting to investigate more isssues..
At some point nixpkgs made a decision to include
cargo-auditable
wrapper of some sort which ends up passing attributeauditable
torust-overlay
, failure looks like this:I was able to work around the problem by passing
auditable = false;
to every instance ofbuildRustPackage
, but having to specify it all over the place is mildly annoying. I suspect it should be possible to specify it globally for all the things I'm compiling but my nix fu is limited.I don't really care about auditable functionality, but it would be great to be able to use rust-overlay without having to deal with it.
The text was updated successfully, but these errors were encountered: