Commit Graph

76565 Commits

Author SHA1 Message Date
Spandan Das
9d358f9fb0 Use the correct bootjars for hiddneapi when multiple prebuilts exist am: 64c9e0ce6e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2889086

Change-Id: I3a8f5751962ddd8a8036099c42071b13e8223a72
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-02 19:27:04 +00:00
Spandan Das
64c9e0ce6e Use the correct bootjars for hiddneapi when multiple prebuilts exist
hiddenapi processing require boot jars from apexes to determine the full
set of methods available at runtime.
When building with prebuilts, this comes via
java_import/java_sdk_library_import, which acts as a hook for
prebuilt_apex/apex_set. If we have multiple apexes in the tree, this
hook becomes 1:many. This CL prepares platform_bootclasspath to select the right
deapexerd .jar files when mutliple prebuilts exist.

Implementation details
- Create a dependency edge from platform_bootclasspath to
  all_apex_contributions (DepsMutator)
- For every boot jar, query all_apex_contributions to get the path to
  dexjar file (GenerateAndroidBuildActions)

Some other important details
- This CL does not drop the old mechanism to get the dex file (i.e. by
creating a dep on java_library). Once all mainline
modules have been flagged using apex_contributions, the old mechanism
will be dropped
- This CL has a functional change when building with source apexes. At
  ToT, the unecoded hiddenapi dex jar is used for package check and
  generating the monolithic stub file. After this change, the hiddenapi
  encoded file will be used for these operations.
  This should be fine since the
  package and dex signature do not change across the encoded and
  unencoded dex file. In fact, we already have a split today. When
  building with prebuilts, we use the encoded dex file. When building
  with source, we use the unecoded dex file.

Test: Added a unit test
Test: Manual testing in internal described below
- lunch cf_x86_64_phone-next-userdebug
- flagged com.google.android.adservices using apex_contributions
- aninja -t commands out/soong/hiddenapi/hiddenapi-stubs-flags.txt # no
  diff before and after
Bug: 308790777

Change-Id: I72c70f0ae1b587679203ea254c9c12a48e7aa782
2024-01-02 17:56:14 +00:00
Colin Cross
bdd32f0951 Merge changes I152f8e5e,I3259a9b8 into main am: ad579a8c71
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2889112

Change-Id: I01c0c2e9f65e08896da0ffc36381d8ace36e3085
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-22 18:19:51 +00:00
Colin Cross
ad579a8c71 Merge changes I152f8e5e,I3259a9b8 into main
* changes:
  Reland "Remove non-generic provider APIs"
  Update usage of SetProvider
2023-12-22 17:40:00 +00:00
Colin Cross
24c1cbe63e Reland "Remove non-generic provider APIs"
There are no more callers to the non-generic provider APIs, remove them.

This reapplies I4d336340e630643f98531787a81e0f1f18ec108d after
I79736e44d85bc6e8c97f08ebf783b40533a3e6ae removed a newly introduced
usage.

Bug: 316410648
Change-Id: I152f8e5ef8330b811d3f42f8c2c73943ac0979bb
Test: builds
2023-12-22 00:06:05 +00:00
Spandan Das
a41b8ecc62 Update usage of SetProvider
Test: go build ./apex (top of stack)
Change-Id: I3259a9b88c6a22f94e41ef43e2c42d9ea56c2afb
2023-12-22 00:06:05 +00:00
Treehugger Robot
0f013bcbcf Merge "Remove usage of OtherModuleHasProvider in dexpreopt_bootjars" into main am: 71790b154d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2883015

Change-Id: I6039556d4ebc8e93bc79f85aec0ddf9c296de04d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-21 22:17:19 +00:00
Ludovic Barman
ebd48b08ca Merge "Remove unused use_protobuf3 flag" into main am: aa5d9b43f9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2879266

Change-Id: I509a429e8ad08f7fa21d8cfe7fd7d8e1a83cbd31
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-21 22:17:08 +00:00
Spandan Das
387dbf5bc1 Merge "Drop libprofile modules from baselinseApexAvailable map" into main am: c7acd4858b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2889247

Change-Id: If5a0f930c0d2d81669278963f6148e3ab0b8f62a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-21 22:16:56 +00:00
Treehugger Robot
71790b154d Merge "Remove usage of OtherModuleHasProvider in dexpreopt_bootjars" into main 2023-12-21 21:58:53 +00:00
Ludovic Barman
aa5d9b43f9 Merge "Remove unused use_protobuf3 flag" into main 2023-12-21 21:57:45 +00:00
Spandan Das
c7acd4858b Merge "Drop libprofile modules from baselinseApexAvailable map" into main 2023-12-21 21:46:22 +00:00
Spandan Das
3858202715 Drop libprofile modules from baselinseApexAvailable map
The implicit //apex_available:anyapex seems to be unused, so we can drop
it

Bug: 281077552
Test: m nothing
Change-Id: I66fef50901bfd19237a9ef96b169ecefa01d76b9
2023-12-21 20:18:48 +00:00
Treehugger Robot
0181efacf9 Merge "Change aconfig dump to aconfig dump-cache" into main am: a514919521
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2888466

Change-Id: I0a0107037ec1b1b2bc825a7a7cb223e8053c5d58
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-21 19:19:46 +00:00
Treehugger Robot
a514919521 Merge "Change aconfig dump to aconfig dump-cache" into main 2023-12-21 18:38:54 +00:00
Treehugger Robot
8d1a67806a Merge "Change target platform to LINUX-OTHER" into main am: bdfb169e90
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2887966

Change-Id: I019f20e8720e54858abcea1090cc03e4edb3e17b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-21 18:03:09 +00:00
Ludovic Barman
78b2519e19 Remove unused use_protobuf3 flag
This is a No-op.
Protobuf3 is used regardless of this flag since https://android-review.git.corp.google.com/c/platform/build/soong/+/2817733

Test: m rust

Bug: 308790516
Change-Id: I1bfbca5d8a30e4e10f03e4e045d6c6ceddb30c87
2023-12-21 17:53:51 +00:00
Treehugger Robot
bdfb169e90 Merge "Change target platform to LINUX-OTHER" into main 2023-12-21 17:30:08 +00:00
Mårten Kongstad
c479c026f1 Change aconfig dump to aconfig dump-cache
Update the calls to dump aconfig caches; the new canonical name is
`dump-cache`, though `dump` is still an accepted alias (for now).

Bug: N/A
Test: m all_aconfig_declarations && printflags
Change-Id: I9f82d31666ced6bbd0f195f1422590547114e0f0
2023-12-21 16:49:11 +01:00
Sorin Basca
088e079803 Change target platform to LINUX-OTHER
This is needed to be compatible with JDK 21+ which does not allow
other platforms (apart from the ones listed in the modules
plugin) when linking a system image.

Note the value of target platform doesn't matter to us, we just
choose a closest one to replace "android".

Bug: 313924276
Test: m EXPERIMENTAL_USE_OPENJDK21_TOOLCHAIN=true
Change-Id: Id805f31089fdbd78bf4db06c89ae391f25563448
2023-12-21 11:49:35 +00:00
Søren Gjesse
fa139b17f9 Merge "Remove setting com.android.tools.r8.emitRecordAnnotationsExInDex" into main am: c97dfe42b9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2881155

Change-Id: I3edce9779893e039c78c2e410d7de7cf1bdd9b7c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-21 10:28:51 +00:00
Søren Gjesse
c97dfe42b9 Merge "Remove setting com.android.tools.r8.emitRecordAnnotationsExInDex" into main 2023-12-21 09:47:47 +00:00
Mårten Kongstad
ee05861ce3 Merge "Replace aconfig dump --format=bool with explicit format string" into main am: 26d2c67339
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2882369

Change-Id: Ic601a9f8e8ad4c49bcbb850e7eecace98e4e501f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-21 07:43:16 +00:00
Mårten Kongstad
26d2c67339 Merge "Replace aconfig dump --format=bool with explicit format string" into main 2023-12-21 07:03:38 +00:00
Spandan Das
ec7918d041 Merge "Use the correct bootjars when multiple prebuilt apexes exist" into main am: 412b33a6e7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2876756

Change-Id: If24b610990f7fdd198d4668a94a818301362eb55
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-20 19:18:47 +00:00
Cole Faust
35555ba1df Merge "Sandbox chre_atoms_log.h" into main am: 9734cff08c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2880464

Change-Id: I8054c675ef38c294b19d35e1d8ac1e68f7344144
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-20 19:02:09 +00:00
Spandan Das
412b33a6e7 Merge "Use the correct bootjars when multiple prebuilt apexes exist" into main 2023-12-20 19:00:49 +00:00
Cole Faust
9734cff08c Merge "Sandbox chre_atoms_log.h" into main 2023-12-20 18:43:12 +00:00
Spandan Das
5be6333692 Use the correct bootjars when multiple prebuilt apexes exist
hiddenapi and dexpreopt require boot and system server jars from apexes.
When building with prebuilts, this comes via
java_import/java_sdk_library_import, which acts as a hook for
prebuilt_apex/apex_set. If we have multiple apexes in the tree, this
hook becomes 1:many. This CL prepares dex_bootjars to select the right
deapexerd .jar files when mutliple prebuilts exist.

Implementation details
- Update prebuilt module types (prebuilt_apex/apex_set) and source
  apexes to set a map of
  library name to dex jar path on host.
- dex_bootjars will access the path of the .dex jar on host via the
  provider. These then
  copied/installed to the right locations.

This CL does not drop the old mechanism to get the dex file (i.e. by
creating a dep on java_library). Once all mainline
modules have been flagged using apex_contributions, the old mechanism
will be dropped

Bug: 308790457
Test: git_master-art-host:art-gtest https://android-build.corp.google.com/builds/abtd/run/L21500030000926533
Test: git_main:art_standalone_dexpreopt_tests https://android-build.corp.google.com/builds/abtd/run/L99000030000891212
Test: Added a unit test that checks that the right .jar is selected
when multiple prebuilts exists

Change-Id: I6ef94135b9303a35135810930af4b641df13a583
2023-12-20 16:43:01 +00:00
David Srbecky
209834dd38 Merge "Revert^6 "Enable dex container (DEX v41) for the whole system"" into main am: f01e2f7308
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2878966

Change-Id: I6d28bdd97dd499d6cfd1a490bdd7a38dc0a92194
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-20 02:00:12 +00:00
Cole Faust
9c2308ba03 Merge changes I8b352305,Iadf9e324 into main am: 30e32f67fc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2883010

Change-Id: I0d6b0212a87797d6334f55319263044e03b4d685
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-20 01:59:54 +00:00
David Srbecky
f01e2f7308 Merge "Revert^6 "Enable dex container (DEX v41) for the whole system"" into main 2023-12-20 01:37:06 +00:00
Cole Faust
30e32f67fc Merge changes I8b352305,Iadf9e324 into main
* changes:
  Sandbox CtsApkVerityTestDebugFiles
  Include "soong" in sandboxed out paths
2023-12-20 01:35:40 +00:00
Spandan Das
bc114d2ff9 Remove usage of OtherModuleHasProvider in dexpreopt_bootjars
Since OtherModuleHasProvider will be deprecated soon, replace it with OtherModuleProvider

Test: go build ./java
Change-Id: I79736e44d85bc6e8c97f08ebf783b40533a3e6ae
2023-12-20 01:27:29 +00:00
Colin Cross
fde5a49cef Merge "Revert "Remove non-generic provider APIs"" into main am: a4cca85eea
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2882901

Change-Id: I9cb2418bfdc50805b1f35f2c218f7ecf63d5de52
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-20 01:08:06 +00:00
Colin Cross
a4cca85eea Merge "Revert "Remove non-generic provider APIs"" into main 2023-12-20 01:00:27 +00:00
Colin Cross
84b68c90ae Revert "Remove non-generic provider APIs"
This reverts commit ad50aca6ab.

Reason for revert: Broke builds when combined with aosp/2876755

Change-Id: I3bfbcb05d8c695b9315b7e8e3f63c6bd5c9dbe36
2023-12-20 00:59:28 +00:00
Colin Cross
a6c0da77a5 Merge "Remove non-generic provider APIs" into main am: e87e278086
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2876768

Change-Id: I5db83c34fcd80548a377c5a8fd738d80d4e34bc3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-20 00:53:04 +00:00
Spandan Das
5c71da429d Merge "Use the correct prof file when multiple prebuilt apexes exist" into main am: 96feedc555
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2876755

Change-Id: I4183eca0358a9b88912d10c9404b3a407f79e12a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-20 00:52:25 +00:00
Colin Cross
e87e278086 Merge "Remove non-generic provider APIs" into main 2023-12-20 00:42:38 +00:00
Spandan Das
96feedc555 Merge "Use the correct prof file when multiple prebuilt apexes exist" into main 2023-12-20 00:02:20 +00:00
Colin Cross
66fe8f6171 Merge "Remove cc.moduleContext override of android.ModuleContext.*Specific" into main am: 225ad7e8b2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2880494

Change-Id: Ifac4117922327f7f0efadb39185e6f0d2a2fb611
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-19 23:48:22 +00:00
LaMont Jones
d4efb42433 Merge "move CollectDependencyAconfigFiles to android" into main am: 4daed5a026
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2883008

Change-Id: I4b1bda253715ce3d8e48c0f4fd7537f09eeb2605
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-19 23:47:42 +00:00
Colin Cross
225ad7e8b2 Merge "Remove cc.moduleContext override of android.ModuleContext.*Specific" into main 2023-12-19 23:39:54 +00:00
Cole Faust
81f2ac35f1 Sandbox CtsApkVerityTestDebugFiles
go/android-busy-beavers-sandboxing

It still has a diff in the generule_sandbox_test, but it's just the
addition of "./" in front of all the paths, which is fine.

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py CtsApkVerityTestDebugFiles
Change-Id: I8b352305cfb339bc5a09a2305e10a187723d754d
2023-12-19 15:35:02 -08:00
LaMont Jones
4daed5a026 Merge "move CollectDependencyAconfigFiles to android" into main 2023-12-19 23:07:50 +00:00
Spandan Das
da739a30a6 Use the correct prof file when multiple prebuilt apexes exist
Generating boot image requires a .prof file provided by the ART apex.
When building with prebuilts, this comes via the
prebuilt_bootclasspath_fragment module, which acts as a shim for
prebuilt_apex/apex_set. If we have multiple prebuilt apexes in the tree,
this shim becomes 1:many. This CL prepares dex_bootjars to select the
right .prof file when multiple prebuilts exist.

Implementation details
- Update deps mutator of dex_bootjars to create a dep on
  all_apex_contributions. The latter contains information about which
  apex is selected in a specific release configuration. dex_bootjars
  will create a dependency on the selected apex in a postdeps phase
  mutator.
- All apex module types (apex, prebuilt_apex and apex_set) will set a
  provider that contains info about the location of the .prof file on
  host
- dex_bootjars will access the provider of the selected apex to get the
  location of the .prof file

This CL does not drop the old mechanism to get the .prof file (i.e. by
creating a dep on {prebuilt_}bootclasspath_fragment). Once all mainline
modules have been flagged using apex_contributions, the old mechanism
will be dropped

Bug: 308790457
Test: Added a unit test that checks that the right .prof is selected
when multiple prebuilts exists

Change-Id: I40fdb21416c46bed32f6ff187ce5153711ec2c69
2023-12-19 22:37:29 +00:00
Victor Chang
8f7e78f8bb Merge "Avoid circular dependency for the aconfig usage in libcore" into main am: a9d3293bf4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2880848

Change-Id: I9e12749d85104b28d322c63c67fb8b1e65d679d2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-19 20:46:38 +00:00
Victor Chang
a9d3293bf4 Merge "Avoid circular dependency for the aconfig usage in libcore" into main 2023-12-19 20:39:03 +00:00
Cole Faust
e8561c6108 Include "soong" in sandboxed out paths
Previously, the path to built files in the sandbox would be
out/.intermediates/... instead of out/soong/.intermediates/....

After this cl, it will be out/soong/.intermediates/.... This makes
it more consistent with the non-sandboxed paths, which is easier for
developers.

CtsApkVerityTestDebugFiles is a genrule that's used to find the paths
to other modules. Developers were expected to build it, then copy all
the files listed in its output file to a temporary directory. Those
paths would be wrong before this change.

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py CtsApkVerityTestDebugFiles
Change-Id: Iadf9e3240a2c828567e46b6b02cc14004f30e8bf
2023-12-19 12:14:01 -08:00