3675 Commits

Author SHA1 Message Date
Spandan Das
3961bb8fb2 Merge "Remove prebuilt_apex_module_creator mutator" into main am: edefa90d42 am: faa827deee
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3277436

Change-Id: I7354bcbc135ac73577c4a35005e69c7507892fab
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-24 02:56:09 +00:00
Spandan Das
edefa90d42 Merge "Remove prebuilt_apex_module_creator mutator" into main 2024-09-24 01:49:31 +00:00
Chan Wang
6dbdccea4a Merge "Temporarily bypass apex availability check for /product apexes with a specific prefix" into main am: 3a9a37cc78 am: 880aa466bf
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3276271

Change-Id: I75a5c547cf1ce10dc099228539063da329797a69
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-23 23:13:41 +00:00
Spandan Das
1b0fddb015 Remove the internal extractor module created by apex_set am: 9d6e209f44 am: 5994600572
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3273164

Change-Id: Iac682fe1a9026f4075929adfd895913f1c3c567d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-23 23:13:07 +00:00
Spandan Das
bfa06e3d07 Remove the internal selector module created by prebuilt_apex am: e350e36e7b am: 4ecc11b560
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3273030

Change-Id: I9402d5ea32a0c460f3c26b9ba2da9fb5dc388d7e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-23 23:13:03 +00:00
Spandan Das
309a612c9f Remove prebuilt_apex_module_creator mutator
prebuilt apex modules no longer create internal modules, so this
mutator is not necessary.

Test: go build ./apex
Change-Id: I12c08b8f36efab8a9898341052b6f3cd26a0e803
2024-09-23 23:06:53 +00:00
Chan Wang
3a9a37cc78 Merge "Temporarily bypass apex availability check for /product apexes with a specific prefix" into main 2024-09-23 22:56:01 +00:00
Spandan Das
9e2377907d Merge changes I0edb681b,I0ea2327f into main am: e2860d9db6 am: c012f4ece4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3273493

Change-Id: Iaa74e0c7332c9a3e8a5180db3bac0abd7edc4318
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-23 21:18:32 +00:00
Chan Wang
490a6f9b76 Temporarily bypass apex availability check for /product apexes with a
specific prefix

Bug: 361501627

Test: m nothing --no-skip-soong-tests
Change-Id: Ifb855bed3514d27ecccddb5cd986537c628683b1
2024-09-23 21:11:09 +00:00
Spandan Das
9d6e209f44 Remove the internal extractor module created by apex_set
The build actions will be generated by the top-level apex.

Test: go test ./apex
Test: lunch cf_x86_64_phone-next-userdebug (uses mainline prebuilts)
Test: verified no diff in file_list.txt
Bug: 368337090
Change-Id: I170cf4beec18b54cd950560ea0991bc6f1455d76
2024-09-23 20:56:12 +00:00
Spandan Das
e350e36e7b Remove the internal selector module created by prebuilt_apex
Since the deapex actions have been moved to the top-level apex, this
internal module is no longer neessary.

Test: go test ./apex
Test: lunch cf_x86_64_phone-next-userdebug (uses mainline prebuilts)
Test: verified no diff in file_list.txt
Bug: 368337090

Change-Id: I53695e028a36a689fd1b026f5783de7d8567be76
2024-09-23 20:46:36 +00:00
Spandan Das
e2860d9db6 Merge changes I0edb681b,I0ea2327f into main
* changes:
  Remove internal deapexer module
  Remove deapex support from java_*_import
2024-09-23 20:28:36 +00:00
Jihoon Kang
2d404031e7 Merge changes Ica0cb5a5,If432cdc6,Idb4b0b0a into main am: 1a7d900c78 am: a7906c717c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3272004

Change-Id: I3893d25882248f645c37718793907b7a1a64f0f1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-23 18:21:01 +00:00
Spandan Das
52c01a1897 Remove internal deapexer module
The build ations will be created by the top-level apex.

Details
1. In GenerateAndroidBuildActions, do a graph walk to determine if the
   apex has exported deps.
2. If there are exported deps, call the newly introduced `deapex`
   function. This registers the build rules and returns a DeapexerInfo
object. This was previously provided by the internal deapexer
dependency.
3. Update `dexpreoptSystemServerJars and `provideApexExportsInfo` to use
   the DeapexerInfo object from (2).

A lot of unit tests that relied on the legacy mechanism of deapexing
have been updated.

Test: go test ./apex
Test: lunch cf_x86_64_phone-next-userdebug (uses mainline prebuilts)
Test: verified no diff in file_list.txt
Bug: 368337090
Change-Id: I0edb681beccac4d2a9ceb73f9a506c081a8a96e0
2024-09-20 23:47:36 +00:00
Spandan Das
a326b320ab Remove deapex support from java_*_import
prebuilt_apex/apex_set currently supports its deapexed contents to be
returned via a sibling java_import/java_sdk_import module. This is
necesssary for
1. dexpreopt/hiddenapi processing
2. usage as shared library

(1) is no longer necessary. this information is provided by the
top-level prebuilt apexes now

(2) is no longer possible since `exported_java_libs` has been removed in
https://r.android.com/3272110

This CL uses a hack for java_sdk_library_improt. Even though (1) is
provided by the top-level apex, there are still some places where
dexpreopt/hiddenapi processing visits the import modules. This CL uses
a bogus path to make analysis work. If this bogus path gets used, there
will be an error during ninja execution

Test: go test ./apex
Test: in internal lunch cf_x86_64_phone-next-userdebug (uses mainline
prebuilts)
Test: verified that file_list.txt is same
Bug: 368337090

Change-Id: I0ea2327f648f0fc60e337b232f7265e140772ffd
2024-09-20 23:33:09 +00:00
Jihoon Kang
28c9657e24 Revert^2 "Restrict java_sdk_library in libs"
Instead, the module should specify the submodule it actually depends on.
This is a prereq change to removing the java_sdk_library "magic"

Test: m nothing --no-skip-soong-tests
Bug: 366069293
Change-Id: Idb4b0b0a953f5391c24e50294c940522b73c34f2
2024-09-20 21:55:23 +00:00
Jihoon Kang
6c400b85b0 Merge "Revert "Restrict java_sdk_library in libs"" into main am: 46e0613992 am: 96960c9be0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3273157

Change-Id: I1d2d92a11e7d503ff5ac8f0a2b924d3e43a2ed98
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-20 18:10:39 +00:00
Jihoon Kang
33cbd37c00 Revert "Restrict java_sdk_library in libs"
This reverts commit 125efc6c30.

Reason for revert: b/368606825

Change-Id: Ia24f637db202f24be2ee13c7fe78e19a69576ffa
2024-09-20 17:09:09 +00:00
Treehugger Robot
d2451a705e Merge "Restrict java_sdk_library in libs" into main am: 37b288262e am: e62209b025
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3261983

Change-Id: I7d61ad2c765bea828f094feda856736ab6e8d9bd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-20 16:39:11 +00:00
Jihoon Kang
125efc6c30 Restrict java_sdk_library in libs
Instead, the module should specify the submodule it actually depends on.
This is a prereq change to removing the java_sdk_library "magic"

Test: m nothing --no-skip-soong-tests
Bug: 366069293
Change-Id: I9137c079afc7abf201e597e323ae7de415eea0dc
2024-09-19 21:44:20 +00:00
Treehugger Robot
e1f70a0af2 Merge "Add default_visibility for soong modules" into main am: fc79aabd84 am: 3b36ffb65f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3271955

Change-Id: I3712fefedf8f3114563355261f7f22ef9ce9c374
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-19 02:24:55 +00:00
Treehugger Robot
fc79aabd84 Merge "Add default_visibility for soong modules" into main 2024-09-19 02:14:55 +00:00
Cole Faust
16d227a725 Add default_visibility for soong modules
So that we don't get surprise usages.

Bug: 348717861
Test: m nothing
Change-Id: I47319a727092c1bd936cca88f5713ee977a48b48
2024-09-18 17:41:30 -07:00
Treehugger Robot
68f07b46c2 Merge "Add a unit test for class loader context with java_sdk_library impl lib" into main am: e2aeb50e49 am: 5d0a9316c1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3272612

Change-Id: Ieb7632d42560ae6685eec70ce237b2ae7d595186
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-19 00:06:55 +00:00
Treehugger Robot
e2aeb50e49 Merge "Add a unit test for class loader context with java_sdk_library impl lib" into main 2024-09-18 23:51:25 +00:00
Treehugger Robot
8b6567507f Merge "Remove exported_java_libs from prebuilt_apex/apex_set module types" into main am: c5459aa57f am: 2b47ef4dc2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3272110

Change-Id: I902f56e046afd4c1b56c27b206c3b0967f01c9bb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-18 23:09:36 +00:00
Treehugger Robot
c5459aa57f Merge "Remove exported_java_libs from prebuilt_apex/apex_set module types" into main 2024-09-18 22:59:25 +00:00
Jihoon Kang
e246bb7eca Add a unit test for class loader context with java_sdk_library impl lib
This test case tests the behavior added with aosp/3267383

Test: m nothing --no-skip-soong-tests
Bug: 366572133
Change-Id: Id7df3b76e6ef4880ac14e55bf8e0d81597d10055
2024-09-18 22:26:22 +00:00
Spandan Das
1896fd6006 Remove exported_java_libs from prebuilt_apex/apex_set module types
`exported_java_libs` provide information to soong about which .jars in a
prebuilt .apex need to be deapexed. This property is not used today,
since the only use case for deapexing is for dexpreopt, and dexpreopt is
done using bootjars (encapsulated using
`exported_bootclasspath_fragments`) and systemserver jars (encapsulated
using `exported_systemserverclasspath_fragments`)

Test: go test ./apex
Change-Id: I4ceec74aa11d8e32ccfb0bab29a4489cf8b3fc3d
2024-09-18 21:49:14 +00:00
Treehugger Robot
10c4a0aacb Merge "Convert trivial TopDown mutators to BottomUp" into main am: dbb3ef9ac2 am: 6c2a7e139d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3270769

Change-Id: Ic539574951e46a82d3c92d0b6308c2d72bec678c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-18 20:17:14 +00:00
Colin Cross
da279cfba4 Convert trivial TopDown mutators to BottomUp
Many TopDown mutators can be easily converted to BottomUp mutators,
which are easier to handle for incremental and partial analysis.

Bug: 367784740
Test: all soong tests pass
Test: no change to build.ninja
Flag: EXEMPT refactor
Change-Id: I82955e844ed0eb6680854678c0744ac5398eb7ba
2024-09-18 10:14:19 -07:00
Spandan Das
c264223e96 Merge "Delete multitree api imports code" into main am: 53a230b2fe am: 649cae6296
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3263496

Change-Id: I3dc087ece253f506a90ab6e47c10517df35fb372
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-11 23:44:09 +00:00
Spandan Das
53a230b2fe Merge "Delete multitree api imports code" into main 2024-09-11 22:20:52 +00:00
Treehugger Robot
432eafcd76 Merge "Remove apex_available allowlist" into main am: b269e32d09 am: 546d05ceb6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3249711

Change-Id: Iba2d1be84f4d75f86a47173bf262761ac958ad9f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-11 21:55:43 +00:00
Treehugger Robot
b269e32d09 Merge "Remove apex_available allowlist" into main 2024-09-11 21:50:57 +00:00
Spandan Das
ff66518da2 Delete multitree api imports code
The mutltiree workflow has not been in use for a while. This CL cleans
up the code that was added to support multitree.

Details
- Delete cc_api_library, cc_api_headers, cc_api_variant module types.
  These module types contain build rules for prebuilt stub .so and .h
files
- Update the DepsMutator of cc.Module to not create a dependency on a
  sibling cc_api_* module if it exists. e.g. do not create a dependency
on libfoo.apiimports if libfoo is listed in `shared_libs`.
- Remove cc_api_library from the stub/impl selection logic for cc
  modules

Test: m nothing --no-skip-soong-tests
Test: presbumits
Change-Id: Ie194157fb3bbc630f384cdd9b694b0fba6786ded
2024-09-11 19:19:33 +00:00
Treehugger Robot
6666d6bb1c Merge changes I505a7ad8,I92d88199 into main am: fae5ec8bbc am: 68168d7b56
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3258011

Change-Id: I3ff37fd8fe971ffc9cab1fc164fe9885abad7015
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-06 06:27:44 +00:00
Treehugger Robot
fae5ec8bbc Merge changes I505a7ad8,I92d88199 into main
* changes:
  Disable source apex variant using apex_available_name
  Skip `contents` validation of source bootclasspath fragments
2024-09-06 06:07:42 +00:00
Spandan Das
003452ff9c Disable source apex variant using apex_available_name
There are two versions of aosp extservices - one for Tplus and one for
Sminus. When prebuilts are active, the `contents` validation of both
variants of extservices bootclasspath fragments should be disabled to
account for BCP jar skew.

This CL adds ApexAvailableName to ApexInfo to achive that. If an
api_domain matching the ApexAvailableName has been selected in
`all_apex_contributions`, the source apex variants will be disabled.

Bug: 361771739

Test: lunch cf_x86_64_phone-next-userdebug
Test: m nothing with ag/28851886
Change-Id: I505a7ad8295c258e2eeef7f183669f7a75a1c88e
2024-09-06 05:10:41 +00:00
Spandan Das
1679192d7d Skip contents validation of source bootclasspath fragments
... if prebuilts are selected.

This is a special case of b/361771739 where a apex starts contributing a
jar to the BCP. `disableSourceApexVariant` uses
`PrebuiltSelectionInfoProvider` and this gets populated via the
following dep chain
```
source --> prebuilt --> all_apex_contributions
```

This runs into issues if a prebuilt bootclasspath_fragment does not
exist.

This CL creates a dependency edge between the source module and
all_apex_contributions singleton module so that
`PrebuiltSelectionInfoProvider` is available for
`disableSourceApexVariant`

Bug: 361771739
Test: lunch cf_x86_64-next-userdebug
Test: m nothing with ag/28851886
Change-Id: I92d88199a27579d3c9879d40fd354653370efcce
2024-09-06 05:10:29 +00:00
Colin Cross
3946f9e367 Merge "Move checkbuild targets of Soong modules into Soong" into main am: ca3bf2be39 am: 5f0561e24d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3237626

Change-Id: Ib035416676ead421eea1860e5420a2d8b987030e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-04 17:24:17 +00:00
Treehugger Robot
720df27693 Merge "apex: run host_apex_verifier" into main am: 19b81d777d am: 2b33af39c0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2972873

Change-Id: Ieac7904745e4bfcb8be646fce2a444cec7839ebf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-04 17:23:18 +00:00
Colin Cross
ca3bf2be39 Merge "Move checkbuild targets of Soong modules into Soong" into main 2024-09-04 17:12:03 +00:00
Treehugger Robot
19b81d777d Merge "apex: run host_apex_verifier" into main 2024-09-04 17:07:45 +00:00
Jooyung Han
1955d600d6 Merge changes Ia9f2186e,Ibe567d3b into main am: 0a9eb7f657 am: e1b039d184
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3247637

Change-Id: I70cf56e14a9bc13b1c8499037f8ddca3e54b0dd5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-09-04 01:40:10 +00:00
Colin Cross
a6182ab2fa Move checkbuild targets of Soong modules into Soong
Pass the name of Soong's checkbuild target for each module to
Make so that it can depend on it from the main checkbuild rule.
This will give better control over which files get built, allowing
checkbuild to skip the jar combining step when transitive classpath
jars are enabled.  The per-module checkbuild targets are passed to
make instead of added directly as a dependency of checkbuild in order
to maintain the existing behavior of only building modules exposed
to make in checkbuild.

Also tweak the existing calls to CheckbuildFile and add
InstallFileWithoutCheckbuild to match the files that are
in the Make-based checkbuild.

Bug: 308016794
Test: m checkbuild
Change-Id: Ic5140819381d58f4d00f23a7a12447950c4cf268
2024-09-03 14:52:19 -07:00
Jooyung Han
a3fddf40ca Refactor around apex aconfig files (#2)
Aconfig files are treated like other files in APEX. This way, we can
dedup the code hanlding those files (copy commands, fs_config, etc).

Bug: n/a
Test: m nothing --no-skip-soong-tests
Change-Id: Ia9f2186e4e54e92ad90c7a9c00474cb0f7519a31
2024-09-03 13:22:21 +09:00
Jooyung Han
6186ef9004 Refactor around apex aconfig files
We can iterate over the collection of apex file.

Bug: n/a
Test: m nothing --no-skip-soong-tests
Change-Id: Ibe567d3b251c54d656793dc443eb68fb9137f42f
2024-09-03 11:14:19 +09:00
Jooyung Han
2adba487bb apex: run host_apex_verifier
For now, the tool checks .rc files:
- .rc files are okay.
- services should run binary in apex.

Bug: 223896570
Test: m <apex>
Change-Id: I469c20afeff01cf10955ff2419113d6ac2d4cf45
2024-09-02 15:30:15 +09:00
Jihoon Kang
a5a744226b Merge "Revert^4 "Implement detecting container violations."" into main am: 7344482ff3 am: 9e40f8f9b4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3248019

Change-Id: I77818bede2be74dc6755a55c5a8e69a1c6a7f64c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-30 20:31:34 +00:00