Propagate --color option to rustc#2779
Conversation
|
r? @wycats (rust_highfive has picked a reviewer for you, use r? to override) |
|
Ah yeah I think this location is fine, other places aren't necessarily invoking the compiler so it probably wants to avoid those directly. Thanks! With a test r=me |
1f75043 to
cb3c5e9
Compare
|
Added the test. And, OMG, someone has removed the |
|
Hm, ironically the tests pass in the IDE and not on the CI, because so no colors in the IDE with |
cb3c5e9 to
5b7a163
Compare
src/cargo/core/shell.rs
Outdated
There was a problem hiding this comment.
Oh actually, this should implement fmt::Display conventionally instead of ToString directly.
There was a problem hiding this comment.
Good to know, thanks!
5b7a163 to
76a48a9
Compare
Propagate --color option to rustc closes #2740 Will try to add a test for this soon (and fix failing tests if any, compiling/running tests locally is slow :( ). I am not sure what is the right place to add `--color` option to the command line. I use [`build_base_args`]. [`process`] also looks like a good candidate, because it is more general, but if we look at the [`CommandType`] we see that only `rustc` command supports `--color`. [`build_base_args`]: https://github.com/matklad/cargo/blob/1f7504397ce7c40ff708e2d31da164822e88ed37/src/cargo/ops/cargo_rustc/mod.rs#L449 [`process`]: https://github.com/matklad/cargo/blob/1f7504397ce7c40ff708e2d31da164822e88ed37/src/cargo/ops/cargo_rustc/mod.rs#L608 [`CommandType`]: https://github.com/matklad/cargo/blob/1f7504397ce7c40ff708e2d31da164822e88ed37/src/cargo/ops/cargo_rustc/engine.rs#L102
|
☀️ Test successful - cargo-cross-linux, cargo-linux-32, cargo-linux-64, cargo-mac-32, cargo-mac-64, cargo-win-gnu-32, cargo-win-gnu-64, cargo-win-msvc-32, cargo-win-msvc-64 |
closes #2740
Will try to add a test for this soon (and fix failing tests if any, compiling/running tests locally is slow :( ).
I am not sure what is the right place to add
--coloroption to the command line. I usebuild_base_args.processalso looks like a good candidate, because it is more general, but if we look at theCommandTypewe see that onlyrustccommand supports--color.