Skip to content

Rust 1.33 stable fails to compile itself #58845

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

Closed
thomasjfox opened this issue Mar 1, 2019 · 12 comments
Closed

Rust 1.33 stable fails to compile itself #58845

thomasjfox opened this issue Mar 1, 2019 · 12 comments

Comments

@thomasjfox
Copy link

Compiling Rust 1.33 with Rust 1.32 on Fedora 29 was fine.
When using the newly created 1.33 compiler to compile Rust 1.33 again, it fails:

..
Generating unstable book md files (i686-unknown-linux-gnu)
Building stage0 tool unstable-book-gen (i686-unknown-linux-gnu)
   Compiling proc-macro2 v0.4.24
   Compiling unicode-xid v0.1.0
   Compiling serde v1.0.82
   Compiling ryu v0.2.7
   Compiling itoa v0.4.3
   Compiling num-traits v0.2.6
   Compiling quote v0.6.10
   Compiling syn v0.15.22
   Compiling serde_json v1.0.33
   Compiling serde_derive v1.0.81
   Compiling tidy v0.1.0 (/datastore/rpmbuild/BUILD/rustc-1.33.0-src/src/tools/tidy)
error: use of deprecated item 'core::str::<impl str>::trim_left_matches': superseded by `trim_start_matches`
   --> src/tools/tidy/src/features.rs:191:61
    |
191 |             let level = match parts.next().map(|l| l.trim().trim_left_matches('(')) {
    |                                                             ^^^^^^^^^^^^^^^^^
    |
    = note: `-D deprecated` implied by `-D warnings`

error: aborting due to previous error

error: Could not compile `tidy`.

The code in question has been fixed by
b7f030e#diff-e7f0adcf2688b6a55b1f70d117ed7e17
but I don't know why that fix never made it into the official 1.33 release.

Related issue: #57262

@cuviper
Copy link
Member

cuviper commented Mar 1, 2019

#57990 backported the fixes in src/bootstrap, but missed those in linkchecker and tidy.

@Mark-Simulacrum
Copy link
Member

I'm going to close this -- we don't currently guarantee that the stable compiler can fully bootstrap itself as-is. If this is a significant problem for distros a heads up before the release (i.e., on the beta branch) would be appreciated -- we can fix this much easier there.

(I've also tagged as stable-nominated/accepted so that if there's a point release we can sneak the relevant patch in).

@Mark-Simulacrum Mark-Simulacrum added stable-nominated Nominated for backporting to the compiler in the stable channel. stable-accepted Accepted for backporting to the compiler in the stable channel. labels Mar 1, 2019
@cuviper
Copy link
Member

cuviper commented Mar 1, 2019

@joshtriplett
Copy link
Member

joshtriplett commented Apr 8, 2019

@Mark-Simulacrum This is a problem for distributions, which may well want to build a new release of the compiler package with the previous version of the compiler package (e.g. 1.33-distro2 with 1.33-distro1).

What would it take for us to get appropriate CI in place that ensures that stable compilers build with themselves?

This doesn't make a great first impression for someone trying to build their own copy of rustc.

cc @fenrus75

@Mark-Simulacrum
Copy link
Member

Building your own copy of rustc should not be a problem - we download appropriate beta compilers.

The problem is not - currently - CI, it's rather that we have no real way of supporting different bootstrap compilers. However, we've discussed that we should implement and enforce a policy that no crate should be using unstable things from the bootstrap compiler, which should fix this more permanently; I'm not sure how much work that'll be and don't currently have the bandwidth to investigate.

@cuviper
Copy link
Member

cuviper commented Apr 8, 2019

Maybe we could add something like dist-check to CI, using the just-built compiler as a new stage0? It wouldn't need a full build, just enough to see that it basically works, like ./x.py build --stage 0 for the compiler, and then build tools like compiletest that always use stage0.

@Mark-Simulacrum
Copy link
Member

We already have a dist check builder that could do this (and perhaps should); it currently doesn't change the bootstrap compiler I guess?

@cuviper
Copy link
Member

cuviper commented Apr 8, 2019

Right, I think the current dist check is about making sure the rustc-src tarball is complete. It still downloads stage0 etc. A "rebuild check" would use the local rustc to bootstrap, and it could also share the LLVM build to save time and space.

@joshtriplett
Copy link
Member

joshtriplett commented Apr 9, 2019

@Mark-Simulacrum

Building your own copy of rustc should not be a problem - we download appropriate beta compilers.

Not on any system with a policy of "no network access during builds" you don't. :)

Distros will build rustc using the previous package of rustc, and that might be version N-1 or it might be version N.

@cuviper Sounds reasonable to me.

@Mark-Simulacrum
Copy link
Member

Not on any system with a policy of "no network access during builds" you don't. :)

Maybe I misunderstood - I specifically meant the use case of downloading a source tarball and building. I fully agree that distros want the support for self-building (and that if we can take relatively easy steps to provide it for them, we should).

@fenrus75
Copy link

fenrus75 commented Apr 9, 2019 via email

@pietroalbini pietroalbini removed stable-accepted Accepted for backporting to the compiler in the stable channel. stable-nominated Nominated for backporting to the compiler in the stable channel. labels Apr 12, 2019
@thomasjfox
Copy link
Author

Side note: Rust 1.34.0 does "Rustception" (=compile itself) just fine. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants