cc-rs icon indicating copy to clipboard operation
cc-rs copied to clipboard

Build::expand() prints the filename as a warning on windows

Open dimbleby opened this issue 1 year ago • 4 comments

> cargo c
warning: expando.c
    Finished dev [unoptimized + debuginfo] target(s) in 0.10s

presumably because cl.exe likes to print the filename, I guess to stderr, eg

> "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX64\\x64\\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-I" "c-ares/include/" "-W4" "-E" "build/expando.c"
expando.c
#line 1 "build/expando.c"
#line 1 "C:\\Users\\dch\\rust-c-ares\\c-ares-sys\\c-ares\\include\\ares_version.h"
...

and then cc-rs presents that as a warnng.

Just a minor annoyance I guess.

dimbleby avatar Nov 08 '23 20:11 dimbleby

I did search for duplicates but I now found #296, which does nothing with this on the grounds that it doesn't come up often.

Well I guess I'm telling you that it does come up a bit more often; but I would acknowledge that two reports in five-ish years isn't very many.

dimbleby avatar Nov 08 '23 21:11 dimbleby

Is there a better way for us to distinguish this from actual warnings than just comparing it to the file name (which is pretty annoying...)

thomcc avatar Nov 12 '23 19:11 thomcc

maybe just assume that the first line of output is the filename?

If I'd found the earlier issue choosing to do nothing about this first then I'd likely not have bothered to raise it again: continuing to do nothing doesn't seem like an unreasonable choice.

dimbleby avatar Nov 12 '23 19:11 dimbleby

I think checking that it is the same is better than just assuming it is because I'm not 100% confident ignoring the first line will be right in every situation. But, yeah, it would be much better if there were some principled way to filter the output.

ChrisDenton avatar Nov 13 '23 09:11 ChrisDenton