aboutsummaryrefslogtreecommitdiff
path: root/rules/apex/apex_aab.bzl
diff options
context:
space:
mode:
authorCole Faust <colefaust@google.com>2023-03-21 12:09:34 -0700
committerCole Faust <colefaust@google.com>2023-03-22 17:06:42 -0700
commit8f2368eb192c28e98e35eb014b0b2ee9cf416e70 (patch)
treebfea7f4642f889105cca078b62594a81ee566cae /rules/apex/apex_aab.bzl
parente8a8c9b8bfffe7200da375880b10ebb26f541756 (diff)
downloadbazel-8f2368eb192c28e98e35eb014b0b2ee9cf416e70.tar.gz
Make the secondary arch into a constraint setting
Currently, apex rules read the secondary arch directly from the soong.variables file, which means that when transitioning into a different product, the new secondary arch wouldn't be picked up. Instead, make the secondary arch its own constraint setting/values. One hiccup with this is that it's not really clear what to do when there is no secondary arch. I think that making a "none" constraint value might introduce more confusing behavior / edge cases, so instead I decided to make the secondary arch match the primary arch when it doesn't exist. The platform utils will convert it back to an empty string to match the soong.variables behavior. Bug: 269577299 Test: Diffed the result of `b build --config=android //build/bazel/vendor/google:build.bazel.examples.apex.minimal_apex_aab` before and after this cl. For some reason there is a diff in the apex.pb file in the aab, but it's just differences in the order of fields: https://diff.googleplex.com/#key=7rKBCiPxby9p Change-Id: Ifc41045feef9d05691cf49bcfc1b1c2fac15177e
Diffstat (limited to 'rules/apex/apex_aab.bzl')
-rw-r--r--rules/apex/apex_aab.bzl12
1 files changed, 2 insertions, 10 deletions
diff --git a/rules/apex/apex_aab.bzl b/rules/apex/apex_aab.bzl
index 8550c937..258e7ea6 100644
--- a/rules/apex/apex_aab.bzl
+++ b/rules/apex/apex_aab.bzl
@@ -35,28 +35,22 @@ def _arch_transition_impl(settings, _attr):
return {
# these key names must correspond to mainline_modules_<arch> product name suffixes.
"arm": {
- "//build/bazel/rules/apex:device_secondary_arch": "",
"//command_line_option:platforms": old_platform + "__internal_arm",
},
"arm64": {
- "//build/bazel/rules/apex:device_secondary_arch": "arm",
"//command_line_option:platforms": old_platform + "__internal_arm64",
},
"arm64only": {
- "//build/bazel/rules/apex:device_secondary_arch": "", # don't include arm libs
- "//command_line_option:platforms": old_platform + "__internal_arm64",
+ "//command_line_option:platforms": old_platform + "__internal_arm64only",
},
"x86": {
- "//build/bazel/rules/apex:device_secondary_arch": "",
"//command_line_option:platforms": old_platform + "__internal_x86",
},
"x86_64": {
- "//build/bazel/rules/apex:device_secondary_arch": "x86",
"//command_line_option:platforms": old_platform + "__internal_x86_64",
},
"x86_64only": {
- "//build/bazel/rules/apex:device_secondary_arch": "", # don't include x86 libs
- "//command_line_option:platforms": old_platform + "__internal_x86_64",
+ "//command_line_option:platforms": old_platform + "__internal_x86_64only",
},
}
@@ -65,11 +59,9 @@ arch_transition = transition(
implementation = _arch_transition_impl,
inputs = [
"//command_line_option:platforms",
- "//build/bazel/rules/apex:device_secondary_arch",
],
outputs = [
"//command_line_option:platforms",
- "//build/bazel/rules/apex:device_secondary_arch",
],
)