Commit graph

77365 commits

Author SHA1 Message Date
Ludovic Barman
19739bf6a5 Rust protobuf 2->3: Update build system
tldr: remove protobuf2 from Android Rust and upgrade everything to pb3.

These commits update:
- The grpcio rust crate to use protobuf 3
- The build system to always use the new libprotobuf (pb3) instead of the _deprecated variant (for pb2); they also force-enable libprotobuf everywhere, ignoring the use_protobuf3 flag, removes the tests related to pb2
- The following modules, which required syntax changes:
-- packages/modules/Bluetooth
-- device/google/cuttlefish
-- vendor/auto

Bug: 308790516
Test: m rust
Ignore-AOSP-First: must be done in main to upgrade cuttlefish+vendor with the rest all at once
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:7d0783ce22b3d7d369786d4b16067c79c033185b)
Merged-In: I1d07c433aca41ccfe2e710821cf930c413dc12d6

Change-Id: I1d07c433aca41ccfe2e710821cf930c413dc12d6
2023-12-15 13:23:33 +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
Cole Faust
1a772fbf5a Merge "Reapply "Handle symlinks in sbox"" into main am: b0a21dc871 am: f64f9f5be6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2876597

Change-Id: Idad68304b289ac5841e2b84932f3e4289c0aad9a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-15 02:58:31 +00:00
Cole Faust
f64f9f5be6 Merge "Reapply "Handle symlinks in sbox"" into main am: b0a21dc871
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2876597

Change-Id: I83d57fccedf5ad0b7249ec945a069b4d9b406333
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-15 02:27:53 +00:00
Cole Faust
b0a21dc871 Merge "Reapply "Handle symlinks in sbox"" into main 2023-12-15 02:00:40 +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
ca355af1fc Reapply "Handle symlinks in sbox"
This reverts commit 6a855191bd.

Reason for revert: Last issue fixed with aosp/2875001

Change-Id: I961ea6d97c936df8a6475995b768a7eda861e6ee
2023-12-14 23:38:38 +00:00
Cole Faust
86aa4a45be Merge "Add sdk_genrule" into main am: 0d6bb34801 am: 0d3d2fd617
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2871228

Change-Id: Id714b2293f6ae31e05058199059a32480a67a536
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-14 22:51:55 +00:00
Cole Faust
b6b09c2d53 Merge "Allow compile_data on all java modules" into main am: c01104234e am: 1a09b13d93
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2875178

Change-Id: I7ad268e9a75c0d01e6bc1b1ac8de4be9dccdadd8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-14 22:50:22 +00:00
Cole Faust
0d3d2fd617 Merge "Add sdk_genrule" into main am: 0d6bb34801
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2871228

Change-Id: I159924525ba338799500cdac03fc9c612875b493
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-14 22:20:38 +00:00
Cole Faust
1a09b13d93 Merge "Allow compile_data on all java modules" into main am: c01104234e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2875178

Change-Id: I43abbf6833fade5aa91906a11c79a94d1bd38b50
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-14 22:19:16 +00:00
Cole Faust
0d6bb34801 Merge "Add sdk_genrule" into main 2023-12-14 21:58:10 +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
59d425941b Merge "Properly package aconfig files for vendor partition" into main am: a1df1a5937 am: 10d22de5d3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2875174

Change-Id: I0f8d8e3e585cc3b3e5b64ddff16c880b75f62e2d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-14 20:24:04 +00:00
Yu Liu
10d22de5d3 Merge "Properly package aconfig files for vendor partition" into main am: a1df1a5937
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2875174

Change-Id: Ia9619b2acb34c6d2f3746619bfcc86aebe7645e1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-14 19:52:37 +00:00
Yu Liu
a1df1a5937 Merge "Properly package aconfig files for vendor partition" into main 2023-12-14 19:14:11 +00:00
Treehugger Robot
251f9229f5 Merge "Revert "Handle symlinks in sbox"" into main am: a53330a525 am: 35c138a662
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2874577

Change-Id: I3184833ae4ea082b07e664164d2fe031cfe3f701
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-14 02:58:27 +00:00
Treehugger Robot
35c138a662 Merge "Revert "Handle symlinks in sbox"" into main am: a53330a525
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2874577

Change-Id: I307dff0c64123fd005b2663bf4c09f0a7440c88b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-14 02:27:47 +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
Treehugger Robot
a53330a525 Merge "Revert "Handle symlinks in sbox"" into main 2023-12-14 01:58:17 +00:00
Treehugger Robot
02064ab57c Merge "Enable Soong's tradefed_binary to support multi-arch" into main am: 453afad7b5 am: 36a499100d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2849275

Change-Id: I22a3901813e89f14dcb0a210dc5ed2ee013a59c6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-14 01:52:39 +00:00
Treehugger Robot
36a499100d Merge "Enable Soong's tradefed_binary to support multi-arch" into main am: 453afad7b5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2849275

Change-Id: I8e4fb6db12940f7653831b228eb1d3e2b766a85f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-14 01:22:10 +00: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
453afad7b5 Merge "Enable Soong's tradefed_binary to support multi-arch" into main 2023-12-14 00:55:37 +00:00
Treehugger Robot
fe315bd5aa Merge "Avoid -target riscv64-linux-androidVanillaIceCream." into main am: 3e22fe2193 am: 2553359fcb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2871232

Change-Id: Id5526081335a429fc01933fa317ce7bc8f63f242
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-13 23:56:36 +00:00
Cole Faust
6a855191bd Revert "Handle symlinks in sbox"
This reverts commit 14a2362183.

Reason for revert: Breaks art tests on errorprone build

Change-Id: I2e21867fba6c8c1660ffa564273b6200c63221f3
2023-12-13 23:48:11 +00:00
Treehugger Robot
2553359fcb Merge "Avoid -target riscv64-linux-androidVanillaIceCream." into main am: 3e22fe2193
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2871232

Change-Id: Ic1815dba0d4585177009052d33d19b7c8961ecc2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-13 23:26:47 +00:00
Cole Faust
776146b3f4 Sandbox camera-its
It was fixed with aosp/2866315.

Bug: 307824623
Test: ./build/soong/tests/genrule_sandbox_test.py camera-its
Change-Id: Iaf3871682e99ceb7161c159acb757ce2949f5b3d
2023-12-13 15:15:26 -08:00
Treehugger Robot
3e22fe2193 Merge "Avoid -target riscv64-linux-androidVanillaIceCream." into main 2023-12-13 22:48:56 +00:00
Cole Faust
8fc38f3761 Add sdk_genrule
Some users want to repackage the results of an sdk module.
Genrules have 3 variants: linux, android, and common_os. The common_os
one produces a snapshot zip file that users want. In order to get
access to it, we need a genrule in the same variant, so create
an sdk_genrule for that.

The sdk_genrule shouldn't have linux/android variants either, because
those other variants would get errors when trying to depend on the
sdk modules because the snapshot zip doesn't exist in those other
variants. The code in arch.go needs to be tweaked to allow a common_os
variant without the other variants.

Bug: 315962165
Test: m dist out/dist/art_release.zip
Change-Id: Idc9b3cae7a525d71aed6bafa0f8724a89f75a94b
2023-12-13 14:11:24 -08:00
Elliott Hughes
a19d9597cb Avoid -target riscv64-linux-androidVanillaIceCream.
clang silently ignores such things rather than reporting them as errors.

With this change, verbose.log.gz says android10000 instead, as expected.

Bug: https://buganizer.corp.google.com/issues/315788463#comment24
Test: treehugger
Change-Id: I0d92b0747912f28065de0d2dc6b4d33d1c2c9857
2023-12-13 12:10:28 -08:00
Cole Faust
e485f19ec3 Merge "Reapply "Handle symlinks in sbox"" into main am: a1eb34a709 am: 50bf81caef
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2866315

Change-Id: I35697395eb8a3f0a641b8f9dd6b68f9f0bcfc1c2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-13 19:01:00 +00:00
Cole Faust
50bf81caef Merge "Reapply "Handle symlinks in sbox"" into main am: a1eb34a709
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2866315

Change-Id: Ic6d8bccf6fda80c325476c731695b56e85725538
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-13 18:30:53 +00:00
Cole Faust
a1eb34a709 Merge "Reapply "Handle symlinks in sbox"" into main 2023-12-13 17:47:07 +00:00
Treehugger Robot
7a8621f3a1 Merge "Update wording on depfile property error" into main am: e25374a962 am: f5030737a6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2871077

Change-Id: Ia03d6acca0c99a08f41098e855214a573c7ffa78
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-13 04:25:04 +00:00
Treehugger Robot
f5030737a6 Merge "Update wording on depfile property error" into main am: e25374a962
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2871077

Change-Id: I48104401036f6a771708dd6e1fa410d0719b4f93
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-13 03:55:03 +00:00
Treehugger Robot
e25374a962 Merge "Update wording on depfile property error" into main 2023-12-13 03:03:47 +00:00
Nelson Li
8efd580eb1 Enable Soong's tradefed_binary to support multi-arch
The original `tradefed_binary_host` in Soong always used the host OS
architecture when writing the `arch` in `test-suite-info.properties`.
This change introduces the `Suite_arch` attribute in
`tradefed_binary_host`, allowing users to specify the architecture
for `test-suite-info.properties`.

Bug: 313535357
Test: 1. Add property of `suite_arch` in the Android.bp
      2. m cts-tradefed
      3. check `test-suite-info.properties` in cts-tradefed.jar
Change-Id: Ib95db4e0e8d238c9bb8a2a3fffea606fa6a764ce
2023-12-13 02:53:22 +00:00
Treehugger Robot
0e02a14a2b Merge "Use --revert-annotation instead of --hide-annotation" into main am: 550a0dab0d am: f384a08950
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2870808

Change-Id: I9078057e5c26906bc7e9e8df4cdfe023957ae3b1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-13 02:29:24 +00:00
Cole Faust
27609f15ff Update wording on depfile property error
Bug: 307824623
Test: Presubmits
Change-Id: I25919150d2ee2483099e7cb710330dc259d57e66
2023-12-12 18:10:36 -08:00
Treehugger Robot
f384a08950 Merge "Use --revert-annotation instead of --hide-annotation" into main am: 550a0dab0d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2870808

Change-Id: I8b23da88de4671f30e29440e78f2d7a26fcec348
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-13 01:56:53 +00:00
Treehugger Robot
550a0dab0d Merge "Use --revert-annotation instead of --hide-annotation" into main 2023-12-13 01:24:27 +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
Treehugger Robot
d9c2df9601 Merge "Remove infrastructure to run bp2build" into main am: fa6995f75e am: 1fbc110ba7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2864664

Change-Id: Ia1bd5124ea3e7b347391a6ae0aa3ba861d96405a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-12 21:15:13 +00:00