Commit Graph

8487 Commits

Author SHA1 Message Date
Dennis Shen
008d729b86 Merge "aconfig: add c codegen" into main am: afd8b2d75b am: 24ecb48d89 am: f91df0cd73
Original change: https://android-review.googlesource.com/c/platform/build/+/2653700

Change-Id: I973f5fd0d11a97d92fa795b074ff9a922b6065dc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-13 16:05:32 +00:00
Dennis Shen
7321f4f6f1 aconfig: add c codegen
c codegen can be done at the same time with cpp codegen, the idea is to
create a c compatible header that defines the flag apis, including flag
override apis for test. then in the corresponding cpp file, the
implementation simply calls into cpp api.

c header supports static method interface, and unit test override, but
it does not support injection pattern compared to cpp header

Bug: b/279483801
Test: atest aconfig.test
Change-Id: Ie62b76d6524e443de5d3c2f9000f7f66623ab571
2023-07-13 13:55:06 +00:00
Tiffany Yang
20dbd142b6 Merge "Make common signature system property definitions optional" into main am: b8306086d3 am: e728051f12 am: 13ba580f9f
Original change: https://android-review.googlesource.com/c/platform/build/+/2609473

Change-Id: I5014024fae5b0c896aa0898d2c71faea453677e4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-12 20:23:18 +00:00
Tiffany Yang
b8306086d3 Merge "Make common signature system property definitions optional" into main 2023-07-12 18:35:37 +00:00
Cole Faust
ef48661524 Merge "Remove BOARD_BPT* variables and the bpt parition table image" into main am: f5350e965b am: 735fe49732 am: 9aa95a1fb0
Original change: https://android-review.googlesource.com/c/platform/build/+/2654584

Change-Id: Idf53f15a27c874b1a3f628a6213da5f37a15ebbe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-12 03:41:38 +00:00
Cole Faust
f5350e965b Merge "Remove BOARD_BPT* variables and the bpt parition table image" into main 2023-07-12 01:26:51 +00:00
Cole Faust
4f3dc8759f Remove BOARD_BPT* variables and the bpt parition table image
These variables appear to never be set.

Test: Presubmits
Change-Id: If4b89376f73204ad5780dff421f1216da255c3eb
2023-07-11 16:58:06 -07:00
Tiffany Yang
19450e3a0b Make common signature system property definitions optional
This change allows ARC to define ARC-specific system properties in
Android build without changing these property definitions for other
Android builds. Please see go/arc-sigprop-changes and
go/arc-android-sigprop-sync for additional details.

Bug: 195609932
Test: built bertha_x86_64 with forward declarations
Change-Id: I22bd9d60c2491506fe5c633dbbb9e7516f529b35
2023-07-11 22:40:19 +00:00
Kelvin Zhang
73825c069b Merge "Mark extracted files as executable" into main am: f3f6d0569b am: 64f1b4f339 am: 80f171b4dc
Original change: https://android-review.googlesource.com/c/platform/build/+/2650068

Change-Id: I28d7ffb55385a5c5b5a87b6311c3b9a77a70d320
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-11 19:39:42 +00:00
Elliott Hughes
7a75419a51 Merge "Switch from minigzip to gzip." into main am: c1577ff58b am: f94ff9146d am: d9cdcba928
Original change: https://android-review.googlesource.com/c/platform/build/+/2632009

Change-Id: I9e0fe8aff864b5423a0a9c066838e76c1cea98a7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-11 18:25:43 +00:00
Kelvin Zhang
f3f6d0569b Merge "Mark extracted files as executable" into main 2023-07-11 17:39:31 +00:00
Elliott Hughes
c1577ff58b Merge "Switch from minigzip to gzip." into main 2023-07-11 15:52:27 +00:00
Treehugger Robot
32c45b78da Merge "aconfig: cpp codegen update: Move server_configurable_flags header include" into main am: db2c2d2377 am: a89218087e am: 3eccd72fa3
Original change: https://android-review.googlesource.com/c/platform/build/+/2652484

Change-Id: Ief5bc225f7fcb1be7f921a7e327fc30dc4530c22
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-11 10:38:49 +00:00
Kelvin Zhang
4cb28f6f80 Mark extracted files as executable
Python's zipfile doens't restore file permission by default, so we need
to manually restore permission.

Test: th
Bug: 290643514
Change-Id: I89c1e2ee178b534fa7e3f02afd04d170100d37e7
2023-07-10 13:03:07 -07:00
Dennis Shen
e398144643 aconfig: cpp codegen update: Move server_configurable_flags header include
Move server_configurable_flags header include away from exported header,
instead put it in the flag provider headers. Otherwise, it can cause
compilation error if the source code who wants to use the generated c flag lib has
not added dependency on server_configurable_flags yet.

Bug: b/279483801
Test: atest aconfig.test
Change-Id: Ib75877ee88f995caf72b3fd2554c3da195032c14
2023-07-10 18:19:44 +00:00
Treehugger Robot
c1b660cb76 Merge "aconfig: improve duplicate flags error message: include paths" into main am: 4fb5cb01f1 am: a41c49f15f am: 7753deff07
Original change: https://android-review.googlesource.com/c/platform/build/+/2650121

Change-Id: I0ead33b5508e075fcc35b55b24ec61b875063344
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-07 15:26:41 +00:00
Mårten Kongstad
206a382d4e aconfig: improve duplicate flags error message: include paths
Improve the error message returned when `aconfig dump` is fed multiple
declarations of the same flag: include the paths to the declaration
files.

In general all error messages from the protos::*::verify_* functions
should include paths to the offending files. This will be handled in a
follow-up CL.

Bug: 290300657
Test: atest aconfig.test
Test: manual: add duplicate flag and run `m all_aconfig_declarations`, inspect error message
Change-Id: I46dc23f7128dd5c68ced9f2e8518cfa89d81c2df
2023-07-07 08:52:52 +02:00
Wenshan Fu
8def391348 Merge "aconfig: create java libraries for aconfig proto" am: a2d93ae1eb am: c522f116cb am: 80fd7410de
Original change: https://android-review.googlesource.com/c/platform/build/+/2648125

Change-Id: I65004e5d600271caa42b011e122384f1fea07314
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-06 04:40:03 +00:00
Wenshan Fu
a2d93ae1eb Merge "aconfig: create java libraries for aconfig proto" 2023-07-06 01:51:08 +00:00
Dennis Shen
e9eb13602e Merge "cpp codegen redesign, unit test support" am: 99d4a49d68 am: 6f1c3fe881 am: 06aefcba67
Original change: https://android-review.googlesource.com/c/platform/build/+/2642133

Change-Id: Ibc32b6ac8f7e4897545cdee7c6ddb9556bceaa1d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-05 21:04:41 +00:00
Dennis Shen
8d544f7439 cpp codegen redesign, unit test support
cpp codegen iteration 2, based on discussions with three internal teams
that use c++. Refer to the design doc "aconfig c++ codegen" for detailed
design. At a high level, we generate two sets of code artifacts with the
same signatured api: one for production that without any local flag
override capability, one for unit test that allows local flag overrides.
It supports static methods style interface as well as injection pattern.

Refer to the test points in the codegen_cpp.rs for examples of generated
code.

for production target codegen: aconfig create-cpp-lib --cache <cache> --out <out dir>
for test target codegen: aconfig create-cpp-lib --cache <cache> --out
<out dir> --mode test

Bug: b/279483801
Test: atest aconfig.test
Change-Id: I92fefb9623d5435525339a74f57bbd36d0afef08
2023-07-05 14:05:44 +00:00
Wenshan Fu
89467c3109 aconfig: create java libraries for aconfig proto
Host side test infra needs the library to consume the dumped flags info
generated by aconfig.

Test: m libaconfig_java_proto_lite libaconfig_java_proto_full
Bug: 289906970
Change-Id: I9891cb8445b90f7269e0c679ceaae6bc102bbb0c
2023-07-05 13:57:19 +00:00
Wenshan Fu
7ce48d4db2 Merge "Create the TEST_MAPPING file" am: e0b709b9a6 am: 5a80e2617d am: a49ad1b8df
Original change: https://android-review.googlesource.com/c/platform/build/+/2643392

Change-Id: Icbefbf1f0a16c839653bc9b1473a7731ac9bf72c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-04 02:45:52 +00:00
Wenshan Fu
e0b709b9a6 Merge "Create the TEST_MAPPING file" 2023-07-04 00:44:05 +00:00
Zhi Dou
91e1613e28 Merge changes I4bf1d3ba,I33605054 am: 7734879e69 am: e911b7cf7c am: 45842104d2
Original change: https://android-review.googlesource.com/c/platform/build/+/2643057

Change-Id: I2eb9f781050cb95871928e308ef35ea3967ead6d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-30 15:35:38 +00:00
Zhi Dou
7734879e69 Merge changes I4bf1d3ba,I33605054
* changes:
  aconfig: Add resetAll method to test mode FeatureFlagsImpl
  aconfig: remove extra new lines and spaces in generated java code
2023-06-30 13:23:28 +00:00
Treehugger Robot
4c9218ea79 Merge "Add --classes optional flag in list_files" am: 32efc846f5 am: 46c121d2a7 am: 4c589c7216
Original change: https://android-review.googlesource.com/c/platform/build/+/2635796

Change-Id: Ia909f185c3152d6c473b9b4b2772edbd2cbfc5f1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-30 11:45:13 +00:00
Treehugger Robot
32efc846f5 Merge "Add --classes optional flag in list_files" 2023-06-30 09:36:42 +00:00
Wenshan Fu
13be0a5f98 Create the TEST_MAPPING file
Add FlagAnnotationTests in presubmit to ensure that test filtering rule
always works as expected.

Test: atest --test-mapping
Bug: 277819423
Change-Id: I7cc3a70495f8d62ed7a5b26edc4fd240e73ccf61
2023-06-30 03:28:02 +00:00
Treehugger Robot
67f93bfbdf Merge changes from topic "aconfig-package-ident-fixes" am: 9c3da21b6e am: 081d19bb1f am: e30c479502
Original change: https://android-review.googlesource.com/c/platform/build/+/2643656

Change-Id: I3e178bf26b98ca357b010f764f5687353b47eec3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-29 16:50:01 +00:00
Zhi Dou
8d27cc39b1 aconfig: Add resetAll method to test mode FeatureFlagsImpl
Add resetAll method to test mode FeatureFlagsImpl. This method
is used to reset all the flags values to null. It provides convenient
way to the test tools to reset the flags values.

Bug: 280833463
Test: atest aconfig.test
Change-Id: I4bf1d3ba69ee106ef8d0c1cc62c00bbeca1b72aa
2023-06-29 15:15:32 +00:00
Zhi Dou
a41cc5ecf9 aconfig: remove extra new lines and spaces in generated java code
Change the java template to remove the extra new lines and spaces
in generated java code.

Bug: 280833463
Test: atest aconfig.test
Change-Id: I336050540f8a2b0966bf21cf6e034a8fa701458e
2023-06-29 15:05:18 +00:00
Mårten Kongstad
19776d19e6 aconfig: package fields must contain at least one dot char
Introduce a new requirement on package fields: a package must contain at
least one dot character.

Bug: 289336036
Test: atest aconfig.test
Change-Id: Idadcd2a76783a484cc5c6d6e94778c0248fa475f
2023-06-29 10:38:02 +02:00
Mårten Kongstad
c0d618c3a4 aconfig: fix incorrect check in create_device_config_ident
Use is_valid_name_ident to check the flag name, not
is_valid_package_ident.

Bug: 283910447
Test: atest aconfig.test
Change-Id: I3718e7de565b975a1696190e8effbcb077e5fde2
2023-06-29 10:18:20 +02:00
Mårten Kongstad
60ee8a633f aconfig: improve package identifier test readability
Rearrange the tests in test_is_valid_package_ident to make it more
apparent what constitutes a valid package pattern, and what doesn't.

Bug: 283910447
Test: atest aconfig.test
Change-Id: I3d2b87aed008d0ed3a0aa6e483e655178dda7277
2023-06-29 10:03:38 +02:00
Treehugger Robot
ac8e8e12db Merge "Make test more deterministic by setting search_path to None" am: 0dc5eeaaca am: 9f5f283489 am: f2ccf043d7
Original change: https://android-review.googlesource.com/c/platform/build/+/2644790

Change-Id: Iba57b35103e5ddc43bc29b391423054292f52e08
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-29 00:37:20 +00:00
Treehugger Robot
0dc5eeaaca Merge "Make test more deterministic by setting search_path to None" 2023-06-28 22:28:28 +00:00
Jooyung Han
78d97792bf Merge changes from topic "apexd_host" am: c269ec3538 am: 9014a6dca1 am: d93dead026
Original change: https://android-review.googlesource.com/c/platform/build/+/2639710

Change-Id: I1a7185ed64f33fdadf38cad51c63722ebccd9013
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-28 20:29:22 +00:00
Jooyung Han
55f3ef3802 Deprecate flattened apexes am: 2ac1f2fabc am: 14f745b4d3 am: 69d815deb1
Original change: https://android-review.googlesource.com/c/platform/build/+/2637110

Change-Id: Id4ca986d0e48d8d1ef82b7e9eee6378e550e329d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-28 20:29:17 +00:00
Jooyung Han
14f745b4d3 Deprecate flattened apexes am: 2ac1f2fabc
Original change: https://android-review.googlesource.com/c/platform/build/+/2637110

Change-Id: I724fedfe790539efa3355ba9c2833bf4717ba4ff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-28 18:42:24 +00:00
Jooyung Han
c269ec3538 Merge changes from topic "apexd_host"
* changes:
  Use apexd_host for host-side APEX extraction
  Deprecate flattened apexes
2023-06-28 17:36:15 +00:00
Kelvin Zhang
03dc6ee96f Make test more deterministic by setting search_path to None
Test: th
Bug: 2640751
Change-Id: I9779dfa40c1e8319cb67ae0928c977f5a10cda5f
2023-06-28 10:10:39 -07:00
Zhi Dou
9f6e482d0d Merge "aconfig: add java codegen test mode" am: 514f99b205 am: a99ddd3b84 am: 5366554972
Original change: https://android-review.googlesource.com/c/platform/build/+/2638410

Change-Id: Ie6a4e474af8ae2c0e03433df7218ffff2680dba6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-28 15:30:08 +00:00
Zhi Dou
514f99b205 Merge "aconfig: add java codegen test mode" 2023-06-28 13:01:01 +00:00
Treehugger Robot
886edb56eb Merge "Fix test flake" am: 59f99b31eb am: b56b3b7b38 am: 01aeb2872c
Original change: https://android-review.googlesource.com/c/platform/build/+/2640751

Change-Id: Iade474f2717f72ee790965de8cfa4bd17d56347d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-28 03:44:24 +00:00
Treehugger Robot
59f99b31eb Merge "Fix test flake" 2023-06-28 01:18:55 +00:00
Elliott Hughes
97ad120adb Switch from minigzip to gzip.
Bug: http://b/288169261
Test: treehugger
Change-Id: I404cbcb850734ed8291c2215a4329fb372806d63
2023-06-27 15:39:05 -07:00
Zhi Dou
8ba6aa71b1 aconfig: add java codegen test mode
Add java codegen test mode. The test mode will generate Flags.java and
FeatureFlagsImpl.java differently.
    * Flags.java will have getter and setter function to switch the
      FeatureFlagsImpl. Flags.java will not initialize the instance
      of FeatureFlagsImpl during initialization, thus it will force the
      user to set up the flag values for the tests.
    * FeatureFlagsImpl removes the dependency on DeviceConfig, and
      allows the caller to set the values of flags.

Command changes
This change adds a new parameter `mode` to `create-java-lib` subcommand.
The default value of `mode` is production, which will generate files for
production usage, and keeps the same behavior as before.

The new `mode` test is added to trigger the test mode. The command is
aconfig create-java-lib --cache=<path_to_cache> --out=<out_path>
--mode=test

Test: atest aconfig.test
Bug: 288632682
Change-Id: I7566464eb762f3107142fe787f56b17f5be631b7
2023-06-27 18:57:35 +00:00
Kelvin Zhang
97a5afe0f3 Fix test flake
Test: th
Bug: 289013326
Change-Id: Ib233978ff861b010bdc3bd1a02ea9baefe6a3489
2023-06-27 10:30:48 -07:00
Jooyung Han
c9542abbbd Use apexd_host for host-side APEX extraction
Host-side simulation of APEX activation is done by a new tool
'apexd_host'. This simplies checkvintf invocation for local builds and
for target-files.

For local builds, checkvintf no londer depends on $OUT/apex, a flattened
view of APEXes. In fact, the build system doesn't need to install
$OUT/apex. They are installed for now only for its side-effect of
installing symbol files. We'd better not rely on $OUT/apex.

For target-files, scanning/activating apexes are extracted and moved to
the new tool. Now check_target_files_vintf is not more efficient because
it doesn't copy .apex files to a temporary directory.

Bug: 260358957
Bug: 288826922
Test: m (running checkvintf) # for local builds
Test: m target-files-package && check_garget_files_vintf target-files.zip
Test: atest releasetools_test
Change-Id: Iba23f429d96f9ec31814196aa14bdbb800649218
2023-06-27 17:00:06 +09:00