Commit Graph

76538 Commits

Author SHA1 Message Date
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
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
LaMont Jones
aa005ae080 move CollectDependencyAconfigFiles to android
This needs to be called by some modules in android.

Bug: 308625757
Test: manual
Change-Id: I389fcfd88a3f4bd85a9218fdd4dd66d8a239bb67
2023-12-19 19:34:00 +00:00
Spandan Das
2c5f3c7fc1 Merge changes I3323d993,I01cea895 into main am: 349ef87505
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2876754

Change-Id: I96ccee0a2833651e4c99c6031e9924c7fef4da7d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-19 18:49:55 +00:00
Spandan Das
349ef87505 Merge changes I3323d993,I01cea895 into main
* changes:
  Move validation from FindDeapexerProviderForModule to rdeps
  Move dexpreopt processing from java_*_import to prebuilt_apex
2023-12-19 18:08:19 +00:00
Treehugger Robot
b8e45d8431 Merge "Revert "Show ETA only if it is smart status"" into main am: 2fd4783584
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2881848

Change-Id: I83564c841dde7fc3d8ca1b5524d411a04820aa91
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-19 16:53:44 +00:00
Treehugger Robot
2fd4783584 Merge "Revert "Show ETA only if it is smart status"" into main 2023-12-19 15:49:57 +00:00
Victor Chang
bf0175ee6a Avoid circular dependency for the aconfig usage in libcore
Bug: 316554963
Test: m droid
Change-Id: I6f45e585b8b656ef7ce1d51bbde0a44898198907
2023-12-19 14:22:07 +00:00
Mårten Kongstad
9ecf7d0a5e Fix broken sdk build (/bin/sh: 1: [[: not found) am: 0a0ea26c60
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2880857

Change-Id: I766134c15a32fb1347a5c10a31df204d4e13848e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-19 09:19:20 +00:00
Mårten Kongstad
0a0ea26c60 Fix broken sdk build (/bin/sh: 1: [[: not found)
The CL aosp/2878135 introduced a new shell command to be executed as
part of `m sdk dist` builds. The new command incorrectly used bash
syntax for conditionals, i.e. `if [[ ... ]]` (double [[]]) instead of
the POSIX compliant `if [ ... ]` (single []).

This broke the sdk build on systems where /bin/sh is not a symlink to
/bin/bash:

  /bin/sh: 1: [[: not found
  error: lstat out/soong/.intermediates/exported_java_aconfig_library.jar.tmp: file does not exist

Fix the breakage by using POSIX shell syntax instead.

Bug: 316933458
Bug: 311151343
Test: m sdk dist
Change-Id: I7de53261674a8f54c4ecacf0e27aecbafcfa4048
2023-12-19 08:20:51 +01:00
Jeongik Cha
b6d5ff505d Revert "Show ETA only if it is smart status"
Revert submission 2853087

Reason for revert: not necessary

Reverted changes: /q/submissionid:2853087

Change-Id: I747948ce5bec656851bf9a50e136bf7e3aae8df6
2023-12-19 05:44:26 +00:00
Yu Liu
1c6b1fb260 Merge "Properly package aconfig files for product and system_ext partitions" into main am: 4c27146e4c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2880492

Change-Id: I6d9b55c441b71e802616dc8a3dabab993987ada7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-19 01:27:06 +00:00
Yu Liu
4c27146e4c Merge "Properly package aconfig files for product and system_ext partitions" into main 2023-12-19 00:40:03 +00:00
Spandan Das
fae468ef14 Move validation from FindDeapexerProviderForModule to rdeps
FindDeapexerProviderForModule raises an exception if multiple apexes in
the tree has an export dep on the java module. In prepartation to
support multiple prebuilts, move this error check out of
FindDeapexerProviderForModule and into rdeps. i.e. raise an exception
only if an rdep calls DexJarBuildPath

- This should be a no-op for now.
- In the short-term future, a java import module will be allowed to have
  multiple deapexers. An error will be raised if anyone actually tries
  to depend on the dexjar
- In the long-term future, this function will be removed. All processing
  will be done at the prebuilt apex level and not at the prebuilt java
  library level

Since this check now happens in the moduleCtx of rdeps, add some
additional props to unit tests to ensure that it does not exit early on
unrelated validation checks (e.g. hidden_api prop is not set)

Test: go test ./apex ./java
Bug: 308790457

Change-Id: I3323d993c1ea8f43305834cae8e65b6fe41dfefd
2023-12-18 23:19:47 +00:00
Spandan Das
2069c3f74d Move dexpreopt processing from java_*_import to prebuilt_apex
dexpreopt of apex system server from prebuilts involves three soong
modules
1. prebuilt_apex / apex_set
2. an internal deapexer module created by the prebuilt apex
3. java_import/java_sdk_library

(3) acts as a shim for the deapexer to set the dexjar extracted from the
prebuilt apex. This methodolody requires a 1:1 correspondence across the
three modules

This breaks down when we have multiple versions of the same prebuilt
apex in the tree. In preparation for this, move the dexpreopt
processing from (3) to (1). Each prebuilt_apex will create the necessary
rules for dexpreopting the jars deapexed from itself. In the future,
apex_contributions will be used to pick which service-foo.{odex|.vdex} to
install depending on which prebuilt apex is selected.

Implementation details
- Embed dexpreopter in prebuiltApex structs so that this module type can
  register the dexpreopt rules. Since a single apex can have multiple
  system server jars, this also requires creating an additional scope in
  dexpreopt.go to prevent name collisions
- Add the dexpreopt modules as required in initApexFilesForAndroidMk
- Add the depreopt modules to androidMk in AndroidMkEntries. Drop the
  equivalent from java_import and java_sdk_library_import

Bug: 308790457
Test: existing soong unit tests
Test: lunch cf_x86_64_phone-next-userdebug && m out/target/product/vsoc_x86_64/system/apex/com.google.android.adservices.apex
Test: Verified that the above command installs
/out/target/product/vsoc_x86_64/system/framework/oat/x86_64/apex@com.android.adservices@javalib@service-adservices.jar@classes.{odex|vdex} and the equivalent files of service-sdksandbox

Test: presubmits

Change-Id: I01cea8956d2857fb864b415e73d3d2686d069b5e
2023-12-18 23:17:26 +00:00
Colin Cross
de05db0114 Merge changes I6f116385,Id77f514d,I73479de1,If58f4b53 into main am: 51428c451a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2876767

Change-Id: I1829e71f021721ec043bda19f12f3fee34044bba
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-18 23:15:42 +00:00
Colin Cross
ea30d85a65 Remove cc.moduleContext override of android.ModuleContext.*Specific
Overriding android.ModuleContext's implementations of *Specific()
methods in cc.moduleContext and then passing that back to
android.PathForModuleInstall to affect the install path causes
problems if android.ModuleBase.GenerateBuildActions also tries
to call android.PathForModuleInstall directly with the
android.ModuleContext as it gets a different result.

Add InstallIn* methods to the android.Module interface, implement
default versions in android.ModuleBase, and override them in
cc.Module and rust.Module.  Use them in android.PathsForModuleInstall
to allow the module to customize the behavior directly.

Test: TestInstallPartition
Change-Id: I7840e07eae34ac4f4d3490b021143d5f33a83626
2023-12-18 15:07:05 -08:00
Cole Faust
afc3e38658 Sandbox chre_atoms_log.h
go/android-busy-beavers-sandboxing

Bug: 307824623
Test: m chre_atoms_log.h
Change-Id: I3b4fcf6365e5571484964a4f9f344ed26f8f9afd
2023-12-18 15:02:38 -08:00
Yu Liu
22e32f1b0b Properly package aconfig files for product and system_ext partitions
Bug: 311173471
Test: Unit tests
Change-Id: Iac60695beb6529139965e4bb24024df6ce278fb2
2023-12-18 14:44:34 -08:00
Colin Cross
51428c451a Merge changes I6f116385,Id77f514d,I73479de1,If58f4b53 into main
* changes:
  Convert ModuleProvder to generic providers API
  Convert OtherModuleProvider to generic providers API
  Convert Provider to generic providers API
  Convert SetProvider to generic providers API
2023-12-18 22:43:45 +00:00
Mårten Kongstad
736f453ddc Merge "Only include exported flags in android-flags.jar" into main am: 8070c4b457
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2878135

Change-Id: Iec7dbbd0b685a6be473bde2d8c79780e5a035c1b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-18 21:01:16 +00:00
Mårten Kongstad
8070c4b457 Merge "Only include exported flags in android-flags.jar" into main 2023-12-18 20:31:31 +00:00
Colin Cross
7e3f9b43de Merge changes from topic "provider_generics" into main am: b2c65a26d6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2876763

Change-Id: Idd45d802713d4395abe9c233e71dc39f4d5b691e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-18 19:32:33 +00:00
Colin Cross
a471bff29b Use generics for providers API am: 3c0a83d19f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2876762

Change-Id: I27279b2ebf557d4f9395cc713b8174f00a1ddc2b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-18 19:32:31 +00:00
Colin Cross
a5458ee6ea Fix TestAarImportProducesJniPackages/aar-no-jni am: e8eeec913f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2876761

Change-Id: I385316f548bc58bb67ff41051eb7ad7eb1a78f60
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-18 19:32:25 +00:00
Colin Cross
b2c65a26d6 Merge changes from topic "provider_generics" into main
* changes:
  Convert NewProvider/NewMutatorProvider to generic providers API
  Use generics for providers API
  Fix TestAarImportProducesJniPackages/aar-no-jni
2023-12-18 19:15:39 +00:00
Mårten Kongstad
1258acfed3 Only include exported flags in android-flags.jar
The android-flags.jar file is consumed by apps built outside the
platform. These apps should only have access to exported flags (as
defined by the flag_declaration `is_exported` field).

Teach soong to filter out non-exported flags when generating
android-flags.jar.

Bug: 311151343
Test: m sdk dist # manually verify that $(gettop)/out/dist/android-flags.jar only contains exported flags
Change-Id: If66321fcffd920040dae3d99bd7ef69ff6925b18
2023-12-18 13:47:57 +01:00