request support use bazel cross compile for arm with --incompatible_enable_cc_toolchain_resolution option
xiedeacc opened this issue · comments
xiedeacc commented
my project import grpc 1.47.0, build will fail when cross compile for arm use bazel with --incompatible_enable_cc_toolchain_resolution option
error log:
ERROR: /root/.cache/bazel/_bazel_root/212dd51f8d897b720cf9b65a010c79c8/external/com_github_protocolbuffers_protobuf/BUILD:387:15: Generating Descriptor Set proto_library @com_github_protocolbuffers_protobuf//:descriptor_proto failed: (Exit 2): protoc.exe failed: error executing command bazel-out/k8-opt-exec-A1C23A69/bin/external/com_google_protobuf_protoc_linux_aarch64/protoc.exe ... (remaining 7 arguments skipped)
Use --sandbox_debug to see verbose messages from the sandbox and retain the sandbox build root for debugging
bazel-out/k8-opt-exec-A1C23A69/bin/external/com_google_protobuf_protoc_linux_aarch64/protoc.exe: 1:ELF▒▒A@▒▒@8: not found
bazel-out/k8-opt-exec-A1C23A69/bin/external/com_google_protobuf_protoc_linux_aarch64/protoc.exe: 1: Syntax error: word unexpected (expecting ")")
INFO: Elapsed time: 205.323s, Critical Path: 4.62s
INFO: 67 processes: 60 internal, 7 linux-sandbox.
FAILED: Build did NOT complete successfully
build command:
clear && bazel build --incompatible_enable_cc_toolchain_resolution --platforms=@bazel_build_file//platforms:linux_gcc11_aarch64_none_musleabi -s --copt=-g3 --strip=never //...
xiedeacc commented
I found out protoc.exe generated for arm, not for host linux x86_64, so I think grpc not recognised it's a cross compilation, grpc may not recognise below option
--incompatible_enable_cc_toolchain_resolution --platforms=@bazel_build_file//platforms:linux_gcc11_aarch64_none_musleabi
it's grpc problem or I need specify other option to make it correct?
Yash Tibrewal commented
cc @jtattermusch
Jan, can you take a look please?
xiedeacc commented
@jtattermusch can you take a look?
xiedeacc commented
ask again @yashykt @jtattermusch @drfloob
xiedeacc commented
it's rules_proto problem or bazel has select defect