Commit graph

76464 commits

Author SHA1 Message Date
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
Yu Liu
4c27146e4c Merge "Properly package aconfig files for product and system_ext partitions" into main 2023-12-19 00:40:03 +00: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
8070c4b457 Merge "Only include exported flags in android-flags.jar" into main 2023-12-18 20:31:31 +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
Ludovic Barman
cd11c9535f Merge "Rust protobuf 2->3: Update build system" into main 2023-12-16 06:20:12 +00:00
Cole Faust
db0eeb5bdd Merge "Sandbox camera-its" into main 2023-12-15 21:57:29 +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
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
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
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
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
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
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
a1df1a5937 Merge "Properly package aconfig files for vendor partition" into main 2023-12-14 19:14:11 +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
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
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
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
a1eb34a709 Merge "Reapply "Handle symlinks in sbox"" into main 2023-12-13 17:47:07 +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
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
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
fa6995f75e Merge "Remove infrastructure to run bp2build" into main 2023-12-12 20:03:58 +00:00
Wei Li
c1fb159206 Merge "Build native libraries used by layoutlib." into main 2023-12-12 16:18:16 +00:00
Mårten Kongstad
18c95ecab9 Merge "Add exported_java_aconfig_library" into main 2023-12-12 09:46:05 +00:00
Wei Li
5f5d271fc3 Build native libraries used by layoutlib.
Bug: 303904212
Test: m layoutlib dist; CIs
Change-Id: Id77cba97b2f66997431beb78ecc9d9b74b64b803
2023-12-12 05:06:20 +00:00
Treehugger Robot
4e8a7e9974 Merge "Remove extra go.mod files" into main 2023-12-12 04:00:32 +00:00
Colin Cross
e8da10aae0 Remove extra go.mod files
Only the top level build/soong/go.mod file should exist, any extras
breaks `go test ./...` in build/soong, and also breaks the kythe build
that produces xrefs for code search.

Bug: 315537199
Test: go test ./...
Change-Id: Id5262550654ff1559cfb3fa1ecdae95c126109df
2023-12-12 03:02:33 +00:00
Yu Liu
cec0e410cd Support rust modules when packaging aconfig files in apex.
Also remove the code to package aconfig files for transitive
dependencies since those files should have already been included in the
direct dependencies.

Bug: 311173471
Test: Unit tests
Change-Id: I25637af9381f71a78b70a8de9894618188c9735d
2023-12-11 17:43:07 -08: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