-
Notifications
You must be signed in to change notification settings - Fork 13.3k
1.10.0 fails to build with bootstrap compiler #34722
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
Comments
You must use corresponding beta (i.e. 1.11 to build 1.10) when bootstraping rustc. You’re trying to bootstrap 1.10 with 1.10. |
cc @alexcrichton 2nd cycle we get exactly the same error reported. Maybe some sort of diagnostic is in order? |
This is quite inconvenient. As far as I see, there isn't any beta of |
Hm I'm a bit confused here, as @nagisa mentioned you can only bootstrap the 1.10 compiler with the 1.9 compiler, no other compiler in the world. @the-kenny are you trying to bootstrap 1.10 with 1.10? How is 1.11 coming into play? |
@alexcrichton Yes, apparently I was trying to bootstrap 1.10 with 1.10. Did I misunderstand @nagisa? My understanding of his comment was that I have to use Using |
@the-kenny ah yes you can neither bootstrap 1.10 with 1.10 nor 1.11, the only way it can work is with the 1.9 compiler. Can you gist a full build log where you're using the 1.9 compiler to bootstrap? Also, where did the 1.9 compiler come from? If you're also building the 1.9 compiler manually then the bootstrap will only work if the 1.9 compiler is configured with |
@alexcrichton Thanks! Full build-log is at https://gist.github.com/the-kenny/4b6dc5991771a82873ab29bbd8179692 I'm using |
@the-kenny hm that's certainly an unusual build log! You're clearly able to use unstable features because libcore succesfully compiled, but then apparently liballoc got linked to something like a stale copy? It's not clear to me what exactly could trigger that error. There's some suspicious errors at the top though which may be relevant? Could you try it again but with |
Verbose build log: https://gist.github.com/the-kenny/6707ad42d1c4fe70a805198795edc905 |
Hm unfortunately that didn't help me at much, I'm not actually sure what's going on here. It'd probably be best to play around with various Is there a way I could easily reproduce this locally? |
It should be quite easy to reproduce (with Nix). Unfortunately I'm on a mobile internet connection right now and can't download a virgin NixOS VM to check if it's reproducible and document the steps. The other way would be to try to reproduce it on a normal Ubuntu (or whatever) installation without Nix. I can try that, but unfortunately need to download an ISO for that too. Stay tuned, I'll update this issue as soon as I'm back on a fast and unlimited connection later today. |
Dumb question: How is a |
There is a secret environment variable that enables unstable features. It's used for the bootstrap (i.e. building stable stage 2 with stable stage 1). |
My guess is that the secret key is not being routed correctly in our case. |
I inserted a call to The value of Full build log with |
If someone here uses NixOS or has Nix installed on his system, he can give https://github.com/the-kenny/nixpkgs/tree/rust-1.10.0 a try. I can also push the branch which patches |
I can reproduce the error locally, but unfortunately I can't make heads or tails of how to debug nix or what the build file is doing :( |
@alexcrichton For a start, you can pass |
Maybe I can help, since I wrote those build files. I know time is scare and nix is weird if you're not used to the nix way, but it would help if you were a little more specific on the heads and tails part. Currently in the file bootstrap.nix we download the official release tarball for rust 1.9.0 and split it into two packages rustc and cargo to be consistent with the source builds. The snapshot.nix file should become irrelevant. And the beta.nix and head.nix are for building beta and master. Then we have makeRustPlatform here: https://github.com/NixOS/nixpkgs/blob/master/pkgs/top-level/all-packages.nix#L5428 that also isn't particularly important at the moment (since we're still using make to build rustc). Then in default.nix we try building rustc 1.10.0 with the bootstrapped 1.9.0 release binary by passing some parameters to the generic rustc.nix that is used for all versions (stable, beta, master). I hope this clarifies things. Thanks, |
Aha, thanks for the flag and the explanation @the-kenny and @dvc94ch! Sorry I'm just a total newb with nix and I was having trouble seeing how things connected in the nix configuration file or just how to get the build directory to stick around so I could poke at it. The It looks like the compiler is loading the wrong libcore:
That is, when it's compiling liballoc it's linking against the 1.9.0 libcore rather than the one that was just created. This appears to be because the snapshot compiler thinks the sysroot is in I believe this is because there is apparently a Does that make sense? Would it be possible to not use a wrapper script? Another possible solution would be to ensure that the binary is copied down as part of |
Yes, this absolutely make sense. I'll investigate it right now and keep you updated. |
Good news: Build seems to continue farther. I'll comment as soon as it's done. It's funny - I actually mentioned earlier in this issue that the |
That was all!? Hah I still have to wrap my head around why this happens...
|
@dvc94ch As far as I see, the |
Oh, now I understood the problem. Thanks!!
|
Okay, we got much further this time :) It fails somewhere at the end with @alexcrichton Do you think there should be any safeguards in the compiler for this bug? If so, I'd keep the issue open for reference. If not I'm fine with closing this as we found the culprit. Thank you so much for your work! |
Ok, awesome! I'll close this for now, but that remaining bug sounds bad! It may be a case where we think git exists but it doesn't actually and we're reporting something erroneously. Want to open a new bug with those logs? |
Wrapping $out/bin/rustc causes issues in bootstrap builds which are *very* hard to track down. For details, see: rust-lang/rust#34722 (comment)
Ups thought it was the nixos thread, I would have replied differently otherwise. @alexcrichton Thank you for taking the time and doing such an awesome job at tracking down my bugs. @the-kenny I worked around the lockfile issue by disabling the test, there is a patch in the patches directory for that. |
@dvc94ch Right, I just came up with exactly the same patch by myself without looking at the patches directory :D @alexcrichton I'll open a separate issue - but I think it's quite minor. Basically the |
@the-kenny oh that's definitely worth fixing! Our source tarballs don't have |
While trying to package
rust-1.10.0
for NixOS, I ran into the following issue:We're using a bootstrap compiler from
https://static.rust-lang.org/dist/rust-1.10.0-$platforn.tar.gz
to buildrustc
with the following configure flags (among others):While the build used to work just fine for
1.9.0
, we get errors buildinglibcore
for1.10.0
:Full output (don't worry about the strange-looking absolute paths, they're normal on NixOS):
https://gist.github.com/the-kenny/1424cd6a03467326dc1b6ad2e6480272
The text was updated successfully, but these errors were encountered: