You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Enable color output in rustc when it normally would be #99
@jrmuizel was testing sccache for local Rust compilation and he noted that it made rustc's errors lose their normal color formatting. This is because rustc defaults to --color auto, which checks if stdout is a tty. Since sccache sends rustc's stdout/stderr to pipes, it doesn't output in color. We could append --color always to our rustc invocations if --color isn't already present on the commandline. Ideally we'd check if the sccache client's stdout is a tty and only do so in that case. That would present an edge case where we could cache color rustc output, then someone could run another compilation and pipe the output, and we'd use the cached output with the colors, but it doesn't seem to be likely to be a big problem in practice. The only colorful output rustc produces in successful compilations is warnings, AFAIK. We could make that edge case work by stripping ANSI color codes from the output when stdout is not a tty. If we did that, then we could just unIlaterally pass --color always to rustc and strip out the color codes when they're not wanted.
Also --color argument mustn't trigger recompilation, so I see better approach in unconditionally passing (or overriding to) --color=always and stripping color codes when necessary.
Analogous logic should be implemented for gcc's and clang's -fdiagnostics-color.
For now adding rustflags = ["--color=always"] to .cargo/config mitigates the problem.
Analogous logic should be implemented for gcc's and clang's -fdiagnostics-color.
Just to clarify: I did not implement support for this for gcc/clang. All the pieces necessary should be there, it'd just be a matter of adding the commandline parsing and such in the code that handles C compilation.
Activity
theduke commentedon Jul 25, 2017
Big plus one for this.
You get a very noticable speedup when working on many crates, and always setting/unsetting RUSTC_WRAPPER is annoying.
versusvoid commentedon Nov 11, 2017
Also
--colorargument mustn't trigger recompilation, so I see better approach in unconditionally passing (or overriding to)--color=alwaysand stripping color codes when necessary.Analogous logic should be implemented for gcc's and clang's
-fdiagnostics-color.For now adding
rustflags = ["--color=always"]to.cargo/configmitigates the problem.Always request color output from rustc. Fixes mozilla#99
luser commentedon Feb 2, 2018
Just to clarify: I did not implement support for this for gcc/clang. All the pieces necessary should be there, it'd just be a matter of adding the commandline parsing and such in the code that handles C compilation.
Always request color output from rustc. Fixes mozilla#99
Merge pull request mozilla#99 from paritytech/igor-s3-rusoto
Always request color output from rustc. Fixes mozilla#99
feat(transport): Add service multiplexing/routing (mozilla#99)