Commit Graph

7757 Commits

Author SHA1 Message Date
Søren Gjesse
2278472256 Merge "Remove setting com.android.tools.r8.emitRecordAnnotationsExInDex" into main am: c97dfe42b9 am: fa139b17f9 am: b06eeb51fc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2881155

Change-Id: I3947862f85ad3ebc12d571fc88a162e70491d46c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-21 11:50:45 +00:00
Søren Gjesse
c97dfe42b9 Merge "Remove setting com.android.tools.r8.emitRecordAnnotationsExInDex" into main 2023-12-21 09:47:47 +00:00
Spandan Das
24e5d5c001 Merge "Use the correct bootjars when multiple prebuilt apexes exist" into main am: 412b33a6e7 am: ec7918d041 am: 4cf8303b55
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2876756

Change-Id: Iff568b322a299f702c3cb5369149f163b493ad5f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-20 20:24:15 +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
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
4403c7d054 Merge "Revert^6 "Enable dex container (DEX v41) for the whole system"" into main am: f01e2f7308 am: 209834dd38 am: 1c35415ae1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2878966

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

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

Change-Id: I535ea20667153e64390241b44ff757fc3651ca60
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-20 01:56:47 +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
LaMont Jones
d7439041dc Merge "move CollectDependencyAconfigFiles to android" into main am: 4daed5a026 am: d4efb42433 am: 46d4218fd0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2883008

Change-Id: Ifbd8d3636cbacbbd0bab4331cc93a06ddc1c87db
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-20 01:06:54 +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
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
Spandan Das
61342eb61c Merge changes I3323d993,I01cea895 into main am: 349ef87505 am: 2c5f3c7fc1 am: a173731d29
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2876754

Change-Id: Id542d9ebfdfee6822aed0352bd8e0c6264a5f3d2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-19 20:14:59 +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
Søren Gjesse
8a5b32d0cf Remove setting com.android.tools.r8.emitRecordAnnotationsExInDex
System property was removed in
https://r8-review.git.corp.google.com/c/r8/+/82140, as the
system property com.android.tools.r8.emitRecordAnnotationsInDex
is the only system property for not desugaring records.

Test: Existing
Fixes: b/316501817
Change-Id: I057a18c9e02a99365e910d3128890fd481e93541
2023-12-19 10:49:58 +01:00
Colin Cross
1017d87801 Merge changes I6f116385,Id77f514d,I73479de1,If58f4b53 into main am: 51428c451a am: de05db0114 am: 503d8ef094
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2876767

Change-Id: Ia86e53aa7d97ce150651239b4ac2b211e73e2ca7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-19 00:36:34 +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
eef815c2e1 Merge changes from topic "provider_generics" into main am: b2c65a26d6 am: 7e3f9b43de am: 9d661502e6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2876763

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

Change-Id: I8cefa5a4a49cf8f4bf698ddaf9e48d6b7f2469f0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-18 20:42:56 +00:00
Colin Cross
3ba26576b7 Fix TestAarImportProducesJniPackages/aar-no-jni am: e8eeec913f am: a5458ee6ea am: 4fbafd5bda
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2876761

Change-Id: I70c572e137e7916e9075dc7c02c848ae9f480dc1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-18 20:42:51 +00:00
Dan Shi
7022550d0e Revert^6 "Enable dex container (DEX v41) for the whole system"
This reverts commit a33691288e.

Reason for revert: b/316609623

Change-Id: I7438f3e55a29cf07da907d04a97b1f7bcc85956c
2023-12-15 21:37:53 +00:00
Chris Antol
062d6235d3 Merge "Revert^5 "Enable dex container (DEX v41) for the whole system"" into main am: 6482cb97cd am: 7752fc2274 am: e5e4ec833f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2876730

Change-Id: I3ac4be658ef85c76be323cf4fa34e0874ada65c9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-15 20:43:34 +00:00
Chris Antol
6482cb97cd Merge "Revert^5 "Enable dex container (DEX v41) for the whole system"" into main 2023-12-15 19:01:34 +00:00
Chris Antol
a33691288e Revert^5 "Enable dex container (DEX v41) for the whole system"
This reverts commit d45836eb38.

Reason for revert: Still breaks tests

Bug: 314212435
Change-Id: I35867878c9a8b2aa3d64092a5326c42191569adc
2023-12-15 18:15:51 +00:00
David Srbecky
c890d53518 Merge "Revert^4 "Enable dex container (DEX v41) for the whole system"" into main am: a6bc7c87bd am: 354153aa2e am: 58ca20aa7b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2859465

Change-Id: I7c2c6c3fe4952ee9c57e70853feb4b920687cb15
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-15 14:36:42 +00:00
David Srbecky
a6bc7c87bd Merge "Revert^4 "Enable dex container (DEX v41) for the whole system"" into main 2023-12-15 13:05:51 +00:00
Colin Cross
5a37718c95 Convert ModuleProvder to generic providers API
Convert all of the callers of ModuleProvider/ModuleHasProvider to use the
type-safe android.SingletonModuleProvider API.

Bug: 316410648
Test: builds
Change-Id: I6f11638546b64749e451cebbf33140248dc1d193
2023-12-14 16:12:22 -08:00
Colin Cross
313aa5475f Convert OtherModuleProvider to generic providers API
Convert all of the callers of OtherModuleProvider/OtherModuleHasProvider
to use the type-safe android.OtherModuleProvider API.

Bug: 316410648
Test: builds
Change-Id: Id77f514d68761a262d9ea830a601dbed804bbbe5
2023-12-14 16:12:22 -08:00
Colin Cross
ff694a8c88 Convert Provider to generic providers API
Convert all of the callers of Provider/HasProvider to use the type-safe
android.ModuleProvider API.

Bug: 316410648
Test: builds

Change-Id: I73479de1625fa2865b6c73444cd477e50d56dc5a
2023-12-14 16:12:21 -08:00
Colin Cross
3c0a83d19f Use generics for providers API
Using generics for the providers API allows a type to be associated
with a ProviderKey, resulting in a type-safe API without that doesn't
require runtime type assertions by every caller.

Unfortunately, Go does not allow generic types in methods, only in
functions [1].  This prevents a type-safe API on ModuleContext, and
requires moving the API to be functions that take a ModuleContext as
a parameter.

This CL creates the new API, but doesn't convert all of the callers.

[1] https://go.googlesource.com/proposal/+/refs/heads/master/design/43651-type-parameters.md#no-parameterized-methods)

Bug: 316410648
Test: builds
Change-Id: I3e30d68b966b730efd968166a38a25cc144bd6de
2023-12-14 16:12:20 -08:00
Colin Cross
e8eeec913f Fix TestAarImportProducesJniPackages/aar-no-jni
TestAarImportProducesJniPackages was attempting to assert that an
aar_import module always had a JniPackageProvider, but was instead
asserting that the return type was always a JniPackageInfo.  Since
ModuleProvider returned the zero value of JniPackageInfo even when
there was no provider that was always true.

Fix aar_import to always set JniPackageProvider.

Test: TestAarImportProducesJniPackages
Change-Id: Idaf106e14373490d4eb807892e174aaaf094bbcf
2023-12-14 16:12:20 -08:00
Colin Cross
bc7d76cca2 Convert NewProvider/NewMutatorProvider to generic providers API
Convert all of the callers to NewProvider and NewMutatorProvider
to use a generic type parameter instead of an example object.

Bug: 316410648
Test: builds
Change-Id: Ic9cdafc87336e26730d3fd596df05de0e7267542
2023-12-14 16:12:20 -08:00
Colin Cross
402130276c Convert SetProvider to generic providers API
Convert all of the callers of SetProvider to use the type-safe
android.SetProvider API.

Bug: 316410648
Test: builds
Change-Id: If58f4b5355264ddab2045bc3591a4eac19cd58fc
2023-12-14 16:12:20 -08:00
Cole Faust
9dd4fad091 Merge "Allow compile_data on all java modules" into main am: c01104234e am: 1a09b13d93 am: b6b09c2d53
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2875178

Change-Id: I5d2b973e5ee67bbb01558475550e116851ab7963
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-14 23:22:27 +00:00
Cole Faust
c01104234e Merge "Allow compile_data on all java modules" into main 2023-12-14 21:44:46 +00:00
Yu Liu
3b4032600f Merge "Properly package aconfig files for vendor partition" into main am: a1df1a5937 am: 10d22de5d3 am: 59d425941b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2875174

Change-Id: I285a847312ed43f40a10dbee1d5c9a4189fdcae8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-14 20:56:26 +00:00
Cole Faust
2b64af861a Allow compile_data on all java modules
art java_test modules need to specify compile_data, make it common
to all java modules.

Bug: 307824623
Test: m lint-check
Change-Id: I68640f14137f9cadaf0c454d3b5abc9e2d1d9b4b
2023-12-13 18:22:18 -08:00
Yu Liu
6dc93f9a09 Properly package aconfig files for vendor partition
Bug: 311173471
Test: Unit tests
Change-Id: Ibb857b69c3f83326a9ff5732e11dd09887e4ba6e
2023-12-14 01:19:35 +00:00
Treehugger Robot
aca0c185fc Merge "Use --revert-annotation instead of --hide-annotation" into main am: 550a0dab0d am: f384a08950 am: 0e02a14a2b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2870808

Change-Id: If0e5da2148bc51ae4b952f47f92f6b941cbeb7bc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-13 03:01:10 +00:00
Paul Duffin
7ac943f7e1 Use --revert-annotation instead of --hide-annotation
Use of `--hide-annotation android.annotation.FlaggedApi` was always an
intermediate solution until the required semantics for `@FlaggedApi`
was determined. The `--revert-annotation` option provides those
semantics. When the `@FlaggedApi` is applied to an existing API, e.g.
because it has moved from system to public, or because it has changed
in some way, e.g. modifiers, then the correct semantics for when that
API is not required is not to hide the API but to revert it to what it
was before the change necessitating the `@FlaggedApi` annotation was
made.

Use --revert-annotation instead of --hide-annotation

Use of `--hide-annotation android.annotation.FlaggedApi` was always an
intermediate solution until the required semantics for `@FlaggedApi`
was determined. The `--revert-annotation` option provides those
semantics. When the `@FlaggedApi` is applied to an existing API, e.g.
because it has moved from system to public, or because it has changed
in some way, e.g. modifiers, then the correct semantics for when that
API is not required is not to hide the API but to revert it to what it
was before the change necessitating the `@FlaggedApi` annotation was
made.
Use --revert-annotation instead of --hide-annotation

Use of `--hide-annotation android.annotation.FlaggedApi` was always an
intermediate solution until the required semantics for `@FlaggedApi`
was determined. The `--revert-annotation` option provides those
semantics. When the `@FlaggedApi` is applied to an existing API, e.g.
because it has moved from system to public, or because it has changed
in some way, e.g. modifiers, then the correct semantics for when that
API is not required is not to hide the API but to revert it to what it
was before the change necessitating the `@FlaggedApi` annotation was
made.

Bug: 314196587
Test: ./gradlew
Change-Id: Ic97f29dd2b9f598ba0851f5f622c2a2724f18037
2023-12-13 00:33:25 +00:00
Colin Cross
5c298e2c36 Merge "Remove ConvertWithBp2build implementations" into main am: a72573a727 am: cd4b2f21cd am: 8bb537ba9c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2864663

Change-Id: I86ea781dcc4761078a49ee825c47d11fde9d91be
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-12 00:29:45 +00:00
Treehugger Robot
22620b7331 Merge "Add compile_data for android apps" into main am: b49f038231 am: c1e6e93adf am: 316e403735
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2866314

Change-Id: Id9f9a4ad9fc150c7dfd2e48062e1e4211239f284
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-12 00:01:26 +00:00
Tor Norbye
db119527fd Merge "303434307: Enable flagged API checking" into main am: 2624653aa9 am: 142049d248 am: 6cd2ac1d2d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2864659

Change-Id: Id0fae5a7af67a7bba7ccd3344c71d2726e941593
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-11 23:41:00 +00:00
Colin Cross
a72573a727 Merge "Remove ConvertWithBp2build implementations" into main 2023-12-11 23:12:53 +00:00
Treehugger Robot
b49f038231 Merge "Add compile_data for android apps" into main 2023-12-11 19:25:20 +00:00
Tor Norbye
2624653aa9 Merge "303434307: Enable flagged API checking" into main 2023-12-11 18:14:56 +00:00
Colin Cross
8ff105860d Remove ConvertWithBp2build implementations
Remove the ConvertWithBp2build implementations from all the module
types, along with the related code.

Bug: 315353489
Test: m blueprint_tests
Change-Id: I212672286686a318893bc7348ddd5a5ec51e77a7
2023-12-08 13:51:05 -08:00