-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
select need be able to recognise exec_compatible_with and target_compatible_with #15847
Comments
@sgowroji This issue belongs to the configurability team |
Can I reproduce this on a linux device? I don't have an arm device handy. Can you provide a minimal reproduction repository with your toolchain available? To clarify, the issue is that you are building the protoc compiler from source, and it's being built for the target platform but then run on the execution platform, and that fails because you are cross-compiling? |
yes you're right, you can reproduce on a linux device |
If you have a small reproduction repo that I can clone that will help diagnose the issue. |
Unfortunately I can't work on this further without being able to reproduce it. I'm going to lower the priority and mark this as triaged until you can get back to us. |
@xiedeacc, We are marking the above Issue as stale because it has not had any recent activity from many days. |
Closing as stale. Please reopen if you'd like to work on this further. |
I would like to help with this, since we are affected as well. I use the precompiled What is the expectation for this (I'm on mac): BUILD.bazel:
Bazel command: $ bazel run @com_google_protobuf//:protoc --platforms //:linux_aarch64 --extra_execution_platforms //:macos_x86_64
....
/bin/bash: /private/var/tmp/_bazel_cfalcas/856dc74a4318774eeb1496e4c7291b94/execroot/com_etsy_search/bazel-out/darwin-fastbuild/bin/external/com_google_protobuf_protoc_linux_aarch64/protoc.exe: cannot execute binary file Same output for $ bazel run @com_google_protobuf//:protoc --platforms //:linux_aarch64 I'm expecting to run the protoc binary for the exec platform |
I believe the actual select is here |
I'm not sure Is this also a bug when protoc is invoked as part of an action? I'll re-open and take a look at this again, but I don't think the original request (select checks |
Also note that today is my last working day of the year, so I won't be looking at this again until January. |
no hurry, we just started working towards cross compiling I believe it's the same issue, because it's the same select as the OP, which returns the target platform. I'll make a repo with a rule to show the issue. About the $ bazel run @com_google_protobuf//:protoc --platforms //tools:linux_aarch64 --extra_execution_platforms //tools:macos_x86_64 --sandbox_debug
.....
/bin/bash: /private/var/tmp/_bazel_cfalcas/856dc74a4318774eeb1496e4c7291b94/execroot/com_etsy_search/bazel-out/darwin-fastbuild/bin/external/com_google_protobuf_protoc_linux_aarch64/protoc.exe: cannot execute binary file
$ file /private/var/tmp/_bazel_cfalcas/856dc74a4318774eeb1496e4c7291b94/execroot/com_etsy_search/bazel-out/darwin-fastbuild/bin/external/com_google_protobuf_protoc_linux_aarch64/protoc.exe
/private/var/tmp/_bazel_cfalcas/856dc74a4318774eeb1496e4c7291b94/execroot/com_etsy_search/bazel-out/darwin-fastbuild/bin/external/com_google_protobuf_protoc_linux_aarch64/protoc.exe: ELF 64-bit LSB executable, ARM aarch64, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=67bf1d2acddf41eab6f53c16a746eb8c4e681526, stripped Notice the |
Right, but the Windows subsystem that adds |
Ok, I found my "issue" and it's an issue at all, I was using the wrong config from rules_rust. And the Sorry for the noise |
Thanks for following up, I think this can be closed now. Feel free to comment or open a new issue as needed. |
Description of the feature request:
my project import rules_proto and grpc, when I cross compile for arm, rules_proto will choose a wrong platform protoc, host platform protoc expected but arm platform protoc choosed, but I think it's not rules_proto's bug, for:
my platforms value pass to bazel was
toolchain defined by myself:
rules_proto use select to decide use which platform protoc, cpu:x86_64 and os:linux from target_compatible_with will be recognised by rules_proto, so linux-aarch64 choosed, it's a wrong choice, it didn't recognise it's a cross compile. so I think there exists two way to solve this problem:
The text was updated successfully, but these errors were encountered: