How to make Bazel print file paths to the console using backslashes on Windows

已查看 54 次
跳至第一个未读帖子

Konstantin

未读,
2022年6月13日 21:09:572022/6/13
收件人 bazel-discuss
When Bazel compiles C++ files it prints out file paths with the forward slashes, like this:
    Compiling src/cpp/test/ActivityContextProxyTest.cpp; 6s local
    Compiling src/cpp/main/MetricsMonitor.cpp; 6s local
Same when it displays compilation errors:
external/art-cpp/src/cpp/test/TStringAssertionTraits.cpp(18): error C2143: syntax error: missing ';' before 'CppUnit::assertion_traits<TString>::equal'
external/art-cpp/src/cpp/test/TStringAssertionTraits.cpp(18): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

This creates a problem for Visual Studio on Windows - it does not understand forward slashes, so clicking on the error to navigate to source does not work.

Is there a way to make Bazel print backslashes in the paths on Windows? At least in the compiler error messages.

Thank you!
Konstantin

Alex Humesky

未读,
2022年6月14日 17:52:282022/6/14
收件人 Konstantin、bazel-discuss
On Mon, Jun 13, 2022 at 9:10 PM Konstantin <kon...@ermank.com> wrote:
When Bazel compiles C++ files it prints out file paths with the forward slashes, like this:
    Compiling src/cpp/test/ActivityContextProxyTest.cpp; 6s local
    Compiling src/cpp/main/MetricsMonitor.cpp; 6s local

This part looks like it comes from bazel, so that part is potentially changeable so it prints platform-dependent plaths. Probably best to file a feature request

Same when it displays compilation errors:
external/art-cpp/src/cpp/test/TStringAssertionTraits.cpp(18): error C2143: syntax error: missing ';' before 'CppUnit::assertion_traits<TString>::equal'
external/art-cpp/src/cpp/test/TStringAssertionTraits.cpp(18): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

Is this coming from bazel, or a compiler? Looks to me like it's from a compiler, so I'm not sure that bazel can do much about that unfortunately.


This creates a problem for Visual Studio on Windows - it does not understand forward slashes, so clicking on the error to navigate to source does not work.

Is there a way to make Bazel print backslashes in the paths on Windows? At least in the compiler error messages.

Thank you!
Konstantin

--
You received this message because you are subscribed to the Google Groups "bazel-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bazel-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/bazel-discuss/28ab7871-7eac-4131-9eae-18cbc39f1f1bn%40googlegroups.com.

Konstantin

未读,
2022年6月21日 13:13:322022/6/21
收件人 bazel-discuss
One partial workaround I found is MSVC option "/FC" which makes it use canonicalized paths in all diagnostics.
回复全部
回复作者
转发
0 个新帖子