Commit graph

81365 commits

Author SHA1 Message Date
Sorin Basca
b832ae19d8 Revert "Switch to JDK 21"
This reverts commit 5a2e36b755.

Reason for revert: Preparing revert to have it ready in case of breakages relating to using JDK 21.

Change-Id: I153c4933f6891c7fff43e522a4d128acad6b6d47
2024-03-07 21:22:00 +00:00
Treehugger Robot
092c3a56fb Merge "Switch to JDK 21" into main 2024-03-07 19:36:28 +00:00
Yu Liu
a58467ae9a Store the changed_inputs field in build.trace.
Bug: 323021988
Test: Manual tests
Change-Id: If5e060d13f7935ced28d556ab248f2b1e6bdb61d
2024-03-07 18:54:37 +00:00
Cole Faust
256cfbee24 Remove starlark_import
This is no longer used since the roboleaf cancellation.

Bug: 315353489
Test: m nothing --no-skip-soong-tests
Change-Id: Ie6ee093c2810498306ea4a2288050eed17a35357
2024-03-07 10:53:41 -08:00
Yu Liu
67a28425a7 Validate aconfig libs are built with the correct modes.
Bug: 323071835
Test: Unit tests and manual tests.
Change-Id: I32de90826c7c8bb4d8495608e959d554820ab9a2
2024-03-07 18:51:16 +00:00
Zi Wang
5ae58dcabe Merge "Add property Skip_jarjar_repackage" into main 2024-03-07 17:44:36 +00:00
Cole Faust
fb8356c4c0 Merge "Replace starlark_import with hardcoded map" into main 2024-03-07 17:39:35 +00:00
Cole Faust
140180dd5b Merge "Select statements" into main 2024-03-07 17:39:27 +00:00
Yi Kong
ce23b9ba16 Enable full LTO optimization by default
We set the default optimization mode to --lto-O0 for LTO enabled
projects, in order to save build time. This is missing some performance
optimizations, esp. related to vectorization. Now that we suggest eng
build for developers, we can enable full optimization by default.

When we introduced --lto-O0, we achieved a 4.2% saving in
system-processes-memory-direct. Enabling full LTO optimization will
trade some of the memory / binary size savings for better code
performance. For system-processes-memory-direct, it is 2.0% increase
compared to --lto-O0, or a net 2.2% saving compared to baseline.

Test: presubmit
Bug: 328163089
Change-Id: Ia4d0f74e668ed057d6d9d6fc6c60196c2e355fb9
2024-03-07 07:02:45 +00:00
Xin Li
08bef285d8 Merge "Merge Android 14 QPR2 to AOSP main" into main 2024-03-07 06:41:10 +00:00
Treehugger Robot
a7ee3e0482 Merge "Reverse order of transitive R.jar classpath entries" into main 2024-03-07 00:50:53 +00:00
Cole Faust
5a231bd819 Select statements
See the blueprint cl for more information.

Things still to do:
 - Support selecting on product variables and
   variants
 - Test/Support property struct reflection tags
   like arch_variant, path, and variant_prepend
 - Test that selects combine well with existing
   configurability mechanisms like arch:, target:,
   multilib:, python's version:, etc.

Bug: 323382414
Test: go tests
Change-Id: If5d1ea1ad0c4ebabffaea91d62e1a1c6f926a793
2024-03-06 16:03:01 -08:00
Cole Faust
37bfb07722 Replace starlark_import with hardcoded map
With roboleaf being cancelled, we don't need the api levels to be
present in starlark.

Bug: 315353489
Test: Presubmits
Change-Id: I21ea61ced00a5b0ae066a9ca99a88a512bf115ac
2024-03-06 15:59:18 -08:00
Andus Yu
c917eb8207 Make sure RBE socket address is under character limit
Check that socket address paths are less than the character limit - 2 since absolute paths are prefixed with //, which is included in the character limit.

b/308986536

Change-Id: I3055b8bb8cdae00aafd66c51fdc8421b9cc5f21f
2024-03-06 21:54:57 +00:00
Zi Wang
4332cd1cae Add property Skip_jarjar_repackage
If this property is set to true on a module, this module will
not have jarjar repackaging.

Test: CI
Bug: 327009143
Ignore-AOSP-First: Will cp to aosp
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:9bdd4228cb959d46a60610f3b0eb9b52b95a73ad)
Merged-In: I9384c9c25ce581ac00d309a188cf7533eb2e44a6
Change-Id: I9384c9c25ce581ac00d309a188cf7533eb2e44a6
2024-03-06 18:58:05 +00:00
Spandan Das
471d068893 Add defaults support for apex_contributions module type
Bug: 326246905
Test: go build ./android

Change-Id: I8be21594465d81c99c216b0fcbf9996aed46c209
2024-03-06 17:41:04 +00:00
Xin Li
7e46832a1c Merge Android 14 QPR2 to AOSP main
Bug: 319669529
Merged-In: I0b63516865233df0bf125a2ee4098769a8991ecd
Change-Id: Ib1f0f88fd2a20a695c749b228bda0002fcbc3331
2024-03-06 09:29:45 -08:00
Ronald Braunstein
88763e8e40 Merge "Test_Module_Config soong implementation" into main am: eefca7373c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2947425

Change-Id: I0b63516865233df0bf125a2ee4098769a8991ecd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-03-06 04:40:42 +00:00
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