You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When protoc is compiled with MinGW, it has a dependency on libstdc++-6.dll which is found (typically) in C:\msys64\mingw64\bin.
The only way an executable can find this DLL is by having C:\msys64\mingw64\bin in it's PATH, but rules_proto_grpc runs protoc without passing use_default_shell_env = True which causes it to run with only the workspace root in the PATH, preventing libstdc++-6.dll from being found.
Issue can be reprocuced by running bazel build --compiler=mingw-gcc //... in the example/c/c_proto_compile directory on Windows, with MinGW installed.
Log Output
INFO: Invocation ID: 9cab3575-b92f-442b-afd9-374be79aecb9
DEBUG: Rule 'com_google_absl' indicated that a canonical reproducible form can be obtained by modifying arguments sha256 = "316cb2947e0a39a9359071991c2632418a466c78f3d27a7efe8d30dd384a0d06"
DEBUG: Repository com_google_absl instantiated at:
C:/projects/rules_proto_grpc/example/c/c_proto_compile/WORKSPACE:24:9: in <toplevel>
C:/users/blah/_bazel_blah/ir7hhvo4/external/upb/bazel/workspace_deps.bzl:5:10: in upb_deps
C:/users/blah/_bazel_blah/ir7hhvo4/external/bazel_tools/tools/build_defs/repo/utils.bzl:233:18: in maybe
Repository rule http_archive defined at:
C:/users/blah/_bazel_blah/ir7hhvo4/external/bazel_tools/tools/build_defs/repo/http.bzl:364:31: in <toplevel>
INFO: Analyzed 3 targets (2 packages loaded, 4 targets configured).
INFO: Found 3 targets...
ERROR: C:/projects/rules_proto_grpc/example/c/c_proto_compile/BUILD.bazel:13:16: Compiling protoc outputs for upb_plugin plugin on target //:thing_c_proto failed: (Exit 127): bash.exe failed: error executing command C:\msys64\usr\bin\bash.exe -c mkdir -p 'bazel-out/x64_windows-fastbuild/bin/_rpg_premerge_thing_c_proto' && bazel-out/x64_windows-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/protoc.exe $@ ... (remaining 4 arguments skipped)
C:/users/blah/_bazel_blah/ir7hhvo4/execroot/__main__/bazel-out/x64_windows-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/protoc.exe: error while loading shared libraries: libstdc++-6.dll: cannot open shared object file: No such file or directory
ERROR: C:/projects/rules_proto_grpc/example/c/c_proto_compile/BUILD.bazel:3:16: Compiling protoc outputs for upb_plugin plugin on target //:person_c_proto failed: (Exit 127): bash.exe failed: error executing command C:\msys64\usr\bin\bash.exe -c mkdir -p 'bazel-out/x64_windows-fastbuild/bin/_rpg_premerge_person_c_proto' && bazel-out/x64_windows-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/protoc.exe $@ ... (remaining 4 arguments skipped)
C:/users/blah/_bazel_blah/ir7hhvo4/execroot/__main__/bazel-out/x64_windows-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/protoc.exe: error while loading shared libraries: libstdc++-6.dll: cannot open shared object file: No such file or directory
ERROR: C:/projects/rules_proto_grpc/example/c/c_proto_compile/BUILD.bazel:8:16: Compiling protoc outputs for upb_plugin plugin on target //:place_c_proto failed: (Exit 127): bash.exe failed: error executing command C:\msys64\usr\bin\bash.exe -c mkdir -p 'bazel-out/x64_windows-fastbuild/bin/_rpg_premerge_place_c_proto' && bazel-out/x64_windows-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/protoc.exe $@ ... (remaining 4 arguments skipped)
C:/users/blah/_bazel_blah/ir7hhvo4/execroot/__main__/bazel-out/x64_windows-opt-exec-2B5CBBC6/bin/external/com_google_protobuf/protoc.exe: error while loading shared libraries: libstdc++-6.dll: cannot open shared object file: No such file or directory
INFO: Elapsed time: 1.480s, Critical Path: 0.46s
INFO: 4 processes: 4 internal.
FAILED: Build did NOT complete successfully
Issue Description
When
protoc
is compiled with MinGW, it has a dependency onlibstdc++-6.dll
which is found (typically) inC:\msys64\mingw64\bin
.The only way an executable can find this DLL is by having
C:\msys64\mingw64\bin
in it'sPATH
, butrules_proto_grpc
runsprotoc
without passinguse_default_shell_env = True
which causes it to run with only the workspace root in thePATH
, preventinglibstdc++-6.dll
from being found.Issue can be reprocuced by running
bazel build --compiler=mingw-gcc //...
in theexample/c/c_proto_compile
directory on Windows, with MinGW installed.Log Output
rules_proto_grpc Version
master
Bazel Version
5.0.0
OS
Windows 10
Link to Demo Repo
https://github.com/rules-proto-grpc/rules_proto_grpc/tree/master/example/c/c_proto_compile
WORKSPACE Content
No response
BUILD Content
No response
Proto Content
No response
Any Other Content
No response
The text was updated successfully, but these errors were encountered: