Skip to content
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

Use RUSTC_BOOTSTRAP to build sysroot for stable #275

Closed
wants to merge 1 commit into from

Conversation

xurtis
Copy link

@xurtis xurtis commented Feb 16, 2020

When building the sysroot or rust compiler with a beta or stable rustc
binary the flag RUSTC_BOOTSTRAP can be set to 1 to allow rustc to allow
the same features as the development channel. This is required as the
rust compiler and sysroot make use of unstable features.

See here: rust-lang/cargo#5613

Fixes #225

When building the sysroot or rust compiler with a beta or stable rustc
binary the flag RUSTC_BOOTSTRAP can be set to 1 to allow rustc to allow
the same features as the development channel. This is required as the
rust compiler and sysroot make use of unstable features.

See here: rust-lang/cargo#5613
@RalfJung
Copy link
Collaborator

Thanks for the PR!

However, RUSTC_BOOTSTRAP is an internal rustc/cargo flag and not meant to be used by non-official projects. It can be used to subvert Rust's stability story.

I don't think we should do this.

@xurtis
Copy link
Author

xurtis commented Feb 16, 2020

The RUSTC_BOOTSTRAP flag is only used when building a sysroot, not when building user packages.

In general, building sysroot crates such as core, alloc, and std require setting the RUSTC_BOOTSTRAP flag to allow them to use stable compiler but with access to unstable features, without which these crates cannot be compiled.

If we wanted to avoid relying on this internal feature we'd probably have to wrap x.py instead (which would do this for us).

@RalfJung
Copy link
Collaborator

RalfJung commented Feb 17, 2020

Building a sysroot yourself is not something that is supported in a stable way by Rust. RUSTC_BOOTSTRAP is the internal flag rustc is using to build its own sysroot. To my knowledge, iIs not not ever, never meant to be used by outside projects.

xargo is used by people that build their own custom libstd (not just build the official libstd with different flags); adding this flag would suddenly make that work on stable even though these custom libstd use tons of nightly features! That is violating Rust's safety story.

If all you want to do is build the official libstd with different flags, I suggest you use cargo's build-std facilities. They are better maintained and better integrated than xargo.

Let me put it this way: if you can get an official statement from the Rust Compiler team that it is okay for xargo to use this flag, then I am on board. But without such a statement, I'm afraid I will not accept this PR.

@xurtis
Copy link
Author

xurtis commented Feb 18, 2020

Alright, that seems reasonable.

@xurtis xurtis closed this Feb 18, 2020
@RalfJung RalfJung mentioned this pull request Feb 18, 2020
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

Successfully merging this pull request may close these issues.

Do not require nightly
2 participants