Closed
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
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?