Commit Graph

3657 Commits

Author SHA1 Message Date
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
Jihoon Kang
85bc193805 Revert^4 "Implement detecting container violations."
This change introduces a method to detect violating inter-container
dependencies between modules. The method is run in
`ModuleBase.GenerateBuildActions`, after the container info provider is
set. Given that the provider of the direct dependencies would have been
set at this time, the method utilizes this information to determine
the violations, which are introduced in https://r.android.com/3141104.

Note that this enforcement does not turn all inter-container
dependencies as errors. Instead, it will only turn dependencies that
matches the pre-defined violations into errors. Even if the dependency
matches the violation, an error will not be thrown if the dependency
satisfies any of the exception functions (e.g. the dependent module is
stubs, or the two modules belong to the same apexes).

Test: m nothing --no-skip-soong-tests
Bug: 338660802
Change-Id: Ib9ddc0761fa46f1309b1a1a4f759d9a4e04fd70e
2024-08-29 17:55:00 +00:00
Jooyung Han
a89a58ac1c Remove apex_available allowlist
Bug: 147364041
Test: m nothing --no-skip-soong-tests
Change-Id: I65ac605fe77a9e013a2c0b64adc36db414c77465
2024-08-29 13:00:33 +09:00
Priyanka Advani (xWF)
523efd1db1 Merge "Revert^3 "Implement detecting container violations."" into main am: 88a8daf8ca am: c2ba6683c5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3248525

Change-Id: I81f89cb4da10d34d2de5c48093bf43a76b81d769
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 23:38:16 +00:00
Priyanka Advani (xWF)
33b3a638a5 Revert^3 "Implement detecting container violations."
2a88491afc

Change-Id: Iba4527f391a093703978fe01177b56fec4604b28
2024-08-28 23:10:29 +00:00
Jihoon Kang
2ad26bc6ea Merge changes Ia693c4a5,I8e5620d2 into main am: c14be38f1a am: 4e373a7904
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3247222

Change-Id: Ic901c1d2deef5f61e661cd07aa620b8ffdaf39df
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 21:52:18 +00:00
Jihoon Kang
2a88491afc Revert^2 "Implement detecting container violations."
This change introduces a method to detect violating inter-container
dependencies between modules. The method is run in
`ModuleBase.GenerateBuildActions`, after the container info provider is
set. Given that the provider of the direct dependencies would have been
set at this time, the method utilizes this information to determine
the violations, which are introduced in https://r.android.com/3141104.

Note that this enforcement does not turn all inter-container
dependencies as errors. Instead, it will only turn dependencies that
matches the pre-defined violations into errors. Even if the dependency
matches the violation, an error will not be thrown if the dependency
satisfies any of the exception functions (e.g. the dependent module is
stubs, or the two modules belong to the same apexes).

Test: m nothing --no-skip-soong-tests
Bug: 338660802
Change-Id: Ia693c4a53369c757a3e96656a769405c759b111c
2024-08-28 18:01:25 +00:00
Satish Yalla
fa0019bf1f Merge "Revert "Implement detecting container violations."" into main am: f2d6e5004f am: b2407feae1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3244001

Change-Id: Iddc3110928d6d237de002dc65e033e7940e2b11e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 06:00:22 +00:00
Satish Yalla
f2d6e5004f Merge "Revert "Implement detecting container violations."" into main 2024-08-28 05:48:21 +00:00
Satish Yalla
b2b1ef63e2 Revert "Implement detecting container violations."
This reverts commit bb678f82d6.

Reason for revert: Droidmonitor created revert due to b/362639013. Will be verifying through ABTD before submission.

Change-Id: I1dcb71672eeb44a17cf176d3731bcaf9aaf81edf
2024-08-28 05:10:31 +00:00
Treehugger Robot
3b407afefb Merge "Implement detecting container violations." into main am: 26f071db92 am: 30f3795688
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3155659

Change-Id: If66625fe313efbbf9b50ebaee77e9ab718db58e9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 04:51:30 +00:00
Treehugger Robot
26f071db92 Merge "Implement detecting container violations." into main 2024-08-28 04:39:12 +00:00
Treehugger Robot
ab740c544b Merge "dexpreopt rules for google mainline prebuilts with missing source" into main am: 529da9b897 am: cd08b3bfda
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3241767

Change-Id: Idbccd4c9d99c8a803a97a81c3ad29885aff30085
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 01:36:29 +00:00
Treehugger Robot
529da9b897 Merge "dexpreopt rules for google mainline prebuilts with missing source" into main 2024-08-28 01:25:52 +00:00
Treehugger Robot
3aca762ba7 Merge changes from topic "ctx_in_ideinfo" into main am: 9cbbafe300 am: e1028aa539
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3246818

Change-Id: Id12e0cbdeba1d100d7c755fbcf4336bc1f7c0554
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-28 01:01:20 +00:00
Treehugger Robot
9cbbafe300 Merge changes from topic "ctx_in_ideinfo" into main
* changes:
  Add ctx argument to IDEInfo()
  Add configurable property support to neverallow
2024-08-28 00:49:13 +00:00
Cole Faust
b36d31d870 Add ctx argument to IDEInfo()
The IDEInfo() methods read properties. To make those properties
configurable, we need a context to evaluate them with.

Bug: 362579941
Test: m nothing --no-skip-soong-tests
Change-Id: I26d4b7084439b3006e50b02277298f74a929e1aa
2024-08-27 16:04:28 -07:00
Spandan Das
8a2c56c516 dexpreopt rules for google mainline prebuilts with missing source
AddFarVariationDependencies runs into issues in partner workspaces which
do not contain the sources of google mainline prebuilts, since the
prebuilt would be renamed in a prior prebuilt_rename mutator. To account
for this rename, add `prebuilt_` prefix in
`addDependenciesOntoSelectedBootImageApexes` to ensure that the prebuilt
apex does not get elided

Test: m nothing --no-skip-soong-tests
Test: in v-aml-prebuilt dev,
aninja -t query out/soong/dexpreopt_arm64/dex_bootjars_input/okhttp.jar | head -n3
out/soong/dexpreopt_arm64/dex_bootjars_input/okhttp.jar:
  input: g.android.Cp
    out/soong/.intermediates/vendor/partner_modules/ArtPrebuilt/prebuilt_com.google.android.art_compressed.deapexer/android_common/deapexer/javalib/okhttp.jar
(uses the prebuilt deapexed boot jar, and no the source apex boot jar)

Bug: 362163831
Change-Id: Ie94a36911ab40ac09a470efe505fd00ef3a5bf9c
2024-08-27 22:01:11 +00:00
Spandan Das
4c2221e8f0 Merge "Contents validation of override_apex's bootclasspath fragments" into main am: 39d61f53ff am: 8bd23c11bd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3241777

Change-Id: I5c0904ecd2136cde891f6f3144c679f07d711e86
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-08-27 20:47:57 +00:00