-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)
Description
When I run x.py
from inside emacs, everything works fine for the stage0 build. But errors that arise in the stage1 build always have color information. This is annoying since the emacs compilation window can't interpret ansi colors, so I get this garbage:
^[[0m^[[38;5;9m^[[1merror[E0503]^[[0m^[[0m^[[1m: cannot use `result` because it was mutably borrowed^[[0m
^[[0m ^[[0m^[[0m^[[38;5;12m^[[1m--> ^[[0m^[[0mrustc/compiler_builtins_shim/../../libcompiler_builtins/src/float/add.rs:179:46^[[0m
^[[0m ^[[0m^[[0m^[[38;5;12m^[[1m|^[[0m
^[[0m^[[38;5;12m^[[1m179^[[0m^[[0m ^[[0m^[[0m^[[38;5;12m^[[1m| ^[[0m^[[0m if round_guard_sticky == 0x4 { result += result & one; }^[[0m
^[[0m ^[[0m^[[0m^[[38;5;12m^[[1m| ^[[0m^[[0m ^[[0m^[[0m^[[38;5;12m^[[1m----------^[[0m^[[0m^[[38;5;9m^[[1m^^^^^^^[[0m^[[0m^[[38;5;12m^[[1m------^[[0m
^[[0m ^[[0m^[[0m^[[38;5;12m^[[1m| ^[[0m^[[0m ^[[0m^[[0m^[[38;5;12m^[[1m|^[[0m^[[0m ^[[0m^[[0m^[[38;5;9m^[[1m|^[[0m
^[[0m ^[[0m^[[0m^[[38;5;12m^[[1m| ^[[0m^[[0m ^[[0m^[[0m^[[38;5;12m^[[1m|^[[0m^[[0m ^[[0m^[[0m^[[38;5;9m^[[1muse of borrowed `result`^[[0m
^[[0m ^[[0m^[[0m^[[38;5;12m^[[1m| ^[[0m^[[0m ^[[0m^[[0m^[[38;5;12m^[[1mborrow of `result` occurs here^[[0m
^[[0m ^[[0m^[[0m^[[38;5;12m^[[1m| ^[[0m^[[0m
It seems like the problem is this logic in rustbuild, which is a wee bit forceful:
Lines 1004 to 1009 in a04b88d
if stderr_isatty() && build.ci_env == CiEnv::None { | |
// since we pass message-format=json to cargo, we need to tell the rustc | |
// wrapper to give us colored output if necessary. This is because we | |
// only want Cargo's JSON output, not rustcs. | |
cargo.env("RUSTC_COLOR", "1"); | |
} |
Not sure what's the best way to fix this. I'm surprised that stderr is coming up as a "tty" when running from inside the M-x compile shell in emacs, but for sure the TERM variable is dumb
. Maybe we should respect that?
Metadata
Metadata
Assignees
Labels
C-enhancementCategory: An issue proposing an enhancement or a PR with one.Category: An issue proposing an enhancement or a PR with one.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)