Skip to content

rust: 1.15.0 -> 1.17.0 #26275

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

Merged
merged 3 commits into from
Jun 11, 2017
Merged

rust: 1.15.0 -> 1.17.0 #26275

merged 3 commits into from
Jun 11, 2017

Conversation

anderspapitto
Copy link
Contributor

Also updates beta, nightly, nightlyBin, and bootstrap compilers.
Also consolidates logic between bootstrap and nightlyBin compilers.

I have successfully compiled the various rustcs (on NixOS only), but haven't done any further testing of the resulting binaries. Please review and/or try it out!

@anderspapitto anderspapitto mentioned this pull request May 31, 2017
srcSha = "1dp7cjxj8nv960jxkq3p18agh9bpfb69ac14x284jmhwyksim3y7";

shortVersion = "1.17.0";
src = fetchurl {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think fetchurl is not in scope here


shortVersion = "1.17.0";
src = fetchurl {
url = "https://static.rust-lang.org/dist/rustc-${shortVersion}-src.tar.gz";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

likewise, shortVersion is not in scope here, I think the enclosing set should be rec

@FlorentBecker
Copy link
Contributor

I've fixed the two errors above, now cargo fails to build with: error: failed to open: /tmp/nix-build-cargo-0.18.0.drv-0/deps/registry/index/-ba82b75dd6681d6f/.cargo-index-lock

@anderspapitto
Copy link
Contributor Author

Hmm. I don't remember if I tested building cargo - I'll check that out

@anderspapitto
Copy link
Contributor Author

cargo doesn't build for me either, but I get a different error that indicates that the registry needs to be updated. I'm going to try that.

@anderspapitto anderspapitto force-pushed the rust-updates branch 2 times, most recently from 91ddc78 to 0859bc3 Compare May 31, 2017 16:57
# substituteInPlace src/rust-installer/gen-install-script.sh \
# --replace /bin/echo "$(type -P echo)"
# substituteInPlace src/rust-installer/gen-installer.sh \
# --replace /bin/echo "$(type -P echo)"

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These commented out lines in the patch command--maybe they should be deleted if not necessary?

@anderspapitto
Copy link
Contributor Author

@FlorentBecker try again? cargo builds for me with the latest version of this patch, directly on top of nixos-unstable.

@FlorentBecker
Copy link
Contributor

cargo builds, so do rustfmt and pijul (from its source).

@LnL7 LnL7 added 6.topic: rust 8.has: package (update) This PR updates a package to a newer version labels May 31, 2017
@@ -141,7 +135,8 @@ stdenv.mkDerivation {
sed -i '28s/home_dir().is_some()/true/' ./src/test/run-pass/env-home-dir.rs
'';

doCheck = true;
# XXX: fix test failures
doCheck = false;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs to be addressed before merging.

Copy link
Member

@LnL7 LnL7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did some testing on darwin, needs a few changes but it looks promising. 😃

then "x86_64-unknown-linux-gnu"
else throw "missing bootstrap url for platform ${stdenv.system}";

bootstrapHash =
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not used

let
inherit (stdenv.lib) optionalString;

platform = if stdenv.system == "x86_64-linux"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this also needs to be defined for all platforms and is defined in multiple places

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll remove the duplication.

I claim that adding binary nightly builds for other platforms is outside the scope of this diff (they don't exist before this diff either).

@anderspapitto
Copy link
Contributor Author

I believe I've addressed all the code issues. Mainly what's needed now is re-enabling tests. I tried it and got at least one failure, which looks like it's probably some upstream test issue that should just be disabled

error: this feature has been stable since 1.17.0. Attribute no longer needed
  --> src/tools/compiletest/src/main.rs:15:12
   |
15 | #![feature(static_in_const)]
   |            ^^^^^^^^^^^^^^^
   |
   = note: #[deny(stable_features)] implied by #[deny(warnings)]
note: lint level defined here
  --> src/tools/compiletest/src/main.rs:19:9
   |
19 | #![deny(warnings)]
   |         ^^^^^^^^

error: aborting due to previous error

error: Could not compile `compiletest`.

However, I don't want to spend an hour+ rebuilding to find each failing test. Can anyone recommend a better workflow than rebuilding the full nix expression each time (I'm using nix-shell -p rustc)?

@FlorentBecker
Copy link
Contributor

short of separating the bootsrapping stages into different nix expressions, I don't know of a faster way to do that.

@anderspapitto
Copy link
Contributor Author

Is it possible to build with doCheck = false and then somehow run the tests afterwards? Or maybe it can be done with nix-build -K and doing further work in the /tmp/nix-build-... directory?

@anderspapitto anderspapitto force-pushed the rust-updates branch 2 times, most recently from 4d17e12 to 96a3563 Compare June 1, 2017 13:28
@anderspapitto
Copy link
Contributor Author

anderspapitto commented Jun 1, 2017

fixed that, now it seems only gdb-based tests are failing. Do we expect our gdb 7.12 to be able to handle rust binaries correctly?

Here's the relevant output from the tests https://gist.github.com/anderspapitto/3694385734d7b46d06895270cacf8411

@FlorentBecker
Copy link
Contributor

7.12 is the default version in nixpkgs? If so, my memory is that it does not pass the rust tests.

@Mic92
Copy link
Member

Mic92 commented Jun 1, 2017

@anderspapitto I think you can disable it test then. My concern was only that we should have an explicit list of things we disable in the test suite. We already disable gdb in the past, you can take these snippets.

@LnL7
Copy link
Member

LnL7 commented Jun 1, 2017

@anderspapitto You can do something like this to work on the tests, I usually create a git repo of the sources before I change something making it easier to keep track the changes.

$ nix-shell -A rustc
$ unpackPhase
$ cd $sourceRoot
$ patchPhase
$ configurePhase
$ buildPhase
$ checkPhase
# edit...
$ checkPhase
# edit...

@Mic92
Copy link
Member

Mic92 commented Jun 1, 2017

@LnL7 I archived this snippet for future nixers: https://github.com/nixos-users/wiki/wiki/nix-command-cookbook#debug-a-package-build

@anderspapitto
Copy link
Contributor Author

I've disabled the few failing gdb tests. all other tests are now enabled and passing. I currently consider this patch to be complete/ready to merge.

@LnL7 thanks, that is actually really helpful.

@anderspapitto
Copy link
Contributor Author

actually, I should test building beta and nightly first. they might require different sets of tests to be disabled

@wizeman
Copy link
Member

wizeman commented Jun 2, 2017

FYI, this breaks the build of firefox due to the upgrade to cargo 0.18. To fix the build, we will likely need this patch (taken from Arch Linux, which took it from Firefox trunk):

https://git.archlinux.org/svntogit/packages.git/plain/trunk/0001-Bug-1338655-Don-t-try-to-build-mp4parse-bindings.-r-.patch?h=packages/firefox

References:

@selaux
Copy link
Contributor

selaux commented Jun 2, 2017

FYI this also does not work on darwin currently as far as I can see.

I experienced several issues:

  • For this substituteInPlace the target file does not exist anymore.
  • Some tests are failing (maybe those were the ones that you commented out just recently, they were related to llvm debuginfo)
  • When setting doCheck to false and (successfully) compiling rust, our actual project fails with an llvm error: failed to build archive: bad archive: truncated or malformed archive

@selaux
Copy link
Contributor

selaux commented Jun 6, 2017

@anderspapitto Maybe the compilation issue is a non-issue as compilation also fails on current master. Can anybody confirm compilation of rust projects on macOS (and running their binaries) works for their cases?

@retrry
Copy link
Contributor

retrry commented Jun 8, 2017

Could you remove me as rustc maintainer in this PR, as it seems that I won't have time to allocate to this anytime soon? Thanks :)

@anderspapitto
Copy link
Contributor Author

@wizeman are you sure? I don't see cargo or rust as a dependency of the firefox expression, and applying this patch doesn't cause firefox to rebuild for me

@anderspapitto
Copy link
Contributor Author

got rid of the extra substituteInPlace, removed retrry as reviewer. I can't replicate the failure of firefox, or any of the rumored macOS problems

@anderspapitto
Copy link
Contributor Author

currently, I've tested that each of rust.rustc, rust.cargo, rustBeta.rustc, rustBeta.cargo, rustNightlyBin.rustc, rustNightlyBin.cargo build.

I've cheated in two ways
1 - rustBeta has tests disabled
2 - rustNightly is aliased to rustBeta

I don't think either of those is worth holding up the PR over.

@LnL7
Copy link
Member

LnL7 commented Jun 10, 2017

I'll fix the failing tests for darwin, I also tested some packages that use rust and those build/run fine.

Also updates beta, nightly, nightlyBin, and bootstrap compilers.
Also updates the registry.
Also consolidates logic between bootstrap and nightlyBin compilers.
Also contains some miscellaneous cleanups.
Also patches firefox to build with the newer cargo
@anderspapitto
Copy link
Contributor Author

reproduced the firefox build failure that @wizeman brought up, and added the patch to fix it

@LnL7 LnL7 merged commit a3317da into NixOS:master Jun 11, 2017
@grahamc
Copy link
Member

grahamc commented Jun 15, 2017

@anderspapitto out of curiosity, why did you upgrade the bootstrap compiler to 1.17.0, instead of the more customary 1.16.0?

@grahamc
Copy link
Member

grahamc commented Jun 15, 2017

Talking to people in #rust-internals, it sounds like using 1.17.0 to bootstrap 1.17.0 could cause these issues.

then
echo "No date supplied"
exit -1
fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't appear to work:

grahamc@Morbo> ./print-hashes.sh 2017-06-08 1.17.0
<?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>dist/2017-06-08/rust-1.17.0-i686-unknown-linux-gnu.tar.gz.sha256</Key><RequestId>C34D6395F7683D89</RequestId><HostId>lr90iQsHnNluvVulVA4Nbf0S96ZYksq0aGQeZ3FBKO+L2ATnW7SV7ujZnG2rOzENjTTzvy5LhHY=</HostId></Error><?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>dist/2017-06-08/rust-1.17.0-x86_64-unknown-linux-gnu.tar.gz.sha256</Key><RequestId>33D783FED92A3750</RequestId><HostId>cr7TZsC9Xe29GI9sCWJhSxc0FpXboooNOwZHln0ZsBKnO5djQEQG5bP7uNDvKaIE438Dxl9Cw44=</HostId></Error><?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>dist/2017-06-08/rust-1.17.0-i686-apple-darwin.tar.gz.sha256</Key><RequestId>236CB3DD279BECAE</RequestId><HostId>xyplFt5QbqswtiSOQxH8mUpLBLKuBC+3T92kKD7V+9KqjKKqYbB1Y+kHDycz+dNu6zeQ5hTTd2w=</HostId></Error><?xml version="1.0" encoding="UTF-8"?>
<Error><Code>NoSuchKey</Code><Message>The specified key does not exist.</Message><Key>dist/2017-06-08/rust-1.17.0-x86_64-apple-darwin.tar.gz.sha256</Key><RequestId>6591E6D2614E1664</RequestId><HostId>fimagRKeC4GecGI/YFO0MDvtaUibYKh3vlFY7eIvoKlTH5/LVxk949K1ryXBGixiMo7d0NSwpwk=</HostId></Error>%                                                                                                                  

when using https://static.rust-lang.org/dist/channel-rust-stable-date.txt

@anderspapitto
Copy link
Contributor Author

@grahamc I didn't realize at the time that the bootstrap compiler should be the previous version. We should probably change it to 1.16.0 then if it will fix this.

I'll look at the print-hashes.sh thing. It works for some things (like the beta channel), not sure why it fails there.

@anderspapitto
Copy link
Contributor Author

@grahamc ah - because on 2017-06-08, the stable compiler was already 1.18.0 :) so it may require some manual digging around in https://static.rust-lang.org/dist/index.html to find the correct date.

@anderspapitto
Copy link
Contributor Author

I think you'll want these

$ ./print-hashes.sh 2017-04-27 1.17.0
39d16ce0f618ba37ee1024b83e4822a2d38e6ba9f341ff2020d34df94c7a6beb  rust-1.17.0-i686-unknown-linux-gnu.tar.gz
bbb0e249a7a3e8143b569706c7d2e7e5f51932c753b7fd26c58ccd2015b02c6b  rust-1.17.0-x86_64-unknown-linux-gnu.tar.gz
308132b33d4002f95a725c2d31b975ff37905e3644894ed86e614b03ded70265  rust-1.17.0-i686-apple-darwin.tar.gz
1689060c07ec727e9756f19c9373045668471ab56fd8f53e92701150bbe2032b  rust-1.17.0-x86_64-apple-darwin.tar.gz

@garbas
Copy link
Member

garbas commented Jun 27, 2017

should we also cherry pick this to 17.03? since rust 1.x is backwards compatible

\cc @LnL7 @anderspapitto

@anderspapitto
Copy link
Contributor Author

I have no opinion on cherry-picking to 17.03

@anderspapitto anderspapitto deleted the rust-updates branch March 10, 2018 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: rust 8.has: package (update) This PR updates a package to a newer version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet