rust-lang / rust-lang/rust

Cannot use unstable flags in RUSTFLAGS_BOOTSTRAP

Open
#118,369 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-discussion T-bootstrap
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

I want to compile rustc with some unstable flags.

RUSTFLAGS_BOOTSTRAP="-Zmeta-stats" x build compiler errors with

error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/gh-Nilstrieb/rust/build/aarch64-unknown-linux-gnu/stage0/bin/rustc - --crate-name ___ --print=file-names -Wrust_2018_idioms -Wunused_lifetimes -Zmeta-stats --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg` (exit status: 1)
  --- stderr
  error: the option `Z` is only accepted on the nightly compiler

  help: consider switching to a nightly toolchain: `rustup default nightly`

  note: selecting a toolchain with `+toolchain` arguments require a rustup proxy; see <https://rust-lang.github.io/rustup/concepts/index.html>

  note: for more information about Rust's stability policy, see <https://doc.rust-lang.org/book/appendix-07-nightly-rust.html#unstable-features>

  error: 1 nightly option were parsed

explicitly setting RUSTC_BOOTSTRAP=1 doesn't work either. using RUSTFLAGS= directly also doesn't work

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the reported RUSTFLAGS_BOOTSTRAP="-Zmeta-stats" x build compiler command and compare it with the behavior of RUSTC_BOOTSTRAP=1 and direct RUSTFLAGS. Trace how the bootstrap compiler is invoked and determine the expected handling of unstable flags before defining a targeted fix and regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.