Commit graph

81347 commits

Author SHA1 Message Date
Ronald Braunstein
eefca7373c Merge "Test_Module_Config soong implementation" into main 2024-03-06 04:08:23 +00:00
Treehugger Robot
c2599194ee Merge "enable exportable check" into main am: d3a0ea94ba
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2989053

Change-Id: Icf264db1cc4aec61b4a28bb35ca1a06d7a0f05d8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-06 01:48:48 +00:00
Treehugger Robot
d3a0ea94ba Merge "enable exportable check" into main 2024-03-06 01:10:49 +00:00
Ronald Braunstein
fce431652d Test_Module_Config soong implementation
New soong module type `TestModuleConfig`

This module type allows to write:
   test_module_config {
    name: "DerivedFrameworks1",
    base: "FrameworksServicesTests",
    include_filters: ["com.android.server.accessibility.FingerprintGestureDispatcherTest"],
  }

This goal is to put the test options (include_fitler in this case) in
Android.bp rather than TEST_MAPPING to be able to name a set of options
and to allow the CI to more precise about which part of a TestModule
might be failing.
In general, it is recommended to split up tests rather than use this
approach, but that isn't always feasible.

More details on project here:  https://docs.google.com/document/d/1MpA4BS6mTr-1D-K9MVmzdHkSufAvIkkM4gPEUglNodk/edit?tab=t.0
Migration plan here: https://docs.google.com/document/d/1x3w-BvKO3E-GbY8YOSBuzJC6-pkLkuhfjSyZ1hJQBYM/edit?tab=t.0

Some details of final output:

   * All the [data] files from Derived are the same as base.
   * The apk names is changed to be the Module name
   * The test options are added to .config file
   * test-file-name in the .config file (for base.apk) is changed to be
     new apk.
   * module-info.json is hand inspected between base and derived.
   * I added a .manifest file so future tools know what base is, if they
     need it.

We are working a mechanism to use a CAS so the zip of the testcases
won't explode. (however the trident disk image will get bigger)

% tree -ls out/target/product/shiba/testcases/DerivedFrameworks1 out/target/product/shiba/testcases/FrameworksServicesTests
[       4096]  out/target/product/shiba/testcases/DerivedFrameworks1
├── [       4096]  arm64
│   └── [   72346281]  DerivedFrameworks1.apk
├── [      20887]  BstatsTestApp.apk
├── [       4096]  data
│   └── [        851]  broken_shortcut.xml
├── [       3157]  DerivedFrameworks1.config
├── [      12695]  JobTestApp.apk
├── [       8599]  MediaButtonReceiverHolderTestHelperApp.apk
├── [      16791]  SimpleServiceTestApp1.apk
├── [      16791]  SimpleServiceTestApp2.apk
├── [      16791]  SimpleServiceTestApp3.apk
├── [    1017540]  SuspendTestApp.apk
└── [         36]  test_module_config.manifest

[       4096]  out/target/product/shiba/testcases/FrameworksServicesTests
├── [       4096]  arm64
│   └── [   72346281]  FrameworksServicesTests.apk
├── [      20887]  BstatsTestApp.apk
├── [       4096]  data
│   └── [        851]  broken_shortcut.xml
├── [       2866]  FrameworksServicesTests.config
├── [      12695]  JobTestApp.apk
├── [       8599]  MediaButtonReceiverHolderTestHelperApp.apk
├── [      16791]  SimpleServiceTestApp1.apk
├── [      16791]  SimpleServiceTestApp2.apk
├── [      16791]  SimpleServiceTestApp3.apk
└── [    1017540]  SuspendTestApp.apk

Fixes: 314148134
Test: atest DerivedFrameworks1 DerivedFrameworks2
Test: m blueprint_tests
Change-Id: Ib73a3404557e0bd583b065f0cf2fd55fba9ccdbe
2024-03-06 00:38:56 +00:00
Treehugger Robot
b51fb7c159 Merge changes from topic "revert-2929615-JHGJGJFRRX" into main am: dc2b51f2ba
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2989230

Change-Id: I9bf6b80eb908a98617bfbd32357874bf48b9b897
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-05 23:38:51 +00:00
Jihoon Kang
05b152f271 Revert "Generate runtime stubs in droidstubs" am: d40c591487
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2989229

Change-Id: I5ec47c526dc411dea82104a91b61857e30d3c11f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-05 23:38:46 +00:00
Treehugger Robot
dc2b51f2ba Merge changes from topic "revert-2929615-JHGJGJFRRX" into main
* changes:
  Revert "Additional cleanup prior to adding the runtime stubs"
  Revert "Generate runtime stubs in droidstubs"
2024-03-05 22:55:29 +00:00
Zhi Dou
e11319d466 enable exportable check
If a library is built to mode exported, the flag declaration has to be
set with exportable true. The reason for this requirement is only flags
in the exportabel declarations will be repackaged. To prevent forgetting
adding this attribute, this exportable attribute is required to be set
for all exportable declarations.

Test: m
Bug: 310504781
Change-Id: I3ddafe0b212dabe86aa5000b1b76c7c412acc93c
2024-03-05 22:21:03 +00:00
Jihoon Kang
a11d679da2 Revert "Additional cleanup prior to adding the runtime stubs"
Revert submission 2929615

Reason for revert: b/328225000

Reverted changes: /q/submissionid:2929615

Merged-In: I29c605adb9401c9cb8b58646f2ae7b53b9a758e9
Change-Id: I29c605adb9401c9cb8b58646f2ae7b53b9a758e9
2024-03-05 21:34:18 +00:00
Jihoon Kang
d40c591487 Revert "Generate runtime stubs in droidstubs"
Revert submission 2929615

Reason for revert: b/328225000

Reverted changes: /q/submissionid:2929615

Merged-In: Ifbec11417103c96b37a4da18dfc9fda73f654d8f
Change-Id: Ifbec11417103c96b37a4da18dfc9fda73f654d8f
2024-03-05 21:27:53 +00:00
Colin Cross
1d3f590346 Reverse order of transitive R.jar classpath entries
Reverse the order of transitive R.jar classpath entries so that
the R.jar from the current module comes first, and so that R.jar
from any direct dependency comes before the R.jar of any transitive
dependencies through the direct dependency.  Also swap the order of
shared and static dependencies so that static dependencies come first
in the final classpath.

Bug: 294256649
Test: m javac-check
Test: TestAndroidResourceProcessor
Change-Id: Id9ea5b53ca563f79d0a25fb52b24552dbea70605
2024-03-05 11:51:54 -08:00
Hsin-Yi Chen
890e7722e7 Allow PrevVendorApiLevel to be less than 34
Some developers need to set VendorApiLevel to 34. Though the
configuration is not officially supported, the ABI checker supports it
on a best-effort basis.

Test: make
Bug: 320347314
Change-Id: Ic3f5ea2028329f5d04606760b07947b7c98b2e51
2024-03-05 15:56:44 +08:00
Spandan Das
cbebb3437d Support partial module variants with apex_contributions am: 972917d794
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2978138

Change-Id: Ifc2ffd8b9cccf2151fd11e2111afb00912f91746
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-04 10:28:28 +00:00
Spandan Das
d1816e09f0 Fix non-determinism in prebuilt selection am: f2c1057586
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2984036

Change-Id: Id4f52ec49aad78751373840c6e1dc252990db0f1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-04 10:07:19 +00:00
Spandan Das
5d7d4ba90b Merge changes I177441bc,I32daefbd into main am: 1c96fab7d0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2984038

Change-Id: I567f1873fefdb987776f544e755220cdbea5a97f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-04 08:41:18 +00:00
Spandan Das
972917d794 Support partial module variants with apex_contributions
Some libraries like `libnativehelper_compat_libc++` only exist as shared
library in module sdk. When prebuilt of this library is selected using
apex_contritbutions, only shared linkages should be redirected to the
prebuilt version. The static linkage should come from source.

Test: Added a unit test
Bug: 322175508

Change-Id: Ic65d376b2354b4a42c7b9ea3ed1cd80c37e2840f
2024-03-04 08:39:20 +00:00
Spandan Das
f2c1057586 Fix non-determinism in prebuilt selection
This relands aosp/2978137 with acknowledgement of soong namespaces.

If multiple versions of the prebuilt module sdk share the same soong
config namespace, then PrebuiltPostDepsMutator rewrites rdeps to one of
those prebuilts in a non-deterministic way.

This CL uses apex_contributions to make this deterministic. Multiple
prebuilts will not be allowed to have their prefer evaluate to true. If
this happens, one of the prebuilts must be explicitly declared in
apex_contributions.

This CL also fixes the special-casing of the top-level
java_sdk_library_import in ReplaceDirectDependencies. For
framework-foo.v2, it will use BaseModuleName framework-foo instead of
SdkLibraryName framework-foo.v2 to determine if the source module has
been selected.

Test: ran the previously failing cmd of b/327552112
Test: Added a unit test
Test: aninja -t query
    out/soong/.intermediates/packages/modules/Permission/SafetyCenter/Config/safety-center-config/android_common/javac/safety-center-config.jar
    | grep module_sdk is empty (should not cause a regression for
    323454855)
Change-Id: Id484a41192085c50b7e34ad415c6e195edb0d006
2024-03-04 07:59:34 +00:00
Spandan Das
1c96fab7d0 Merge changes I177441bc,I32daefbd into main
* changes:
  Use BaseModuleName for LOCAL_MODULE
  Disable source javalib dexpreopt when using prebuilt apex
2024-03-04 07:59:06 +00:00
Spandan Das
614a6f2b41 Use BaseModuleName for LOCAL_MODULE
This CL uses OverrideName to ensure that the LOCAL_MODULE does not
contain any version information.

Test: Created CaptiveLoginPortalGoogle.v2, and checked that its
LOCAL_MODULE is CaptiveLoginPortalGoogle

Change-Id: I177441bcd55ca538759b69aafb73d0a8b7261179
2024-03-04 07:57:59 +00:00
Spandan Das
a8afdcb307 Disable source javalib dexpreopt when using prebuilt apex
The apex_contributions in next builds use prebuilt apexes with source
java_sdk_library for javac. The dexpreopt rules of the source
java_sdk_library are disabled via
RELEASE_DEFAULT_MODULE_BUILD_FROM_SOURCE coupled with some complicated
special-casing in android/prebuilt.go

This special-casing breaks if we want to use prebuilts of some modules,
and sources of other modules. To enable per mainline module
toggelability, explicitly disable dexpreopt of source variant of
java_sdk_library if we use prebuilt of the containing apex.

Test: In internal, updated trunk_staging.scl's
RELEASE_APEX_CONTRIBUTIONS_ADSERVICES to use prebuilt followed by m
nothing

Change-Id: I32daefbd38338b396d6f07b899826b2869d8f8e1
2024-03-04 07:57:59 +00:00
Stephen Hines
7180b3caa6 Merge "Allow clippy::disallowed_names since it can be used for debugging" into main am: 0684c5fc11
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2984234

Change-Id: I60e3c13929bc8415fe9043826c39ff285374817b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-01 01:41:39 +00:00
Stephen Hines
0684c5fc11 Merge "Allow clippy::disallowed_names since it can be used for debugging" into main 2024-03-01 00:51:07 +00:00
Treehugger Robot
308388d2fa Merge "Add the build flags for apex contribution contents" into main am: e9f270a61f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2982634

Change-Id: I26305a22b59823db84b225850be812e4249110a8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-01 00:13:48 +00:00
Treehugger Robot
e9f270a61f Merge "Add the build flags for apex contribution contents" into main 2024-02-29 23:34:15 +00:00
Ryan Prichard
4e2594e20a Merge changes I34385c48,I1e48947c into main am: 45ac47edab
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2983535

Change-Id: I223f80828e80829d151fa9dd599ac0ecfee9858b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-29 20:58:14 +00:00
Treehugger Robot
33f110f428 Merge "Remove --multitree-build" into main am: 7c8cf91ff8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2982507

Change-Id: I86c17fc27621ce32ebf555ba4c2222b1ad4c0dec
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-29 20:57:56 +00:00
Ryan Prichard
45ac47edab Merge changes I34385c48,I1e48947c into main
* changes:
  disablePrebuilt: also clear sanitizer-dependent Srcs
  Define libc++ config macros to nothing
2024-02-29 20:51:48 +00:00
Treehugger Robot
7c8cf91ff8 Merge "Remove --multitree-build" into main 2024-02-29 20:13:48 +00:00
Colin Cross
d2820e81aa Merge "Use R.txt files from aar files directly" into main am: 4b6a3ae65c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2980833

Change-Id: I2f91f88d0d347e598ddda2dbbeb67b4fc9d19da6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-29 19:33:27 +00:00
Colin Cross
8b64ad9506 Merge changes I8d060594,I2b6a57ae into main am: 5d55b66861
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2980832

Change-Id: If904b08b58a76b4d82ca3926e4d23d89ffcc588f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-29 19:33:08 +00:00
Colin Cross
4b6a3ae65c Merge "Use R.txt files from aar files directly" into main 2024-02-29 18:55:17 +00:00
Colin Cross
5d55b66861 Merge changes I8d060594,I2b6a57ae into main
* changes:
  Put extraCombinedJars after the compiled jars
  Use RSP file for long classpaths
2024-02-29 18:46:46 +00:00
Stephen Hines
5f8dae514b Allow clippy::disallowed_names since it can be used for debugging
https://rust-lang.github.io/rust-clippy/master/index.html#/disallowed_names

The current list is extremely short ("foo", "baz", "quux"), and thus
this really just prevents people from temporarily using `foo` to debug
code. In the spirit of improving productivity and reducing frustration,
it's easier to just allow this.

Bug: N/A
Test: TH
Change-Id: I50b65486ed2b58bfd2cf699ee3b43b936d25f2cb
2024-02-29 10:12:19 -08:00
Yu Liu
4782aa50bf Merge "Some tweaks to the aconfig flag collection logic" into main am: 6c2cd90232
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2983533

Change-Id: I3bc2f231c2b13fa716d01c7bbbabd96fb280ebc0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-29 18:05:53 +00:00
Spandan Das
1e9810748e Merge "Revert "Fix non-determinism in prebuilt selection"" into main am: 5354483c12
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2984372

Change-Id: I5c759faa655a3fa81f68ffbdb42dfb70ea4d22e6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-29 18:05:11 +00:00
Yu Liu
6c2cd90232 Merge "Some tweaks to the aconfig flag collection logic" into main 2024-02-29 17:55:53 +00:00
Spandan Das
5354483c12 Merge "Revert "Fix non-determinism in prebuilt selection"" into main 2024-02-29 17:49:45 +00:00
Spandan Das
85437f2901 Add a source_module_name to android_app am: efa146577f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2982635

Change-Id: I86d01156c103b3fc08f105d2890c9882f5fdeb57
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-29 17:45:16 +00:00
Spandan Das
06c64f0f12 Add the build flags for apex contribution contents
This will be used for source vs prebuilt selection of Google apps

Test: go build ./android
Bug: 326995930

Change-Id: Idb535c468534ed691431315edcf7a279024dc7f1
2024-02-29 15:36:20 +00:00
Spandan Das
efa146577f Add a source_module_name to android_app
For multiple mainline prebuilts, we will have multiple versioned
prebuilt apps in the tree. The soong name of these prebuilts will have a
version prefix to prevent name collisions (e.g. MyGoogleApp.v2).

This CL introduces a source_module_name property in android_app_imoprt.
This property will be used for the following
1. Determining installation path. This should be
/system/app/MyGoogleApp/MyGoogleApp.apk
and not
/system/app/MyGoogleApp.v2/MyGoogleApp.apk
(filename prop determines the filename and not the dir name)

2. Preventing duplicate installation rules: This property will be used
   to create a dependency to the source app, and call HideFromMake on
   all the unflagged apps

Test: presubmits
Test: locally # Created CaptivePortalLoginGoogle.v2 and selected it
using one of the RELEASE_APEX_CONTRIBUTION_* flags

Bug: 326995930
Change-Id: If4ab9f9bd295117c96eb062cf3b3d2efc8bfed12
2024-02-29 14:33:16 +00:00
Sorin Basca
5a2e36b755 Switch to JDK 21
Bug: 313924276
Test: n
Change-Id: Ia9682181a6ce35ed0102d60bf7df1def8f876fd0
2024-02-29 11:44:09 +00:00
Spandan Das
af66212522 Revert "Fix non-determinism in prebuilt selection"
This reverts commit 2d8884a377.

Reason for revert: Build breakage https://groups.google.com/a/google.com/g/android-build-police-core/c/00mM-B9unVg/m/0FxBxpMbAwAJ. The validation does not check for namespace isolation which breaks libtonemap

Change-Id: Ieb4d3bc4f3ade856877ebb62a567620f5a1ed08c
2024-02-29 08:57:08 +00:00
Spandan Das
abd735bb6c Fix non-determinism in prebuilt selection am: 2d8884a377
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2978137

Change-Id: I4a4d775e19657dbd33ddd2017c40c8651315db3d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-29 07:13:36 +00:00
Spandan Das
2d8884a377 Fix non-determinism in prebuilt selection
If multiple versions of the prebuilt module sdk share the same soong
config namespace, then PrebuiltPostDepsMutator rewrites rdeps to one of
those prebuilts in a non-deterministic way.

This CL uses apex_contributions to make this deterministic. Multiple
prebuilts will not be allowed to have their prefer evaluate to true. If
this happens, one of the prebuilts must be explicitly declared in
apex_contributions.

This CL also fixes the special-casing of the top-level
java_sdk_library_import in ReplaceDirectDependencies. For
framework-foo.v2, it will use BaseModuleName framework-foo instead of
SdkLibraryName framework-foo.v2 to determine if the source module has
been selected.

Test: Added a unit test
Test: aninja -t query
    out/soong/.intermediates/packages/modules/Permission/SafetyCenter/Config/safety-center-config/android_common/javac/safety-center-config.jar
    | grep module_sdk is empty (should not cause a regression for
    323454855)

Bug: TODO
Change-Id: I7191200c330c5bcb9d5532006d3c573a60db61cc
2024-02-29 06:34:49 +00:00
Ryan Prichard
21e2c10cd2 disablePrebuilt: also clear sanitizer-dependent Srcs
The new libc++ prebuilt has HWASan and non-HWASan variants for arm64.

Bug: 175635923
Test: checkout use-prebuilt-libcxx topic, build libc++demangle, verify
  that libc++demangle-install is not a valid build target

Change-Id: I34385c48aa7ad1401e2547d65d30a14fa342e304
2024-02-28 19:14:59 -08:00
Ryan Prichard
718cf5bf19 Define libc++ config macros to nothing
libc++[abi] always check whether one of these macros is defined, not
the value the macro is defined to. With the new libc++, there is a
Windows __config_site header that automatically defines
_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS and _LIBCPP_HAS_THREAD_API_WIN32
to nothing, so these definitions need to match to avoid a redefinition
error.

Bug: 175635923
Test: treehugger
Test: m adb
Change-Id: I1e48947c3b45e59804cdacd48776c7f3bd9a18c6
2024-02-28 19:14:24 -08:00
Inseob Kim
224ac62ba8 Merge "Sort jarjar rename keys before using" into main am: 688f824e1a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2981731

Change-Id: I18ade8539893ac793663217f47c786e76f5a2aff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-29 01:44:15 +00:00
Inseob Kim
688f824e1a Merge "Sort jarjar rename keys before using" into main 2024-02-29 01:04:40 +00:00
Cole Faust
331b27f511 Remove --multitree-build
Multitree has been discontinued.

Test: m nothing --no-skip-soong-tests
Change-Id: Ie4d96a11279bf0f20a5e1a49837d9df4b24b1662
2024-02-28 15:35:49 -08:00
Jihoon Kang
04338c8ae2 Merge "Enable non-"everything" stubs generation in java_api_library" into main am: 641bd9daee
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2977092

Change-Id: I91772243047e96a6144134694f2038878ed7b0ea
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-02-28 22:50:53 +00:00