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

x.py should not die if I set RUSTFLAGS=--color=never in the env #49838

Closed
pnkfelix opened this issue Apr 10, 2018 · 2 comments
Closed

x.py should not die if I set RUSTFLAGS=--color=never in the env #49838

pnkfelix opened this issue Apr 10, 2018 · 2 comments
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@pnkfelix
Copy link
Member

pnkfelix commented Apr 10, 2018

Right, now, if I do RUSTFLAGS=--color=never x.py build, I get:

Building stage0 std artifacts (x86_64-unknown-linux-gnu -> x86_64-unknown-linux-gnu)
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/pnkfelix/Dev/Mozilla/issue27282/rust-27282/objdir-dbgopt/build/bootstrap/debug/rustc - --crate-name ___ --print=file-names --color=never --target x86_64-unknown-linux-gnu --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro` (exit code: 101)
--- stderr
error: Option 'color' given more than once

My initial inference here is that we are dying because rustc is getting multiple --color=never directives (and one is coming in implicitly via RUSTFLAGS

In my opinion, rustc should allow one to pass --color=never multiple times. (Arguably other combinations of --color should also be allowed.)

  • Perhaps we should go even further and determine general precedence rules for mixing RUSTFLAGS input with command line input. But I digress.

But if we want to continue having rustc be strict about that, then x.py needs to be smarter about looking at the environment when it decides what arguments to pass to the rustc it invokes.

@Mark-Simulacrum
Copy link
Member

This is also presumably and probably the case for a variety of other options that we currently pass to rustc in rustbuild; I agree that this feels like a rustc bug, but it should be somewhat easy to fix or patch over in rustbuild if we wanted to...

@csmoe csmoe added the T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) label Jun 1, 2018
@XAMPPRocky XAMPPRocky added C-enhancement Category: An issue proposing an enhancement or a PR with one. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Jul 7, 2018
@jyn514
Copy link
Member

jyn514 commented Jun 27, 2022

bootstrap now has built-in support for --color (since #79004) and RUSTFLAGS=--color fails for other reasons that are cargo related and not controlled by bootstrap:

error: cannot specify the `--color` option with `--json`

I'm going to close this since this specific issue is no longer relevant; if you think rustc should accept multiple flags that do the same thing I agree :) but I think that deserves an MCP rather than sitting in the issue tracker ignored.

@jyn514 jyn514 closed this as not planned Won't fix, can't repro, duplicate, stale Jun 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: An issue proposing an enhancement or a PR with one. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

5 participants