Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find libstdc++-6.dll with MinGW #181

Closed
jesseschalken opened this issue Mar 14, 2022 · 0 comments · Fixed by #182 or #178
Closed

Cannot find libstdc++-6.dll with MinGW #181

jesseschalken opened this issue Mar 14, 2022 · 0 comments · Fixed by #182 or #178
Labels
bug Something isn't working resolved-next-release Code to resolve issue is pending release

Comments

@jesseschalken
Copy link
Contributor

Issue Description

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working resolved-next-release Code to resolve issue is pending release
Projects
None yet
2 participants