I have a cc_binary target that is compiling some .c files. When I build it I get the compiler warnings in the terminal and I am using this to capture them to a file:
bazel build path/to/target:my_target 2>&1 | Out-File -FilePath build_compiler_warnings.txt -Encoding utf8Now I want every time that I build
my_target to get a file with the warnings automatically, is there such way, because I have tried multiple solutions and nothing worked.
For another solution I found that for my compiler there is actually a flag that is redirecting the stderr to a file, and I am giving it in the copts of the cc_binary now to get the warnings file. But the file is not cached, and it is only created when something is compiled, but I need it all the time, is there a way to copy it or cache it, because I could not find such.