select need be able to recognise exec_compatible_with and target_compatible_with
See original GitHub issueDescription 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
platform(
name = "linux_gcc11_aarch64_none_musleabi",
constraint_values = [
"@platforms//cpu:aarch64",
"@platforms//os:linux",
":gcc_11",
":musleabi",
],
)
toolchain defined by myself:
toolchain(
name = "gcc11_arm_aarch64_none_gnueabi_xcompile_toolchain",
exec_compatible_with = [
"@platforms//cpu:x86_64",
"@platforms//os:linux",
],
target_compatible_with = [
"@platforms//cpu:aarch64",
"@platforms//os:linux",
"//platforms:gcc_11",
"//platforms:gnueabi",
],
toolchain = "@gcc11_arm_aarch64_none_gnueabi//:cc_toolchain",
toolchain_type = "@bazel_tools//tools/cpp:toolchain_type",
)
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:
- rules_proto choose protoc by detect host platform, not by select
- make bazel compitable with this situation, I think select should be able to recogise exec_compatible_with and target_compatible_with
alias(
name = "protoc",
actual = select({
":linux-aarch64": "@com_google_protobuf_protoc_linux_aarch64//:protoc",
":linux-ppc": "@com_google_protobuf_protoc_linux_ppc//:protoc",
":linux-s390x": "@com_google_protobuf_protoc_linux_s390_64//:protoc",
":linux-x86_32": "@com_google_protobuf_protoc_linux_x86_32//:protoc",
":linux-x86_64": "@com_google_protobuf_protoc_linux_x86_64//:protoc",
":macos-aarch64": "@com_google_protobuf_protoc_macos_aarch64//:protoc",
":macos-x86_64": "@com_google_protobuf_protoc_macos_x86_64//:protoc",
":windows-x86_32": "@com_google_protobuf_protoc_windows_x86_32//:protoc",
":windows-x86_64": "@com_google_protobuf_protoc_windows_x86_64//:protoc",
"//conditions:default": "@com_github_protocolbuffers_protobuf//:protoc",
}),
visibility = ["//visibility:public"],
)
Issue Analytics
- State:
- Created a year ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
Allow selecting different python paths for different platforms
We want to be able to have python interpreters in different paths ... If I just annotate the py_binary with an exec-compatible-with to...
Read more >Platforms | Bazel
Multi-platform builds - host, execution, and target platforms are all different. Defining constraints and platforms. The space of possible ...
Read more >Compositional Verification of Relaxed-Memory Program ...
is paper is about verifying program transformations on an axiomatic relaxed memory model of the kind used in C/C++ and Java.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sgowroji This issue belongs to the configurability team
Closing as stale. Please reopen if you’d like to work on this further.