Skip to content

Windows: protoc.exe built with MSVC cannot handle long path #2634

@meteorcloudy

Description

@meteorcloudy

Related: #2627
Got following error when enable MSVC as the default toolchain on Windows.

ERROR: C:/tools/msys64/home/pcloudy/workspace/bazel/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/BUILD:10:1: error executing shell command: 'JAR='external/local_jdk/bin/jar.exe' OUTPUT='bazel-out/msvc_x64-fastbuild/bin/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/libbuild_event_stream_java_proto_srcjar.srcjar' PROT...' failed: bash.exe failed: error executing command
  cd C:/tmp/_bazel_pcloudy/7uxoax_v/execroot/bazel
  SET PATH=C:\Program Files\Anaconda3;C:\tools\msys64\home\pcloudy\bin;C:\Program Files\Java\jdk1.8.0_77\bin;C:\tools\msys64\usr\local\bin;C:\tools\msys64\usr\bin;C:\tools\msys64\usr\bin;C:\tools\msys64\opt\bin;C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\tools\msys64\usr\bin\site_perl;C:\tools\msys64\usr\bin\vendor_perl;C:\tools\msys64\usr\bin\core_perl
  C:/tools/msys64/usr/bin/bash.exe -c JAR='external/local_jdk/bin/jar.exe' OUTPUT='bazel-out/msvc_x64-fastbuild/bin/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/libbuild_event_stream_java_proto_srcjar.srcjar' PROTO_COMPILER='bazel-out/host/bin/third_party/protobuf/3.0.0/protoc.exe'  SOURCE='src/main/java/com/google/devtools/build/lib/buildeventstream/proto/build_event_stream.proto' bazel-out/host/bin/tools/build_rules/gensrcjar: com.google.devtools.build.lib.shell.BadExitStatusException: Process exited with status 1.
com/google/devtools/build/lib/buildeventstream/BuildEventStreamProtos.java: while trying to create directory bazel-out/msvc_x64-fastbuild/bin/src/main/java/com/google/devtools/build/lib/buildeventstream/proto/libbuild_event_stream_java_proto_srcjar.srcjar.proto_output/com/google/devtools/build/lib/buildeventstream: No such file or directory
gensrcjar: proto_compiler failed
ERROR: C:/tools/msys64/home/pcloudy/workspace/bazel/src/main/protobuf/BUILD:25:2: output 'src/main/protobuf/libcrosstool_config_java_proto_srcjar.srcjar' was not created.
ERROR: C:/tools/msys64/home/pcloudy/workspace/bazel/src/main/protobuf/BUILD:25:2: output 'src/main/protobuf/libintellij_ide_info_java_proto_srcjar.srcjar' was not created.
ERROR: C:/tools/msys64/home/pcloudy/workspace/bazel/src/main/protobuf/BUILD:38:1: output 'src/main/protobuf/libcommand_server_java_proto_srcjar.srcjar' was not created.
ERROR: C:/tools/msys64/home/pcloudy/workspace/bazel/src/main/protobuf/BUILD:25:2: output 'src/main/protobuf/libinvocation_policy_java_proto_srcjar.srcjar' was not created.

I believe the reason is because proto compiler built with MSVC cannot handle long path. The workaround could be using MSYS to build proto.exe, we can still get a msys free bazel in this way, but cannot build bazel without MSYS unless we solve this.

Is it an issue of protobuf instead of Bazel? //cc @dslomov @laszlocsomor

Metadata

Metadata

Assignees

Labels

P2We'll consider working on this in future. (Assignee optional)platform: windowstype: bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions