Commit graph

9451 commits

Author SHA1 Message Date
Gurpreet Singh
5398070941 Merge "Change build-release target for building module sdks" into main 2024-04-19 10:06:58 +00:00
Treehugger Robot
7321f6e5c5 Merge "Do not copy platform ABI dumps from current" into main 2024-04-19 07:45:11 +00:00
Hsin-Yi Chen
28e19ef89d Do not copy platform ABI dumps from current
In trunk stable, the ABI dumps in "current" directory are not what we
intend to finalize. They need to be removed. The step will be replaced
with a command that builds ABI dumps.

Ignore-AOSP-First: merge conflict
Test: build/make/tools/finalization/finalize-sdk-rel.sh
Bug: 333532038
Change-Id: I08896b637b34861e73cff4d829941d9fb5c56475
2024-04-19 03:12:55 +00:00
Treehugger Robot
e1af7846fc Merge "aflags: read protos from all containers" into main am: ac407794b9 am: 91c54cf72f
Original change: https://android-review.googlesource.com/c/platform/build/+/3001064

Change-Id: Ifd21198de67ebfe880a5bff7b90b9c8adadfdc10
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-18 18:00:10 +00:00
Gurpreet Singh
cdb07595a1 Change build-release target for building module sdks
--build-release=latest => Include all new APIs in API tracking files
along with the @FlaggedAPI annotation prefix.

--build-release=next => Include only those new APIs in API tracking
files for which the flag is enabled. Also the @FlaggedAPI annotation
prefix is removed from API tracking files.

Ignore-AOSP-first: VIC finalization happens outside AOSP
Bug: 335454564
Test: croot && build/tools/finalization/localonly-steps.sh
Change-Id: I3fdd71ac385835b3b961336d86604e86dfed31cf
2024-04-18 17:16:39 +00:00
Ted Bauer
206d44aff5 aflags: read protos from all containers
Create one library for reading protos from all containers, instead of
having numerous libraries perform the same logic. For Java, we will
create a similar library reusing the same
partition_aconfig_flags_paths.txt.

Bug: 324436145
Test: adb shell aflags list # Confirm that various containers appear
Change-Id: I924e281a50f9a609e1c07c03267eebe3dce52752
2024-04-18 14:38:41 +00:00
Dennis Shen
fa564fc6c3 Merge "aconfig: add support for local override" into main am: e6b424ad4a am: c74aecc828
Original change: https://android-review.googlesource.com/c/platform/build/+/3044414

Change-Id: Ic4b918baff3790b2166cbec3960639a7f1a3df83
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-17 19:46:57 +00:00
Dennis Shen
e6b424ad4a Merge "aconfig: add support for local override" into main 2024-04-17 19:07:56 +00:00
Treehugger Robot
42f6a65c1f Merge "check-flagged-apis: create list of @FlaggedApi errors" into main am: fde34c3b65 am: 0b27706be2
Original change: https://android-review.googlesource.com/c/platform/build/+/3042361

Change-Id: If0ddaee5a31f7001de307987dfabf439be17278e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-17 16:19:04 +00:00
Mårten Kongstad
99ad34b842 Merge "check-flagged-apis: parse API versions XML" into main am: 7978682841 am: 64fffb1e55
Original change: https://android-review.googlesource.com/c/platform/build/+/3042360

Change-Id: Ia2579c99df200fa7e82b7f2e05027f453d286567
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-17 15:04:21 +00:00
Treehugger Robot
ad88ef49e3 Merge changes I397b32ae,Ic244b896,I5ccf2a64 into main am: e24a1e4ddc am: 4b75d8fbcb
Original change: https://android-review.googlesource.com/c/platform/build/+/3042359

Change-Id: I32f0fd8bdf69dffc2eca3991a83dcea81211c267
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-17 15:04:04 +00:00
Mårten Kongstad
9238a3ab76 check-flagged-apis: create list of @FlaggedApi errors
Teach check-flagged-apis to cross-check the data from its three input
sources. This allows the tool to detect

  - @FlaggedApi references to non-existent flags
  - @FlaggedApi APIs present in the build artifacts even though the flag
    is disabled
  - @FlaggedApi APIs not present in the build artifacts even though the
    flag is enabled

By passing in different sources, the tool can detect these errors for
any of the API surfaces (public, @SystemApi(MODULE_LIBRARIES), etc).

Note: the tool assumes that a disabled flag means that the @FlaggedApi
should not be present in the build output. This is currently true, but
won't be once metalava starts reverting @FlaggedApis to their previous
SDK snapshot.

Bug: 334870672
Test: atest --host check-flagged-apis-test
Test: check-flagged-apis --api-signature out/target/product/mainline_x86/obj/ETC/frameworks-base-api-current.txt_intermediates/frameworks-base-api-current.txt --flag-values out/soong/.intermediates/all_aconfig_declarations.pb --api-versions out/dist/data/api-versions.xml
Change-Id: I790234865f831af7d45895def14d1d6740365622
2024-04-17 16:40:03 +02:00
Mårten Kongstad
b673d3bb7d check-flagged-apis: parse API versions XML
Teach check-flagged-apis to parse API versions XML; this represents the
APIs after metalava has processed the source and kept APIs as is, or
reverted them to the previous SDK snapshot, according to their
@FlaggedApi flags.

As with the API signature parser, limit support to fields to keep things
simple; support for classes and methods will be added in later CLs.

Note: `m sdk dist` will generate an API versions XML file.

Bug: 334870672
Test: atest --host check-flagged-apis-test
Test: check-flagged-apis --api-signature out/target/product/mainline_x86/obj/ETC/frameworks-base-api-current.txt_intermediates/frameworks-base-api-current.txt --flag-values out/soong/.intermediates/all_aconfig_declarations.pb --api-versions out/dist/data/api-versions.xml
Change-Id: I779a0d0cdb8a50536d3fc8d517fa38ba4b0dcd1c
2024-04-17 15:27:48 +02:00
Mårten Kongstad
387ff6cfe8 check-flagged-apis: parse flag names and values
Teach check-flagged-apis to parse the parsed_flags protobuf generated by
aconfig.

Note: `m all_aconfig_declarations` generates a protobuf file that
contains all info about all flags.

Bug: 334870672
Test: atest --host check-flagged-apis-test
Test: check-flagged-apis --api-signature out/target/product/mainline_x86/obj/ETC/frameworks-base-api-current.txt_intermediates/frameworks-base-api-current.txt --flag-values out/soong/.intermediates/all_aconfig_declarations.pb
Change-Id: I397b32ae2a373b429ef6ce22e0a06a0f15202b91
2024-04-17 15:27:48 +02:00
Mårten Kongstad
20de405dd5 check-flagged-apis: parse API signature files
Teach check-flagged-apis to extract flagged APIs from API signature files.

To keep things simple, only consider fields for now: support for classes
and methods will be added in a later CL.

Note: `m frameworks-base-api-current.txt` will generate an API signature
file that includes both the platform and mainline APIs.

Bug: 334870672
Test: atest --host check-flagged-apis-test
Test: check-flagged-apis --api-signature out/target/product/mainline_x86/obj/ETC/frameworks-base-api-current.txt_intermediates/frameworks-base-api-current.txt
Change-Id: Ic244b896672569f44af793796189b34c1f9d0c36
2024-04-17 15:27:48 +02:00
Mårten Kongstad
f242ec8989 check-flagged-apis: add unit test infrastructure
Add scaffolding for unit tests.

Bug: 334870672
Test: atest --host check-flagged-apis-test
Change-Id: I5ccf2a6424c19e739923379cdc41c359388484da
2024-04-17 15:27:45 +02:00
Dennis Shen
9f236037a2 aconfig: add support for local override
1, add a new field in storage metadata proto, for each container, there
is a local override file.

2, update write api to expose the api to map a writable file given the
specific path. the cannonical api will require a storage metadata proto,
and then find the right file path and map it.

3, minor update to make the proto lib cc_library instead of
cc_library_static

Bug: b/312444587
Test: atest -c
Change-Id: Iaf0aff44c1ca3ad4bffc5e06bb99bb276b9069c5
2024-04-17 12:25:11 +00:00
Treehugger Robot
a9a0e6bdda Merge "check-flagged-apis: add Flag value class" into main am: 7b986ab345 am: f1cdb5e191
Original change: https://android-review.googlesource.com/c/platform/build/+/3042357

Change-Id: I45cf985842e24d2cb25aa34de5b05257c932fe91
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-17 09:46:50 +00:00
Treehugger Robot
34a9212b3c Merge "check-flagged-apis: add Symbol value class" into main am: 1dbe48454d am: 93c8f51704
Original change: https://android-review.googlesource.com/c/platform/build/+/3042356

Change-Id: I28e4cada01d7d5b2da6bbd98e2c64648755616c9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-17 09:46:34 +00:00
Mårten Kongstad
dc3fc2e0bc check-flagged-apis: add Flag value class
Add a value class to represent Flag names. We could use plain Strings
but having a dedicated class (with no overhead compared to String) makes
the intent of the code much clearer.

Bug: 334870672
Test: m check-flagged-apis && check-flagged-apis
Change-Id: Icdd4fb97d3fd49e507b7559504ea173a3dc52dea
2024-04-17 09:54:53 +02:00
Mårten Kongstad
e0179976cd check-flagged-apis: add Symbol value class
check-flagged-apis will read contents from various sources, which use
different formats to represent the same piece information (e.g.
"class#field" or "<class><field>").

Introduce a Symbol value class to represent any API (i.e. a class, field
or method) in a unified format.

Bug: 334870672
Test: m check-flagged-apis && check-flagged-apis
Change-Id: Id9404294a87b23a9d43e5e13ce39ea5a92608e33
2024-04-17 09:54:53 +02:00
Mårten Kongstad
8438d12ea1 Merge "check-flagged-apis: add support for command line options" into main am: 4feb33fefc am: 25393a4955
Original change: https://android-review.googlesource.com/c/platform/build/+/3042355

Change-Id: I08c45d6899b0f23c5c46e5364c940a10192bcbcc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-17 06:24:36 +00:00
Mårten Kongstad
4b2b0c4246 Merge "check-flagged-apis: add new CLI to verify @FlaggedApi APIs" into main am: e2ec38c51b am: 44f92d4b0b
Original change: https://android-review.googlesource.com/c/platform/build/+/3042354

Change-Id: I4cfeeaa7fe52d225970f3d40e6f1092fcf6ff89d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-17 06:24:17 +00:00
Mårten Kongstad
4feb33fefc Merge "check-flagged-apis: add support for command line options" into main 2024-04-17 05:52:09 +00:00
Mårten Kongstad
e2ec38c51b Merge "check-flagged-apis: add new CLI to verify @FlaggedApi APIs" into main 2024-04-17 05:51:48 +00:00
Daniel Zheng
9580af9911 Merge "ota_from_target_files: read correct api level" into main am: 2fc519a568 am: 886f178340
Original change: https://android-review.googlesource.com/c/platform/build/+/3031704

Change-Id: I71059940a78c6ed0fdc02ccd53eb62e25cb19b57
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-16 20:16:33 +00:00
Daniel Zheng
2fc519a568 Merge "ota_from_target_files: read correct api level" into main 2024-04-16 19:32:37 +00:00
Daniel Zheng
dc411eda4c ota_from_target_files: read correct api level
ro.product.first_api_level looks like the value we actually want to read
to since it inherits from $PRODUCT_SHIPPING_API_LEVEL. Other variables
we attempted to look at were giving other values (e.g 202504 for pixel
watch)

Bug: 331202590
Test: th
Change-Id: Ied3da247cba45611132db6c9e3cdefb447891f96
2024-04-16 12:32:05 -07:00
Mårten Kongstad
acfeb11d86 check-flagged-apis: add support for command line options
Use clikt as the command line options parser library.

Bug: 334870672
Test: m check-flagged-apis && check-flagged-apis
Change-Id: I7c406456b00e29293294dcdbef411d2543a1e8d5
2024-04-16 10:32:17 +02:00
Mårten Kongstad
9008724b50 check-flagged-apis: add new CLI to verify @FlaggedApi APIs
Add a new CLI to verify that the build artifacts contain the right set
of @FlaggedApi APIs, based on the value of the corresponding aconfig
flag.

This CLI will act as an end-to-end test of Soong and metalava.

This CL only adds the project scaffolding; later CLs will add the
implementation.

Bug: 334870672
Test: m check-flagged-apis && check-flagged-apis
Change-Id: Ib00653f2a549217da2b0058867c711f35efd5760
2024-04-16 10:32:17 +02:00
Treehugger Robot
fb30407477 Merge "Make output of MakeVbmeta consistent" into main am: 8b1e29ae7e am: 8466afaa6d
Original change: https://android-review.googlesource.com/c/platform/build/+/3042632

Change-Id: Ic6a994cf5ab9c46fa6b045e4c6a300031192eee2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-15 23:13:22 +00:00
Treehugger Robot
8b1e29ae7e Merge "Make output of MakeVbmeta consistent" into main 2024-04-15 22:27:36 +00:00
Ted Bauer
1dce401c1b Merge "aconfig: switch read api lib to cc_library" into main am: 8f9ca8075f am: 725fe1bde4
Original change: https://android-review.googlesource.com/c/platform/build/+/3038459

Change-Id: Ic444325de162d60e8eb4d1851c47e019ce070d53
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-15 17:59:23 +00:00
Ted Bauer
8f9ca8075f Merge "aconfig: switch read api lib to cc_library" into main 2024-04-15 17:22:00 +00:00
Kelvin Zhang
1d9b3daad2 Make output of MakeVbmeta consistent
The order of items in `partitions` map is non-deterministic. To make
sure that builds are hermetic, sort the map before use.

Test: th
Bug: 332550989
Change-Id: I76c7037ef9f03904899339813819fcf985a7c893
2024-04-15 09:45:03 -07:00
Mårten Kongstad
0639129bd8 Merge "finalization: do not generate the ADB keys" into main 2024-04-15 06:17:40 +00:00
Dennis Shen
36661d4cd0 aconfig: switch read api lib to cc_library
Bug: b/321077378
Test: atest -c
Change-Id: I8d64396797b01a8ce2f4bee165596701940836e4
2024-04-12 21:21:44 +00:00
Dennis Shen
b2badb4cc9 Merge "aconfig: add write api cpp test to presubmit" into main am: 7d642b10df am: c8203a5992
Original change: https://android-review.googlesource.com/c/platform/build/+/3038457

Change-Id: Ia557d5ba8b9f151d27023936bf4c01ce4d608465
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-12 19:05:15 +00:00
Dennis Shen
7d642b10df Merge "aconfig: add write api cpp test to presubmit" into main 2024-04-12 18:26:55 +00:00
Dennis Shen
b835cfefe0 Merge "aconfig: update flag info query api" into main am: 65610a10d5 am: 625fd83d28
Original change: https://android-review.googlesource.com/c/platform/build/+/3038554

Change-Id: I37c178584c264b7fc8dbd0f12664996dcb4f74bf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-12 18:24:50 +00:00
Dennis Shen
e8fa42f45a aconfig: add write api cpp test to presubmit
Bug: b/321077378
Test atest -c

Change-Id: Ib04280f25eb6c4de6ff1523579e6ac96a868ff1d
2024-04-12 16:57:28 +00:00
Dennis Shen
f17dbcd8b7 aconfig: update flag info query api
Currently flag info query api is called get_boolean_flag_attribute, in
this change, we switched it over to a flag value type generic
implementation get_flag_attribute. So in the future we want to add more flag value types, this api can stay the same.

Bug: b/312444587
Test: atest -c
Change-Id: I2b272f3fa3cb1d0edc8b77a44bf37752ffe95925
2024-04-12 16:28:10 +00:00
Treehugger Robot
b20ed2dd34 Merge "Ensure insertion order of Python dict" into main am: ab494001f3 am: e0be9728b7
Original change: https://android-review.googlesource.com/c/platform/build/+/3030903

Change-Id: I15bc3a86a993367e83467cfcd948aed94e2e43f8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-12 13:40:07 +00:00
Mårten Kongstad
023fa5dc17 finalization: do not generate the ADB keys
The ADB keys have already been generated for Android 15. Remove that
step from the scripts.

Bug: 323940469
Test: TH
Ignore-AOSP-first: VIC finalization happens outside AOSP
Change-Id: I83184740bfc1db3104e320b76638253a5892507c
2024-04-12 14:31:12 +02:00
Nariyasu Heseri
5ffefcc642 Ensure insertion order of Python dict
Add keys to the dict `partitions` in serial to have a deterministic
insertion order.
This guarantees the generated vbmeta.img is always the same on the same
input, fixing image consistency issues.

Reference:
https://android-review.googlesource.com/c/platform/build/+/2585397

Bug: 332550989
Test: Generate vbmeta several times, confirm identical result.
Change-Id: I39da5844045f497fdc89e6477a7e32ddacb70764
2024-04-12 07:57:37 +00:00
Dennis Shen
3ab7e01147 Merge changes from topic "flag_info_write" into main am: 82546539f1 am: c54746ed31
Original change: https://android-review.googlesource.com/c/platform/build/+/3034972

Change-Id: I87da3e3229c176eddc9f3947ef5e43ca8e3aff84
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-11 20:59:54 +00:00
Dennis Shen
d74941b42d aconfig: create flag info file write c api
Bug: b/312444587
Test: atest -c
Change-Id: I310e1ed727ced454bec2016afe48f7a29561fac3
2024-04-11 20:23:22 +00:00
Dennis Shen
4647c0e1f0 aconfig: create flag info file write rust api
Bug: b/312444587
Test: atest aconfig_storage_write_api.test; atest
aconfig_storage_write_api.test.rust

Change-Id: Icbedc78ae78b2c7590539f008521c507c2b3df5b
2024-04-11 20:23:00 +00:00
Dennis Shen
5cb8964602 Merge changes from topic "index_instead_of_offset" into main am: d22eee50fa am: b59fa6c291
Original change: https://android-review.googlesource.com/c/platform/build/+/3031653

Change-Id: I05b63817f2d55ecb01ace820ba94ec78f641eb35
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-04-10 19:02:17 +00:00
Dennis Shen
d22eee50fa Merge changes from topic "index_instead_of_offset" into main
* changes:
  aconfig: update storage write api
  aconfig: update storage read api
  aconfig: update storage file creation to allow storage files to store flag index instead of byte offset
  aconfig: update storage file to store flag index instead of file byte offset
2024-04-10 18:53:43 +00:00