Skip to content

Commit f6f27a8

Browse files
keithhlopko
andauthored
Add workaround for arm vs armv7 android issue (bazelbuild#1259)
When building for the armv7 android target, we would ideally specify a cpu:armv7 constraint, but because of the linked bazel issue this is currently hardcoded as arm in bazel's NDK setup. As far as I can tell the platform we request for use with rules rust has to match the constraints in bazel, otherwise it won't discover the NDK CC toolchain for linking. Co-authored-by: Marcel Hlopko <[email protected]>
1 parent c3f56c2 commit f6f27a8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

rust/platform/triple_mappings.bzl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,13 @@ def triple_to_constraint_set(target_triple):
269269
"@rules_rust//rust/platform/os:unknown",
270270
]
271271

272+
# Workaround for https://github.com/bazelbuild/bazel/issues/14982
273+
if target_triple in ("armv7-linux-androideabi", "thumbv7neon-linux-androideabi"):
274+
return [
275+
"@platforms//cpu:arm",
276+
"@platforms//os:android",
277+
]
278+
272279
triple_struct = triple(target_triple)
273280

274281
constraint_set = []

0 commit comments

Comments
 (0)