-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
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
(rustc, cargo): (1.17.0, 0.18.0) -> (1.19.0, 0.20.0) #28459
Conversation
I've started trying to compile this change. |
Builds fine! |
Tested on x86_64 NixOS on my end, Rust and Cargo build just fine but if I try to build ripgrep or other rust packages with it using nix I get the following error:
|
nice! will test it tonight :) |
it builds successfully on |
Well, reproducible builds is one of the things we all love nix for :) |
might as well do rustc to 1.20 at this point, since that was announced a few days ago |
I've already tried it, but it doesn't even build out-of-box for me. Given I still haven't fixed the issue reported by @MP2E, I think it has the priority for now. |
For what it's worth, I was able to build using 1.18 and 1.19, but when I tried 1.19 and 1.20, I got an error in the Rust test suite (running on Mac OSX 10.12.6): "error: verification with 'FileCheck' failed" (related to rust-lang/rust#37945). |
Hi! I was upgrade rust to 1.20, cargo to 0.21.1 in airalab@39efddb |
I also get the same error as mentioned by @MP2E . I'm currently looking at rust-lang/cargo#2857 and rust-lang/cargo#2811 to see if I can improve the whole cargo fetch procedure. This should also get rid of the warning we currently see:
|
@loskutov @akru Are you able also to buildRustPackages with your rust 1.20 an cargo 0.21.1 without the error mentioned in @MP2E? I see you pointed rustRegistry directly to nix store and commented out a lot of lines. |
@akru I tried your branch, and buildRustPackage worked, but only with sandboxing disabled. |
@datakurre Yup, in my opinion the evil in changed behaviour of cargo from v0.19. In my view helper script based on the assumption that cargo don't update the registry with cached value already exist. But new cargo try to update registry at all. I look forward to resolving this issue with sandbox. |
A lot of current crates are not usable because the rust version is just too old. I am using the mozilla overlay in the meantime, however this only works for development. |
@mguentner part of my nixpkgs.overlays = [
(import /path/to/nixpkgs-mozilla)
(self: super: {
pijul = super.callPackage "${nix_store}/pijul.nix" {
rustPlatform = super.recurseIntoAttrs (super.makeRustPlatform {
rustc = self.latest.rustChannels.stable.rust;
inherit cargo;
});
};
rustfmt-nightly = super.callPackage "${nix_store}/rustfmt-nightly.nix" {
rustPlatform = super.recurseIntoAttrs (super.makeRustPlatform {
rustc = (self.rustChannelOf { date = "2017-09-20"; channel = "nightly"; }).rust;
inherit cargo;
});
};
})
]; |
Thank you. How do you handle the out-of-date cargo registry? |
Forgot to include this: # ...
rustRegistry = super.callPackage "${nix_store}/rust-packages.nix" { };
# ... I'd like to write an automatic updater for rustRegistry :) |
@dywedir I've been struggling with how all of the pieces of Rust Nightly + Nix work together -- can you share a full default.nix example for compiling a Rust Nightly app? And, does your solution only work if you are using NixOS? (I'm running NixPkgs on Macosx and using NixOps to deploy to AWS, so I'm hoping your solution works for both mac and nixos.) |
@greglearns this definitely works for nixpkgs. You need three points:
(both in
I.e. { stdenv, fetchFromGitHub, rustPlatform }:
rustPlatform.buildRustPackage rec {
name = "rustfmt-nightly-${version}";
version = "0.2.7";
src = fetchFromGitHub {
owner = "rust-lang-nursery";
repo = "rustfmt";
rev = "nightly-${version}";
sha256 = "0xqjdq8g40nkqfrkzl9sj5fq5kqf09gp65zxy8dli4b1ic81lfs3";
};
depsSha256 = "0yniynv74v6amvjgiba9lczmshp9sl6qdm9qbblfw782hrkif10x";
meta = with stdenv.lib; {
description = "A tool for formatting Rust code according to style guidelines";
homepage = https://github.com/rust-lang-nursery/rustfmt;
license = with licenses; [ mit /* or */ asl20 ];
maintainers = with maintainers; [ dywedir ];
platforms = platforms.all;
};
} |
There is a PR for rust 1.20.0 (#30088) so this can probably be closed? |
@dywedir your rustPlatform override snippet is really useful. Would it be ok to add this to the nixpkgs manual (specifically the part on using the mozilla overlays)? |
Motivation for this change
Update Rust and Cargo to up-to-date versions
Things done
(nix.useSandbox on NixOS,
or option
build-use-sandbox
innix.conf
on non-NixOS)
nix-shell -p nox --run "nox-review wip"
./result/bin/
)