FS#69662 - [clang] Coloring diagnostics does not always work
Attached to Project:
Arch Linux
Opened by Krzysztof Małysa (varqox) - Tuesday, 16 February 2021, 16:45 GMT
Last edited by Evangelos Foutras (foutrelis) - Wednesday, 17 February 2021, 11:40 GMT
Opened by Krzysztof Małysa (varqox) - Tuesday, 16 February 2021, 16:45 GMT
Last edited by Evangelos Foutras (foutrelis) - Wednesday, 17 February 2021, 11:40 GMT
|
Details
Description:
Arch clang does not color diagnostics, while the upstream clang does when using flags `-Xclang -fcolor-diagnostics -c` and redirecting stderr through a pipe. The expected behavior of clang is to color the diagnostics regardless of the fact that stderr is not some tty. However, if I remove `-Xclang` or `-c` it works i.e. both `clang++ -fcolor-diagnostics -c foo.cc 2>&1 | cat` and `clang++ -Xclang -fcolor-diagnostics foo.cc 2>&1 | cat` give colored output. I cannot reproduce this behavior using the official clang build: https://github.com/llvm/llvm-project/releases/download/llvmorg-11.0.1/clang+llvm-11.0.1-x86_64-linux-gnu-ubuntu-20.10.tar.xz Additional info: * package version: 11.0.1-1 Steps to reproduce: 1. Create file `foo.cc` with below content: ``` int main() { return ""; } ``` 2. Run: `clang++ -Xclang -fcolor-diagnostics -c foo.cc 2>&1 | cat` |
This task depends upon
Closed by Evangelos Foutras (foutrelis)
Wednesday, 17 February 2021, 11:40 GMT
Reason for closing: Upstream
Additional comments about closing: Tracked upstream in ccache.
Wednesday, 17 February 2021, 11:40 GMT
Reason for closing: Upstream
Additional comments about closing: Tracked upstream in ccache.
I reported this bug upstream: https://github.com/ccache/ccache/issues/801