Skip to content

Commit

Permalink
Respect cpu_filters when building android_bundle
Browse files Browse the repository at this point in the history
Summary:
- The config option ndk.cpu_abis is respected for `android_binary` but not for `android_bundle` rules.
- See, for example, [this](https://www.internalfb.com/sandcastle/workflow/108086391073577717) job. Even though the [command](https://www.internalfb.com/buck2/0847e062-dc3e-4765-beae-21f078a348ea) specifies `"ndk.cpu_abis=x86_64,arm64"` the result `.aab` file contains native libraries for all archs.
- Fixing it makes CI use less resources and also unblocks [Superpack Refactor](https://docs.google.com/document/d/1qvzjet6INgQ0MOLQ51mtBOtqVika5gwBrrt1pM18FFo/edit#heading=h.hl2mvf2l7sum) effort for WAAndroid

Reviewed By: IanChilds

Differential Revision: D63561933

fbshipit-source-id: 18c59a396343a0b3f4a06916ca91dddc6eb88c84
  • Loading branch information
Arsen Tumanyan authored and facebook-github-bot committed Sep 30, 2024
1 parent 87793db commit 97858e2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions prelude/native.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,14 @@ def _android_binary_macro_stub(
**kwargs
)

def _android_bundle_macro_stub(
cpu_filters = None,
**kwargs):
__rules__["android_bundle"](
cpu_filters = _get_valid_cpu_filters(cpu_filters),
**kwargs
)

def _android_instrumentation_apk_macro_stub(
cpu_filters = None,
primary_dex_patterns = [],
Expand Down Expand Up @@ -447,6 +455,7 @@ def _prebuilt_apple_framework_macro_stub(**kwargs):
__extra_rules__ = {
"android_aar": _android_aar_macro_stub,
"android_binary": _android_binary_macro_stub,
"android_bundle": _android_bundle_macro_stub,
"android_instrumentation_apk": _android_instrumentation_apk_macro_stub,
"apple_binary": _apple_binary_macro_stub,
"apple_bundle": _apple_bundle_macro_stub,
Expand Down

0 comments on commit 97858e2

Please sign in to comment.