Commit graph

8475 commits

Author SHA1 Message Date
Mårten Kongstad
9c59c31499 aconfig: add Java integration tests
Add integration tests for Java. This test setup verifies that

  - the build system calls aconfig to generate a Java library
  - the Java test compiles against the auto-generated library
  - the auto-generated code returns expected values

Similar integration tests for C++ and Rust will be added in follow-up
CLs.

Note: the build does not currently support specifying that
tests/*.values should be applied, so the test flags will all be assigned
the defaults. A later CL will fix this.

Bug: b/283911467
Test: atest aconfig.test aconfig.test.java
Change-Id: Ia365e209261f4935a23e2dac9ef0ab5b60f76e52
2023-06-09 09:59:21 +02:00
Treehugger Robot
980458ae17 Merge "fixup! Allow ota_from_target_file to work entirely on directories" am: d60dbf9773
Original change: https://android-review.googlesource.com/c/platform/build/+/2617616

Change-Id: I093dccc54174e68f282d9a0f79e6a5ba7f2555ea
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-08 23:08:30 +00:00
Treehugger Robot
d60dbf9773 Merge "fixup! Allow ota_from_target_file to work entirely on directories" 2023-06-08 22:20:30 +00:00
Mårten Kongstad
5c4398ba52 Merge changes from topic "aconfig-rename-namespace-to-package" am: ec5da68dbd
Original change: https://android-review.googlesource.com/c/platform/build/+/2617393

Change-Id: Ia24fee81a09ad3dd8bbecabfab38359b1d6cceb5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-08 16:13:24 +00:00
Mårten Kongstad
ec5da68dbd Merge changes from topic "aconfig-rename-namespace-to-package"
* changes:
  aconfig: include namespace in create-device-config-defaults
  aconfig: improve code diffs in tests
  aconfig: add namespace field to flag_declaration and parsed_flag
  aconfig: allow dots in package fields
  aconfig: rename namespace -> package
2023-06-08 15:12:10 +00:00
Håkan Kvist
b8982fc538 fixup! Allow ota_from_target_file to work entirely on directories
The following log message would always be shown:
WARNING : Cannot find care map file in target_file package

Break out of the care map copying loop as soon a file has been
copied. This ensures that else statement is only executed if no
care map file exists.

Test: Manual. Run ota_from_target_files with target-zip with and
    without care map files.
Change-Id: Ia196aa182ed81f21424317a7005f5634866b4b99
2023-06-08 15:17:57 +02:00
Mårten Kongstad
202102f7be aconfig: include namespace in create-device-config-defaults
Update the output format of create-device-config-defaults to include the
flag's namespace. Also change the delimiters. The new format is

  <namespace>:<package>.<flag-name>=[enabled|disabled|

Bug: 285468565
Test: atest aconfig.test
Change-Id: I9b4ca1611cca8528dc341fc12812b614c86f6c08
2023-06-08 11:28:09 +02:00
Mårten Kongstad
b025507857 aconfig: improve code diffs in tests
Implement a helper function to make it easier for unit tests to diff
(and find the first difference) generated code and expected code.

Bug: 283910447
Test: atest aconfig.test
Change-Id: I460e8fbf05e8f33e8a62ecef67b2d9d77051e876
2023-06-08 11:27:59 +02:00
Mårten Kongstad
066575b95f aconfig: add namespace field to flag_declaration and parsed_flag
Add a new field to the proto messages flag_declaration and parsed_flag.

The new field will be used verbatim as a parameter when calling
DeviceConfig.getBoolean to read the value of a READ_WRITE flag. See the
DeviceConfig API for more info.

Note: not to be confused with the old namespace field, which has been
renamed to package.

Bug: 285211724
Test: atest aconfig.test
Change-Id: I2181be7b5e98fc334e5277fb5f7e386f1fe0b550
2023-06-08 11:27:57 +02:00
Mårten Kongstad
fbd71e2773 aconfig: allow dots in package fields
Allow package fields to include dots.

Update the generated code based on the package name: if the package name
is com.android.example:

  - java: package com.android.example; ...
  - C++: namespace com::android::example { ... }
  - Rust: mod com { mod android { mod example { ... } } }

Also, update examples to use dots in the package fields.

Also, remove unnecessary #include from the auto-generated C++ code: the
header should not include itself.

Bug: 285000854
Test: atest aconfig.test
Change-Id: I8a5352e25c64c34dee0725202a1b7c9957819de8
2023-06-08 11:25:43 +02:00
Devin Moore
0d3d349885 Merge "Add new script to analyze static/shared library usage" am: 9bf17fd9dd
Original change: https://android-review.googlesource.com/c/platform/build/+/2590128

Change-Id: I6fced63d717ea4b5cfff7fff0a4e00e0e3a6deba
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-07 20:55:17 +00:00
Devin Moore
9bf17fd9dd Merge "Add new script to analyze static/shared library usage" 2023-06-07 20:18:09 +00:00
Treehugger Robot
295a2df7cd Merge "Resolve test crash in build/make/tools/compliance." am: 69227ff9ae
Original change: https://android-review.googlesource.com/c/platform/build/+/2619070

Change-Id: I28a58137fe08032a88da937a8bb412eeb0766dc6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-07 18:19:52 +00:00
Jingwen Chen
376b6b6378 Resolve test crash in build/make/tools/compliance.
Test: m compliance_sbom
Test: go test ./...
Fixes: 285157766
BUG: 282746032
Change-Id: I5cc39f45f7ac3d9c574e2ebaa7fdfda864cb109d
2023-06-07 13:06:13 +00:00
Mårten Kongstad
9fb58965af aconfig: rename namespace -> package
What used to be referred to as a namespace is now called a package.

This CL is a semantic change only.

Bug: 285000854
Test: m nothing
Test: atest aconfig.test
Change-Id: If3fca67c415af75b44f316e16666b97089407069
2023-06-07 14:53:04 +02:00
Treehugger Robot
2960cffd7b Merge changes from topic "aconfig-gen-device-config-files" am: 2bb714ed2b
Original change: https://android-review.googlesource.com/c/platform/build/+/2613433

Change-Id: I06f9c490eea3026808db32a80b3f2f2e2909050f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-07 10:35:09 +00:00
Treehugger Robot
2bb714ed2b Merge changes from topic "aconfig-gen-device-config-files"
* changes:
  aconfig: add create-device-config-sysprops command
  aconfig: add create-device-config-defaults command
  aconfig: add test utilities
  aconfig: cache.rs: remove unnecessary use statements
  aconfig: give commands ownership of all arguments
2023-06-07 09:50:23 +00:00
Treehugger Robot
976a36fb8e Merge "Use python based unzip function for portability" am: 3cda7834aa
Original change: https://android-review.googlesource.com/c/platform/build/+/2615433

Change-Id: Id10787e68ac4a0a6ea0ada47a24f46dd7e128915
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-06 19:08:34 +00:00
Treehugger Robot
4c357806a3 Merge "Always set a avb salt for hermetic build" am: fff48d788f
Original change: https://android-review.googlesource.com/c/platform/build/+/2613794

Change-Id: I3feffd1c65f8e92e7c6a6c6e0481e206b28ec8dd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-06 19:07:16 +00:00
Kelvin Zhang
7c9205b008 Use python based unzip function for portability
Bug: 283033491
Test: th
Change-Id: Ief86b55c1d4a14220a0fb593c583a721d59cf86c
2023-06-05 15:54:12 -07:00
Devin Moore
bd13e63e99 Add new script to analyze static/shared library usage
Parses module-info.json, gathers stats on how many times each library is
included shared or statically.

Can print a list of libraries that would be a candidate for changing
from static to shared or visa versa.

Test: m
Bug: 280829178
Change-Id: I4bbffbd673ab2e08c69d0ab6e68402be77c9ffbc
2023-06-05 20:23:36 +00:00
Kelvin Zhang
c819b29f46 Always set a avb salt for hermetic build
When building images via `m` , build_image.py is invoked directly
without going through add_img_to_target_files. To ensure images built in
either way are identical, move uuid/salt computation to build_image.py,
so that the same uuid/salt will be used.

Bug: 281960439
Test: m installclean && m && m target-files-dir , maks sure images in
$OUT and $OUT/obj/PACKING/target_files_intermediates are identical

Change-Id: Icdab29df84f5a0ec7c080f99f9fdbdc3c9b10b90
2023-06-05 09:59:54 -07:00
Treehugger Robot
8f26a9ca1d Merge "Adding option to disable fastboot_info" am: ecf635f507
Original change: https://android-review.googlesource.com/c/platform/build/+/2612133

Change-Id: I45872eab4df9b1044ff6a6fb1c582f5cd316a365
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-03 02:42:53 +00:00
Treehugger Robot
ecf635f507 Merge "Adding option to disable fastboot_info" 2023-06-03 01:56:41 +00:00
Dennis Shen
8c1cce4e39 Merge "aconfig: update rust code gen to use libflags_rust" am: 3b0ca61d36
Original change: https://android-review.googlesource.com/c/platform/build/+/2607428

Change-Id: I5f100c044c906f06714ad1b4acbcbea83048a770
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-02 15:48:31 +00:00
Dennis Shen
3b0ca61d36 Merge "aconfig: update rust code gen to use libflags_rust" 2023-06-02 15:13:40 +00:00
Mårten Kongstad
c31a6ff653 aconfig: add create-device-config-sysprops command
Add a new "create-device-config-sysprops" command that works like
"create-device-config-defaults" but for system properties.

DeviceConfig is a Java service, and will mirror (some of) its values by
setting system properties in the persist.device_config namespace. Native
code will access DeviceConfig (actually, the system properties) via the
server_configurable_flags library.

The new command writes a file that can be appended to /system/build.prop
to pre-populate persist.device_config before DeviceConfig has started.

Like create-device-config-defaults, the new command skips READ_ONLY
flags.

Bug: 285468565
Test: atest aconfig.test
Change-Id: I311c7c5e0b03dc897b09204137d43cc182324717
2023-06-02 16:47:04 +02:00
Mårten Kongstad
f02734e915 aconfig: add create-device-config-defaults command
DeviceConfig is the backend for READ_WRITE flags.

Add a new command "create-device-config-defaults" to create a file that
DeviceConfig will read to pre-populate its data store on first init.

This will be used to quickly switch flag values during CI tests:
rebuilding and reflashing a device would have the same effect, but would
be costlier. This feature is not expected to be used outside CI tests.

Note: because DeviceConfig only works with READ_WRITE flags, the
generated file excludes READ_ONLY flags.

Bug: 285468565
Test: atest aconfig.test
Change-Id: I4caff1a10647b8da0ce4e3615678993a957a92dd
2023-06-02 16:46:28 +02:00
Mårten Kongstad
83a8760bbc aconfig: add test utilities
Create a test utility function to create a Cache from the files in
testdata/*. A follow-up CL will update the unit tests to use this
instead of creating their own caches.

Bug: 283910447
Test: atest aconfig.test
Change-Id: Ice5064eadb0babde5eb38d292330d213ab136d96
2023-06-02 12:54:22 +02:00
Mårten Kongstad
1cd166cd31 aconfig: cache.rs: remove unnecessary use statements
Remove unnecessary use from the cache::test module: they already covered
by `use super:*;`.

Bug: 283910447
Test: atest aconfig.test
Change-Id: I9e03385629f38180c0f92080c7f097a8e0d9ef69
2023-06-02 12:52:48 +02:00
Mårten Kongstad
b27f2ce436 aconfig: give commands ownership of all arguments
Pass the Cache argument to command::create_<lang>_lib functions by value
instead of by reference, to align with other commands.

The intended ownership flow is as follows:

  - main creates objects based on command line arguments
  - main hands commands ownership of the objects
  - command processes the objects
  - command gives main ownership of any generated output
  - main writes the output to file

Rationale: commands.rs is a unit testable version of main, and to the
rest of aconfig, acts as the top level entry point; main.rs exists only
to parse command line arguments and perform I/O.

Bug: 283910447
Test: atest aconfig.test
Change-Id: I1e1dea7da8ecc2bb6e2f7ee4a6df64562c148959
2023-06-02 12:49:26 +02:00
Treehugger Robot
b5535214ad Merge "Open ab_partitions.txt with just read access" am: f9a6f5f06b
Original change: https://android-review.googlesource.com/c/platform/build/+/2611511

Change-Id: I075bf60c1586dd0af5d39cc23db97e9ae5c5532d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-06-01 22:42:53 +00:00
Daniel Zheng
ee10d07057 Adding option to disable fastboot_info
Fastboot_info can be disabled if use_fastboot_info is set to false.
Adding this flag as fastboot-info.txt is currently broken

Test: m updatepackage -> inspect contents
Bug: 284263071
Change-Id: I3e0ca13968ba9747cc39284ea6798981d22ad5e5
2023-06-01 14:21:58 -07:00
Kelvin Zhang
89b87f6aa9 Open ab_partitions.txt with just read access
We don't actually need write permission, so going with least privilege
principle. We have observed some mysterious permission denied errors on server environments. Without detailed logs or access to the server it's hard to pinpoint what the root cause is. This is an attempt/hypothesis to fix the permission denied error.

Test: th
Bug: 283033491
Change-Id: I52dc360d593aab57c749109994bf3e1e3625d0ce
2023-06-01 17:28:25 +00:00
Dennis Shen
6461673140 aconfig: update rust code gen to use libflags_rust
Bug: b/284096062, b/279483360
Test: atest aconfig.test
Change-Id: I4c96f35807de5cb2a745ba1c653513d9b22a5013
2023-05-31 14:35:59 +00:00
Treehugger Robot
2d8615198c Merge "aconfig: restrict valid namespace and flag names" am: cfc5f5e9fd
Original change: https://android-review.googlesource.com/c/platform/build/+/2607087

Change-Id: Ifb0c77ff4e3c51f8bd0dce787abb022946518c79
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-30 20:42:52 +00:00
Mårten Kongstad
00cf045c85 aconfig: restrict valid namespace and flag names
The namespace and flag names will be used as identifiers in the
auto-generated code. Place restrictions on what constitutes a valid
name.

Valid identifiers are those that match /[a-z][a-z0-9_]/. aconfig
explicitly does not implement any automatic translation to make names
valid identifiers: this sidesteps potential conflicts such as "foo.bar"
and "foo_bar" mapping to the same name if dots were translated to
underscores.

Bug: b/284252015
Test: atest aconfig.test
Change-Id: I38d005a74311e5829e540063404d1565071e6e96
2023-05-26 17:09:10 +02:00
Mårten Kongstad
5c2756c13a Merge changes from topic "aconfig-create-rust-lib" am: aa977fb083
Original change: https://android-review.googlesource.com/c/platform/build/+/2602726

Change-Id: I2e708156312d2274c430a698b983b5cfe73c20ab
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-26 07:08:20 +00:00
Mårten Kongstad
aa977fb083 Merge changes from topic "aconfig-create-rust-lib"
* changes:
  aconfig: first iteration of Rust codegen
  aconfig: improve dump --format=debug output
2023-05-26 06:00:47 +00:00
Mårten Kongstad
f73b963283 aconfig: first iteration of Rust codegen
Add a new `create-rust-lib` command to generate Rust code. The output is
a src/lib.rs file; the build system is assumed to set the generated
crate's name.

For READ_ONLY flags, the generated code returns a hard-coded true or false.

For READ_WRITE flags, the generated code reaches out to DeviceConfig via
the cc_library server_configurable_flags via the
libprofcollect_libflags_rust Rust bindings. The build system is assumed
to add this to the generated crate's dependencies.

Note: libprofcollect_libflags_rust seems generic enough that it should
be moved to an official Rust wrapper for server_configurable_flags. This
is tracked in b/284096062.

Summary of module the built system is assumed to wrap the auto-generated
code in:

  rust_library {
      name: "lib<namespace>_rs",
      crate_name: "<namespace>_rs",
      edition: "2021",
      clippy_lints: "none",
      no_stdlibs: true,
      lints: "none",
      srcs: ["src/lib.rs"],
      rustlibs: [
          "libprofcollect_libflags_rust",
      ],
  }

Also add a set of test input to be used in the unit tests for a more
coherent test strategy. A follow-up CL will migrate the code in
commands.rs, codegen_java.rs and codegen_cpp.rs.

Bug: 279483360
Bug: 283907905
Test: atest aconfig.test
Test: manual: create cache from files in testdata, create rust lib, add to module template above, verify the module builds
Change-Id: I02606aa3686eda921116e33f7e2df8fd1156a7aa
2023-05-25 16:18:59 +02:00
Treehugger Robot
592ad2cb13 Merge "Fix merge_target_files in GRF case" am: b3adc24301
Original change: https://android-review.googlesource.com/c/platform/build/+/2564310

Change-Id: I564bb6d43bfa5b9cb79463f0ba50038d03ef6abb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-25 11:37:45 +00:00
Treehugger Robot
b3adc24301 Merge "Fix merge_target_files in GRF case" 2023-05-25 10:46:32 +00:00
Mårten Kongstad
993111f91c aconfig: improve dump --format=debug output
Use Rust's {:#?} formatter for more readable output.

Bug: 279485059
Test: atest aconfig.test
Change-Id: I127f413e3d7aebfba96cad1dd58d9e261dd613a4
2023-05-24 14:56:45 +02:00
Treehugger Robot
74ad39125c Merge "Unsparse images before generating OTA" am: b4406d06f0
Original change: https://android-review.googlesource.com/c/platform/build/+/2598008

Change-Id: I40ac20dd7b30d11e1eda77688718566af4c1c416
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-23 21:22:54 +00:00
Treehugger Robot
b4406d06f0 Merge "Unsparse images before generating OTA" 2023-05-23 20:51:10 +00:00
Treehugger Robot
f6d61bd3c1 Merge "Add 16K artifacts to PREBUILT_IMAGES/ dir of target_files" am: 8485145bd7
Original change: https://android-review.googlesource.com/c/platform/build/+/2595883

Change-Id: I36815cfa877645e242d40a3b4b4cadd0e50a6ef5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-23 03:30:56 +00:00
Treehugger Robot
8485145bd7 Merge "Add 16K artifacts to PREBUILT_IMAGES/ dir of target_files" 2023-05-23 02:36:17 +00:00
Kelvin Zhang
2268091521 Unsparse images before generating OTA
Test: th
Bug: 283172692
Change-Id: Ie6d3dc704fd9a8c107e2888222e4c2bf804dad3e
2023-05-22 10:22:59 -07:00
Treehugger Robot
1ad09e0bfa Merge changes from topic "aconfig-stable-flag-order" am: f469fd6cc6
Original change: https://android-review.googlesource.com/c/platform/build/+/2595206

Change-Id: Ic66ea4047487b6f8c4c51237bf583d035b7032d1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-22 12:30:11 +00:00
Mårten Kongstad
2f95444281 aconfig: sort items in cache by name
Introduce a builder pattern for constructing a cache from flag
declarations and flag values. Teach the builder to sort the flags by
name as the last step. This will ensure consistent dump output
regardless of the order flags are specified in the input files.

Bug: 279485059
Test: atest aconfig.test
Change-Id: Icdd62f51fa3761a469663f17581a83d9909e9ffe
2023-05-22 10:01:05 +02:00
Mårten Kongstad
af677038b3 aconfig: dump: support multiple caches
Teach `aconfig dump` to read multiple caches at the same time.

A cache represents a single namespace, and the Android build creates
multiple caches for different namespaces. By passing in all those cache
files to `aconfig dump`, aconfig will create a complete overview of all
flags in the Android tree.

Caches are traversed in order of namespace to produce the same output
regardless of the order the cache files are given on the command line.
If two caches use the same namespace, their order with respect to each
other is undefined.

Bug: 279485059
Test: atest aconfig.test
Change-Id: I54c3950bbb7b2be7d96c8928e78ae83aa626c2e2
2023-05-22 09:57:48 +02:00
Kelvin Zhang
decee4adb7 Add 16K artifacts to PREBUILT_IMAGES/ dir of target_files
Test: th
Bug: 283506035
Change-Id: I9be3982b5a4324ec839937d10c33266c7d27c525
2023-05-19 14:31:00 -07:00
Treehugger Robot
97f144f4f7 Merge "aconfig: Add first iteration of cpp codegen to aconfig" am: 4266df817d
Original change: https://android-review.googlesource.com/c/platform/build/+/2585679

Change-Id: Ic76387fcc26f48db6417cbf564a450d6acc6a184
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-17 19:56:49 +00:00
Treehugger Robot
4266df817d Merge "aconfig: Add first iteration of cpp codegen to aconfig" 2023-05-17 19:37:28 +00:00
Wei Li
802310c4fd Merge "Some changes to support SBOM generation for b build unbundled APEXs." am: eb035dc89f
Original change: https://android-review.googlesource.com/c/platform/build/+/2585677

Change-Id: I0f302bf5cf4e6313aedc836034ccd9111f4ec534
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-17 19:33:20 +00:00
Baligh Uddin
f04ce4eb36 Merge "Add upstream package of a prebuilt fork package, which will have the package information from the METADATA file." am: 82d450e501
Original change: https://android-review.googlesource.com/c/platform/build/+/2590485

Change-Id: I2b8dace3a3b2f257919c4f2a1ca775d766e0aff9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-17 19:32:56 +00:00
Wei Li
eb035dc89f Merge "Some changes to support SBOM generation for b build unbundled APEXs." 2023-05-17 19:19:47 +00:00
Dennis Shen
1dc9ad4662 aconfig: Add first iteration of cpp codegen to aconfig
The general idea to reuse java codegen's very neat tiny template idea.
For generated cpp code, it is in the form of a collection of classes
inside a namespace. The reason we choose a collection of classes rather
than a collection of static functions is because gmock test technology
only supports mocking virtual method.

Bug: b/279483801
Test: atest aconfig.test
Change-Id: I9ba00667437ff7c3e147ff2828171fc95528bebf
2023-05-17 14:57:58 +00:00
Wei Li
16e7aa3c2e Add upstream package of a prebuilt fork package, which will have the package information from the METADATA file.
Test: CIs
Test: lunch barbet-user && m sbom
Change-Id: Ic8eb42c369de8c94c7977b9631ff4b9084dfef01
2023-05-17 01:38:05 +00:00
Joe Onorato
6ee16caf99 Merge "Use the namepace as the java package name in aconfig and call the class "Flags"" am: 7833547153
Original change: https://android-review.googlesource.com/c/platform/build/+/2588271

Change-Id: Id42b087eea8e723d2dc66534760d00842263dda6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-16 23:14:30 +00:00
Treehugger Robot
e1623bb140 Merge "Allow source build to be an extracted target_files" am: fce28c1b97
Original change: https://android-review.googlesource.com/c/platform/build/+/2589846

Change-Id: I0a4ebf623140c02b39c7d3cb2e9bd060b7ea4090
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-16 23:14:19 +00:00
Joe Onorato
7833547153 Merge "Use the namepace as the java package name in aconfig and call the class "Flags"" 2023-05-16 23:13:52 +00:00
Treehugger Robot
fce28c1b97 Merge "Allow source build to be an extracted target_files" 2023-05-16 22:56:29 +00:00
Treehugger Robot
a2ebcf5e03 Merge "Support custom payload signer in merge_ota" am: bb404f2b27
Original change: https://android-review.googlesource.com/c/platform/build/+/2587127

Change-Id: Idd3456e86e1785b5611810f71a42042b66d5610c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-16 22:31:54 +00:00
Treehugger Robot
bb404f2b27 Merge "Support custom payload signer in merge_ota" 2023-05-16 21:39:58 +00:00
Joe Onorato
0c4ef0f88c Use the namepace as the java package name in aconfig and call the class "Flags"
Test: aconfig.test
Change-Id: I15032262aad2c80d1ec1bd8fa81664a846b307ec
2023-05-16 14:27:25 -07:00
Treehugger Robot
1be8ad0258 Merge changes from topic "aconfig-cleanup-1" am: d4a32797c9
Original change: https://android-review.googlesource.com/c/platform/build/+/2591069

Change-Id: Ic657d8f404dc001ba645ef443e8ae6fd94f575ac
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-16 17:20:00 +00:00
Mårten Kongstad
e17ba5f423 aconfig: cache: reject empty namespace and name fields
Add invariant to struct Cache: all flag namespace and name fields added
to the cache are required to be non-empty strings.

Bug: 279485059
Test: atest aconfig.test
Change-Id: I5ff34ec8feccc19e52241d4221fc87699518f3ff
2023-05-16 12:52:43 +02:00
Mårten Kongstad
6b9e382eed aconfig: remove calls to unwrap (outside tests)
Do not call unwrap outside tests: replace existing uses with Result
return values or infallible alternatives.

Bug: 279485059
Test: atest aconfig.test
Change-Id: Ie5919b704b23a0f96bbef84ffbe9270d667cecd8
2023-05-16 11:19:58 +02:00
Mårten Kongstad
ba94e6a6b2 aconfig: rename enum Format -> enum DumpFormat
Rename enum Format to enum DumpFormat to make it more apparent what it
refers to.

Bug: 279485059
Test: atest aconfig.test
Change-Id: I869be020b69618b036fa05247f155d9e35ff85e2
2023-05-16 11:00:16 +02:00
Satoshi Futenma
1f93ce20c5 Support custom payload signer in merge_ota
Add options to handle custom payload signer as it is required in
merge_ota.py as well if the original OTA packages are signed by
the signer.

If input is only one OTA, clone apex_info.pb to the target.

Use common.ZipWriteStr instead of zipfile.writestr, this ensures
that the same permission for the entries as done by
ota_from_target_files.

Bug: 282189563
Test: manual. pass single OTA to merge_ota, with same signing
    parameters as originally used. Confirm that output zip is
    binary identical to input.
Change-Id: I3b926b8cd69bc74dff6ccf8b5ccc72bedffcac6f
2023-05-16 10:21:05 +02:00
Kelvin Zhang
b97416e09e Allow source build to be an extracted target_files
common.LoadInfoDict() already supports loading from extracted
directories, just use it.

Test: generate an incremental OTA where both inputs are directories
Bug: 227848550
Bug: 277028723
Change-Id: Iedba831bb4d65d971df6b2ac95279e3234a02e2f
2023-05-15 11:13:26 -07:00
Mårten Kongstad
bdd924b335 Merge "aconfig: use bail! and ensure! where applicable" am: 7890fa3e84
Original change: https://android-review.googlesource.com/c/platform/build/+/2588765

Change-Id: Iaec315775f38b17825d4c98f077773a6023a1259
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-15 14:48:02 +00:00
Mårten Kongstad
e66b89f635 aconfig: use bail! and ensure! where applicable
The Android Rust style guide recommends anyhow's bail! and ensure!
macros where possible. Update the code accordingly.

Bug: 279485059
Test: atest aconfig.test
Change-Id: I7db7cc2d8ec15e1d3450657ad000e879adb19e08
2023-05-15 11:10:12 +02:00
Mårten Kongstad
011f6d42b2 Merge changes from topic "aconfig-part-5" am: 71f9dabe47
Original change: https://android-review.googlesource.com/c/platform/build/+/2584221

Change-Id: I0520bb7fce7cf788cd45bec7b1897b902dd86bc9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-12 13:03:15 +00:00
Mårten Kongstad
71f9dabe47 Merge changes from topic "aconfig-part-5"
* changes:
  aconfig: follow Java conventions for Java file paths
  aconfig: separate flag declarations and flag values
2023-05-12 12:21:02 +00:00
Treehugger Robot
531125c397 Merge "parallelize add_partition_calls only if output_zip is None" am: 8d5d2257d9
Original change: https://android-review.googlesource.com/c/platform/build/+/2584696

Change-Id: Ida95b894dc799345b02aa64b58f4d6392db92d7f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-12 11:39:56 +00:00
Treehugger Robot
8d5d2257d9 Merge "parallelize add_partition_calls only if output_zip is None" 2023-05-12 10:56:23 +00:00
Mårten Kongstad
d42eeeba3d aconfig: follow Java conventions for Java file paths
Update codegen_java to write the generated Java file(s) to
"java/package/File.java" instead of just "File.java".

Also generalize codegen_java::GeneratedFile to commands::OutputFile in
preparation for the upcoming C++ and Rust codegen.

Also change Java package name to 'com.android.internal.aconfig'.

Bug: 279485059
Test: atest aconfig.test
Change-Id: I13978697e35010fe6be8637aa495d4b852dbed7e
2023-05-12 10:01:00 +02:00
Mårten Kongstad
fa23d2993b aconfig: separate flag declarations and flag values
Simplify how aconfig configurations work: remove the ability to set flag
values based on build-id.

The aconfig files now some in two flavours:

  - flag declaration files: introduce new flags; aconfig will assign the
    flags a hard-coded default value (disabled, read-write)

  - flag value files: assign flags new values

`aconfig create-cache` expects flags to be declared exactly once, and
for their values to be reassigned zero or more times.

The flag value files are identical what used to be called override
files.

Also, remove the now obsolete build-id parameter: this was used to
calculate default values before applying overrides, and is no longer
needed.

Also rename a few more structs and functions to be closer to the .proto
names. This will make it easier to use the generated proto structs
directly, and get rid of the hand-crafter wrappers.

Bug: 279485059
Test: atest aconfig.test
Change-Id: I7bf881338b0567f932099ce419cac457abbe8df8
2023-05-12 08:50:49 +02:00
Jeongik Cha
fa9090946e parallelize add_partition_calls only if output_zip is None
if output_zip isn't None, writing into zip file in parallel is not
thread-safe.

Bug: 281960217
Test: m dist
Change-Id: I10d68a4bb779cee244f40410ec95d38ca6040306
2023-05-12 15:14:58 +09:00
Treehugger Robot
d5dc0c17fe Merge "parallelize add_partition_calls" am: 96b51b54b6
Original change: https://android-review.googlesource.com/c/platform/build/+/2585397

Change-Id: I58e1b516a5109eaed483af1c8b9979f838e0b96f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-12 05:19:41 +00:00
Daniel Zheng
6b558b3fe4 Merge "Add fastboot-info to updatepackage" am: 717591dd4e
Original change: https://android-review.googlesource.com/c/platform/build/+/2583539

Change-Id: I92a70b845d04e2f251eed2b96fbcfe58d57ffeea
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-12 05:19:25 +00:00
Treehugger Robot
96b51b54b6 Merge "parallelize add_partition_calls" 2023-05-12 04:54:11 +00:00
Daniel Zheng
717591dd4e Merge "Add fastboot-info to updatepackage" 2023-05-12 04:31:55 +00:00
Jeongik Cha
03d014a03f parallelize add_partition_calls
it made total time equal to the longest image build

1m10s->30s in local build

Bug: 281960217
Test: m dist
Change-Id: I13d4f45d9b46b39292a014e3b4e1913365d89b7a
2023-05-12 08:43:44 +09:00
Wei Li
fd7e6517d3 Some changes to support SBOM generation for b build unbundled APEXs.
1) Use output file path of installed files in build system since there is no PRODUCT_OUT in Bazel
2) Use CONTAINS to describe the relationship between a APEX and files it contains
3) Generate SBOM of APEXs, which is similar to SBOM of products

Bug: 275472038
Test: CIs
Change-Id: I41622366e5e6ed9dc78cca7bc7bb69a1f8f9bd9f
2023-05-11 13:58:37 -07:00
Cole Faust
0a9d1d6025 Merge "Allow importing starlark code in makefiles" am: 99d89154f1
Original change: https://android-review.googlesource.com/c/platform/build/+/2583544

Change-Id: If559b5f4119df6b19c42f5bf60f738ddf4365d8f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-11 17:14:36 +00:00
Cole Faust
99d89154f1 Merge "Allow importing starlark code in makefiles" 2023-05-11 17:04:46 +00:00
Mårten Kongstad
86d0c527c0 Merge "aconfig: Add codegen for java" am: 7b6aacb055
Original change: https://android-review.googlesource.com/c/platform/build/+/2583478

Change-Id: I8bd49c346fdd4f2e30c5033f63783e66bc7d4bb8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-11 08:24:31 +00:00
Zhi Dou
eb74489b3a aconfig: Add codegen for java
Add codegen for java skeleton

Bug: 279485059
Test: atest aconfig.test
Change-Id: Ia0481cec9c2e137e88e9a77d1b82412529b64adc
2023-05-11 03:08:53 +00:00
Treehugger Robot
13456aa63c Merge changes from topic "aconfig-part-4" am: ef0a2c21dd
Original change: https://android-review.googlesource.com/c/platform/build/+/2584571

Change-Id: I7bb9c8cfab6084b27ce8e62afabe747bb05e43a0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-10 19:38:09 +00:00
Treehugger Robot
ef0a2c21dd Merge changes from topic "aconfig-part-4"
* changes:
  aconfig: introduce namespace, rename proto messages
  aconfig: add dump protobuf format
2023-05-10 19:22:00 +00:00
Treehugger Robot
02591d64de Merge "Improve finalization perfomance by building only current version." am: b1a7ba8735
Original change: https://android-review.googlesource.com/c/platform/build/+/2584105

Change-Id: I2386fa0a10a112343d0ba20ac256368bec7dbcc3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-10 16:05:07 +00:00
Treehugger Robot
b1a7ba8735 Merge "Improve finalization perfomance by building only current version." 2023-05-10 15:19:12 +00:00
Mårten Kongstad
3095078981 aconfig: introduce namespace, rename proto messages
Flags belong to a namespace. Update the proto files to reflect this.

Config files can only refer to a single namespace. Override files can
refer to multiple namespaces; an override directive for a flag in a
different namespace than the one represented by the cache will be
silently ignored.

Rename the proto messages to make it more clear what they are. Propagate
this change through the wrappers in aconfig.rs and the rest of the code.

Also, settle on Tracepoint instead of TracePoint.

Bug: 279485059
Test: atest aconfig.test
Change-Id: I16e69dd14687bc498b2ba89d6a35879459903801
2023-05-10 17:17:20 +02:00
Kelvin Zhang
06417aaa9e Merge "Fix non-AB ota generation for directories" am: ea70695d92
Original change: https://android-review.googlesource.com/c/platform/build/+/2585207

Change-Id: I7a6472946360238393a734640e27557f7623446f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-10 04:46:20 +00:00
Kelvin Zhang
ea70695d92 Merge "Fix non-AB ota generation for directories" 2023-05-10 04:07:09 +00:00
Kelvin Zhang
b036007592 Fix non-AB ota generation for directories
Test: ota_from_target_files -v --block yukawa-target_files-10097950.zip
test.zip

Change-Id: I4291010d66cc28bdb6b6b334cdbed06daf3de837
2023-05-09 20:30:53 -07:00
Alex Buynytskyy
aac2a187d4 Improve finalization perfomance by building only current version.
Bug: 275409981
Test: run locally
Change-Id: If531178a17792166726ff7ed230592c392eeb899
2023-05-10 03:10:32 +00:00
Cole Faust
c63ce1ab58 Allow importing starlark code in makefiles
Adds a new `$(call run-starlark,my/starlark/file.bzl)` function that
will run the starlark file and set all the variables in the
variables_to_export_to_make dictionary as make variables.

Fixes: 280685526
Test: m nothing repeatedly causes no ninja regeneration, but touching all_versions.bzl does. go test, ./out/rbcrun -mode=rbc ./build/make/tests/run.rbc
Change-Id: Ic72e18dd28dba8233ba2dfb658b5d03ccece1bfd
2023-05-09 15:12:58 -07:00
Daniel Zheng
380cb8065a Add fastboot-info to updatepackage
Modifying img_from_target_files to also add fastboot-info to
updatepackage

Test: m updatepackage
Bug: 194686221
Change-Id: I2e08c4269f0d83417b9d7079633bc28796d1cdd6
2023-05-09 13:44:22 -07:00
Mårten Kongstad
a102909e09 aconfig: add dump protobuf format
Introduce a new protobuf format to represent the all flags parsed by
aconfig. This data in this new format is similar to that of the internal
cache object, but the protobuf is a public API for other tools to
consume and any changes to the proto spec must be backwards compatible.

When aconfig has matured more, Cache can potentially be rewritten to
work with proto structs directly, removing some of the hand-written
wrapper structs and the logic to convert to and from the proto structs.
At this point, the intermediate json format can be replaced by the
protobuf dump.

Also, teach `aconfig dump` to accept an --out <file> argument (default:
stdout).

Also, teach `aconfig dump` to read more than once cache file.

Note: the new protobuf fields refer to existing fields. It would make
sense to split the .proto file in one for input and one for output
formats, and import the common messages, but the Android build system
and cargo will need different import paths. Keep the definitions in the
same file to circumvent this problem.

Bug: 279485059
Test: atest aconfig.test
Change-Id: I55ee4a52c0fb3369d91d61406867ae03a15805c3
2023-05-09 15:27:42 +02:00
Treehugger Robot
9840061379 Merge "Remove unneeded rbcrun features" am: 872023376e
Original change: https://android-review.googlesource.com/c/platform/build/+/2580473

Change-Id: Ia8b8f735b272a8a61eb989ecef819516b3a9f2b7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-09 08:15:26 +00:00
Treehugger Robot
872023376e Merge "Remove unneeded rbcrun features" 2023-05-09 07:31:40 +00:00
Treehugger Robot
8bad8c04de Merge changes from topic "aconfig-part-3" am: d279e5d79c
Original change: https://android-review.googlesource.com/c/platform/build/+/2581670

Change-Id: I0479ee840934c8195172698248fcb06887072ebd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-08 18:42:27 +00:00
Mårten Kongstad
2fc13df5d7 Merge changes from topic "aconfig-part-2" am: 80bff11aef
Original change: https://android-review.googlesource.com/c/platform/build/+/2578555

Change-Id: I9f41660ea3cefad70f405b93587baa005b5b4f6e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-08 11:40:43 +00:00
Mårten Kongstad
98b0eeb2fc aconfig: simplify argument parsing in main
Improve readability by extracting how multiple input files are
transformed from a clap argument to an Input.

Bug: 279485059
Test: atest aconfig.test
Change-Id: I299179d39eca80e107342f6978984da79ee81e34
2023-05-08 12:47:34 +02:00
Mårten Kongstad
76adff2af0 aconfig: improve flag value tracing
Improve how the flag values (state, permission) are tracked when parsing
config and override files: migrate from a raw string to a proper struct,
as this will make it easier when aconfig will output this data in some
structured format for other tools to consume.

Also, rename Cache.debug to Cache.trace.

Bug: 279485059
Test: atest aconfig.test
Change-Id: Idad57c969515f697e9065429d8a44c38d8a512d2
2023-05-08 12:47:34 +02:00
Mårten Kongstad
80bff11aef Merge changes from topic "aconfig-part-2"
* changes:
  aconfig: change flag values to enabled/disabled enum
  aconfig: add read/write permission
  aconfig: Source: remove unnecessary #[derive(Serialize, Deserialize)]
2023-05-08 10:46:26 +00:00
Treehugger Robot
9cc5216ed0 Merge "Script fixes and improvements." am: be8badd74e
Original change: https://android-review.googlesource.com/c/platform/build/+/2581131

Change-Id: Icf9617f5f6ddf548ce5994f2c8945bcd9c06829c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-07 01:43:18 +00:00
Alex Buynytskyy
00a88ec3ec Script fixes and improvements.
Fix to mark all versions REL.

More robust patch application. Keep getting these build breakages, not sure why. Looks like git is
confusing one folder for the other?
https://android-build.googleplex.com/builds/submitted/10065142/test_suites_arm64/latest/logs/build_error.log

Bug: 275409981
Test: run locally
Change-Id: I6173b9ecae5e9ab12d9abf2eee3f2136dc353210
2023-05-06 20:55:10 +00:00
Cole Faust
a874f88cee Remove unneeded rbcrun features
- rblf_cli and rblf_env
- -c and -f

This is in preparation for making rbcrun able to function as a more
general purpose starlark interpreter.

Bug: 280685526
Test: go test, ./out/rbc ./build/make/tests/run.rbc, ./build/bazel/ci/rbc_dashboard.py --quick aosp_arm64
Change-Id: Ifff9ce7b4369422f39c5003bb85a168c78bde7cf
2023-05-05 11:52:02 -07:00
Mårten Kongstad
c68c4eabea aconfig: change flag values to enabled/disabled enum
Change the underlying type of a flag's value from bool to an explicit
enum (Disabled, Enabled): this will hopefully reduce future confusion on
how flags are intended to be used.

Bug: 279485059
Test: atest aconfig.test
Change-Id: I9535f9b23baf93ad5916ca06fb7d21277b4573eb
2023-05-05 16:20:09 +02:00
Mårten Kongstad
416330b060 aconfig: add read/write permission
Introduce the concept of flag read/write permissions: a read-only flag
can only have its value set during the build; a writable flag can by
updated in runtime.

Bug: 279485059
Test: atest aconfig.test
Change-Id: I3ec5c9571faa54de5666120ccd60090d3db9e331
2023-05-05 13:45:28 +02:00
Mårten Kongstad
2937566c55 aconfig: Source: remove unnecessary #[derive(Serialize, Deserialize)]
The Source struct is no longer serialized/deserialized. Remove the
unused derives.

Bug: 279485059
Test: atest aconfig.test
Change-Id: Ifd78988ed8134ab43013314b4437e428a8927981
2023-05-05 10:57:19 +02:00
Mårten Kongstad
787a0d1ffd Merge changes from topic "aconfig-part-1" am: 0b6b92e5a5
Original change: https://android-review.googlesource.com/c/platform/build/+/2578416

Change-Id: Icdeb54a877d6e0e7df55321e4ed61d04a9011e91
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-04 21:27:00 +00:00
Mårten Kongstad
0b6b92e5a5 Merge changes from topic "aconfig-part-1"
* changes:
  aconfig: add support for changing flag value based on build
  aconfig: introduce cache
  aconfig: define Aconfig proto
  aconfig: add support for cargo
2023-05-04 20:36:22 +00:00
Mårten Kongstad
09c28d1689 aconfig: add support for changing flag value based on build
Teach aconfig about build IDs (continuously increasing integers). Extend
the aconfig file format to allow flags to say "by default, my value is
X, but starting from build ID A, it's Y, and from build ID B, it's Z".

Bug: 279485059
Test: atest aconfig.test
Change-Id: Idde03dee06f6cb9041c0dd4ca917c8b2f2faafdd
2023-05-04 14:34:55 +02:00
Mårten Kongstad
4d2b4b047b aconfig: introduce cache
Introduce the Cache struct to represent parsed and verified aconfig and
override content. Most commands in aconfig will work of an existing
cache file, eliminating the need to re-read the input every time.

Restructure main.rs to use clap to create a proper command line
interface with support for sub-commands. main.rs is responsible for
parsing the command line, performing disk I/O and calling the correct
subcommand implementation (in commands.rs).

To simplify unit tests, subcommands never perform explicit I/O; instead
they only work with Read and Write traits.

Also add dependencies on clap, serde and serde_json.

Bug: 279485059
Test: atest aconfig.test
Change-Id: Ib6abf2eabd264009804f253874b6fba924fc391b
2023-05-04 10:40:26 +02:00
Mårten Kongstad
bb520729e8 aconfig: define Aconfig proto
Fill in aconfig.proto. Define Aconfig definitions (for introducing flags
and setting their values) and Overrides (for overriding flags regardless
of what their definitions say). More changes to the proto schema are
expected when more of the aconfig project is outlined.

Use proto2 instead of proto3: this will cause the protobuf text parser
to error on missing fields instead of returning a default value which is
ambiguous, especially for booleans. (Also, the text protobuf parser
doesn't provide good error messages: if the input is missing a field,
the error is always "1:1: Message not initialized").

Unfortunately the generated Rust wrappers around the proto structs land
in an external crate, which prevents aconfig from adding new impl
blocks. Circumvent this by converting the data read from proto into
structs defined in the aconfig crate.

Change main.rs to parse (static) text proto.

Also add dependency on anyhow.

Bug: 279485059
Test: atest aconfig.test
Change-Id: I512e3b61ef20e2f55b7699a178d466d2a9a89eac
2023-05-04 10:35:25 +02:00
Treehugger Robot
5e4f59f9ca Merge "Support generating partial OTAs from extracted target_files" am: c3216a321b
Original change: https://android-review.googlesource.com/c/platform/build/+/2577071

Change-Id: I79fa834772dc12fe26678238bcf80ecffd2a34ce
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-04 00:54:58 +00:00
Treehugger Robot
c3216a321b Merge "Support generating partial OTAs from extracted target_files" 2023-05-04 00:05:29 +00:00
Treehugger Robot
acbf5e5c45 Merge "Update sdk finalizer for change to api_levels_released_versions" am: 626b012556
Original change: https://android-review.googlesource.com/c/platform/build/+/2573034

Change-Id: Id8fb00b47f16bcd17f0503e5f4fb733d3c5fc03a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-03 18:01:54 +00:00
Treehugger Robot
626b012556 Merge "Update sdk finalizer for change to api_levels_released_versions" 2023-05-03 17:24:31 +00:00
Mårten Kongstad
fe753f5365 aconfig: add support for cargo
Officially, aconfig is build using the Android tool-chain. However, to
speed up the local development cycle, add support for building with
cargo.

While it is possible to tell cargo to place the build artifacts outside
the source tree, there is no way to tell it to not generate the cargo
lock file in the same directory as Cargo.toml. Add a .gitignore to
ignore Cargo.lock and the target directory.

The way the Android build system and cargo generates code from the
protobuf files is slightly different. Tell cargo to enable the "cargo"
feature and introduce src/protos.rs to hide this difference from the
rest of the aconfig source.

Bug: 279485059
Test: m aconfig && aconfig
Test: atest aconfig.test
Test: cargo build
Test: cargo test
Change-Id: I85741f58cadae353ed95c124f566e4f4a7484186
2023-05-03 09:41:11 +02:00
Mårten Kongstad
7b9a0b649c Merge "aconfig: add project scaffolding" am: e7a850e942
Original change: https://android-review.googlesource.com/c/platform/build/+/2563154

Change-Id: I88c6b05de525f296d879805e099f020f7c5e4fb4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-03 07:07:49 +00:00
Mårten Kongstad
e7a850e942 Merge "aconfig: add project scaffolding" 2023-05-03 06:18:02 +00:00
Kelvin Zhang
6b10e15acc Support generating partial OTAs from extracted target_files
This allows the build system to potentially paralleize generation of OTA
package and zipping of target files

Bug: 262185376
Bug: 227848550
Change-Id: I90b6c25761683ebe3803b22fc8e23540a5282c66
2023-05-02 20:48:14 -07:00
Mårten Kongstad
867a349ed9 aconfig: add project scaffolding
Introduce a new tool, aconfig, to manage build time configurations, such
as feature flags.

This CL adds a project skeleton. Later CLs will add the actual
implementation.

Note: there is no need for an explicit TEST_MAPPING file;
rust_test_host are automatically included in host-unit-tests and
explicitly adding these tests via TEST_MAPPING will cause an error.

Bug: 279485059
Test: m aconfig && aconfig
Test: atest aconfig.test
Change-Id: I94047a19a55ae4d45b4fd7a0c8105a91ddcdfd79
2023-05-02 17:36:30 +02:00
Treehugger Robot
8583eae383 Merge "Use misc_info.txt to check for VABC" am: ed1ab26f5d
Original change: https://android-review.googlesource.com/c/platform/build/+/2572975

Change-Id: I2ef6cf286ed259dafc20f8bb1f4b0388a32b5fda
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-01 22:41:40 +00:00
Treehugger Robot
ed1ab26f5d Merge "Use misc_info.txt to check for VABC" 2023-05-01 22:30:19 +00:00
Alex Buynytskyy
927e5096b6 Merge "Set next sdk_int to previous sdk_int + 1." am: f12a969445
Original change: https://android-review.googlesource.com/c/platform/build/+/2575210

Change-Id: I3beb16122db4a76f6230913fc6b801cca714b9fa
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-05-01 19:48:02 +00:00
Alex Buynytskyy
d03be09214 Set next sdk_int to previous sdk_int + 1.
OS and the finalization scripts use sdk_int - 1 in way too many places.

Bug: 275409981
Test: run locally
Change-Id: If4896a3eb0a6afadac5dbfd6ad455427d1c23d41
2023-05-01 18:56:26 +00:00
Kelvin Zhang
e634bde6bd Use misc_info.txt to check for VABC
Change-Id: I77f23a51ddb027254ccda8d7ab17e64205522300
2023-04-28 23:59:43 -07:00
Alex Buynytskyy
75a8134b59 Merge "Correct if statement." am: 56f81f3d64
Original change: https://android-review.googlesource.com/c/platform/build/+/2572939

Change-Id: I390029878186f26b357ce04229afeea9b0338b4c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-29 00:48:14 +00:00
Alex Buynytskyy
01db2a97da Correct if statement.
Bug: 275409981
Test: run locally
Change-Id: If6b8052748f816713cd16328ad1525dcd90ded69
2023-04-29 00:06:39 +00:00
Cole Faust
cdb1a45ac2 Update sdk finalizer for change to api_levels_released_versions
Change the starlark file, not the soong one.

Bug: 279095899
Test: manually ran this snippet
Change-Id: If7b93096743f79a5303db4330fc03cbc8fb5bae3
2023-04-28 14:23:46 -07:00
Alex Buynytskyy
308059d67f Merge "Change CI API level to keep linter happy." am: a2a2f40414
Original change: https://android-review.googlesource.com/c/platform/build/+/2569570

Change-Id: I360fe4bb66fdead79c3b55af7221b6ca411f7ae5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-27 23:09:48 +00:00
Alex Buynytskyy
5d205dc016 Change CI API level to keep linter happy.
Bug: 275409981
Test: run locally
Change-Id: I99d2ef4974a70f435f528c7a9358990fa41c9f5e
2023-04-27 15:30:19 -07:00
Alex Buynytskyy
aee2075ece Merge "Update Android Studio Version Number." am: ba71daa94e
Original change: https://android-review.googlesource.com/c/platform/build/+/2568552

Change-Id: I319e3712ed079d0988d9d63f3a00d17a097e0f79
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-27 19:26:34 +00:00
Alex Buynytskyy
d873b0e46b Update Android Studio Version Number.
Bug: 275409981
Test: run locally
Change-Id: I0d62ac8178f6d69f66adde8c5889ff86bcfad0ed
2023-04-27 18:18:57 +00:00
Treehugger Robot
f8f099a3db Merge "Let the finalization script create ABI dumps for all architectures" am: 99dc1341d1
Original change: https://android-review.googlesource.com/c/platform/build/+/2564374

Change-Id: Ic212e9fc3f4e18aa305c56db5c17e50ef22ffcf7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-27 06:32:25 +00:00
Treehugger Robot
99dc1341d1 Merge "Let the finalization script create ABI dumps for all architectures" 2023-04-27 05:52:25 +00:00
Po Hu
09de31418f Fix merge_target_files in GRF case
aosp/2525591 remove SYSTEM/build.prop from vendor target_files,
and cause the same error reported in aosp/1836120.

Bug: 192422274
Change-Id: I3af33e44e395002a9cf26cf93677ff84c2c26207
2023-04-27 10:41:25 +08:00
Alex Buynytskyy
31dd5afd9b Merge "Mark master as VIC development branch." am: d878cdf692
Original change: https://android-review.googlesource.com/c/platform/build/+/2564671

Change-Id: I1c028547cf50b02c66099c7f75a38e6738605437
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-27 00:34:01 +00:00
Alex Buynytskyy
d878cdf692 Merge "Mark master as VIC development branch." 2023-04-26 23:39:11 +00:00
Daniel Zheng
fe2a0816b6 Merge "Add --max_threads to OTA generation" am: 15c296958b
Original change: https://android-review.googlesource.com/c/platform/build/+/2563130

Change-Id: Ibd5d90c7661ecf3367485cf43b887c2cefcde544
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-26 22:27:31 +00:00
Daniel Zheng
15c296958b Merge "Add --max_threads to OTA generation" 2023-04-26 21:53:53 +00:00
Alex Buynytskyy
0fc39526a1 Mark master as VIC development branch.
Test: ./build-step-1-and-m.sh
Bug: 279615150
Change-Id: Idb485846345ea146c04c5ecf6eb4ab6eea122f9b
Merged-In: Idb485846345ea146c04c5ecf6eb4ab6eea122f9b
2023-04-26 18:15:59 +00:00
Daniel Zheng
a30989bafa Add --max_threads to OTA generation
Adding an option to configure max number of threads used during
ota_from_target_files

Bug: 277794445
Test: tested ota_from_target_files
Change-Id: I9bae92ee43c21926434ab04563a2b4f0678b73eb
2023-04-26 10:52:12 -07:00
Hsin-Yi Chen
139cc54d81 Let the finalization script create ABI dumps for all architectures
The command that creates ABI dumps was written for testing purpose.
It creates the ABI dumps for aosp_arm64-user. The complete finalization
process should create ABI dumps for all supported architectures. This
commit removes the command parameters so that it will create all ABI
dumps by default.

Test: out/host/linux-x86/bin/create_reference_dumps
Bug: 276503801
Change-Id: Id6fbbac512a13d085ea74fec6e8b137485639467
2023-04-26 17:11:20 +08:00
Treehugger Robot
5939a80763 Merge "Support to merge PREBUILT_IMAGES" am: dd62b0da0f
Original change: https://android-review.googlesource.com/c/platform/build/+/2512522

Change-Id: I67339cb1a8108577522bd3446e868adbe3385439
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-25 05:17:11 +00:00
Treehugger Robot
dd62b0da0f Merge "Support to merge PREBUILT_IMAGES" 2023-04-25 04:24:20 +00:00
Treehugger Robot
5970bf338b Merge "Fix incremental OTA generation failures" am: 5ca02ff114
Original change: https://android-review.googlesource.com/c/platform/build/+/2553374

Change-Id: I17880a243562b821a634715b242677de52ba6d12
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-22 02:04:12 +00:00
Treehugger Robot
5ca02ff114 Merge "Fix incremental OTA generation failures" 2023-04-22 01:26:28 +00:00
Treehugger Robot
dba8e6640f Merge "Don't skip vndk finalization." am: 315e8b52ef
Original change: https://android-review.googlesource.com/c/platform/build/+/2555112

Change-Id: I9e904fea56ee151042dd3f47b72da6e170f759f4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-21 23:55:05 +00:00
Alex Buynytskyy
f5897ecdb6 Don't skip vndk finalization.
Bug: 275409981
Test: local run
Change-Id: I6651f29e3c5fd5f1ccb6ec07fd52491ba16f5086
2023-04-21 19:08:50 +00:00
Xin Li
bd259b2f43 Merge "Merge Android 13 QPR3 tm-qpr-dev-plus-aosp-without-vendor@9936994" into stage-aosp-master 2023-04-21 17:40:21 +00:00
Kelvin Zhang
ca45d7a85d Fix incremental OTA generation failures
source_file might be a directory, use the _ReadApexInfo() helper
function to read it instead of go straight to zipfiles.

Test: build incremental OTA for pixel
Bug: 279142680
Bug: 227848550
Bug: 277028723

Change-Id: Ia0041e2c72c1a57123519c970f6e734194a81cd2
2023-04-21 17:30:50 +00:00
Treehugger Robot
fad3925959 Merge "Update generateSPDXNamespace to generate a unique spdx doc namespace" 2023-04-21 16:50:00 +00:00
Xin Li
d6b6d0102a Merge Android 13 QPR3 tm-qpr-dev-plus-aosp-without-vendor@9936994
Bug: 275386652
Merged-In: I4b2ea3956c34aa56cc6f54bab7148f116c34759e
Change-Id: I900022a8e8f104b6dc52745211c428601be53ba6
2023-04-21 09:49:08 -07:00
Treehugger Robot
269248add6 Merge "Cleanup the list of Soong prebuilt module types." 2023-04-21 01:40:01 +00:00
Wei Li
6f407ba0a8 Cleanup the list of Soong prebuilt module types.
Bug: 272356622
Test: CIs
Change-Id: I4031f0a73f5af1bbf1eb374bcd7d3a19b9609a46
2023-04-20 14:13:58 -07:00
Ibrahim Kanouche
397a9cf430 Update generateSPDXNamespace to generate a unique spdx doc namespace
Test: m compliance_sbom
Change-Id: Icc1e5aec0e1758ee32c43cfa79b5b49b3d1d9d30
2023-04-20 17:43:12 +00:00
Treehugger Robot
ece71703f8 Merge "Allow ota_from_target_file to work entirely on directories" 2023-04-20 15:17:50 +00:00
Bob Badour
ffba21bbae [LSC] Add LOCAL_LICENSE_KINDS to build/make
Added SPDX-license-identifier-Apache-2.0 to:
  tools/sbom/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: I1f8e5fd8e787a4c53bf4caf80a4000d46d0291e4
2023-04-19 09:48:01 -07:00
Kelvin Zhang
9dbe2ce40f Allow ota_from_target_file to work entirely on directories
When building android, build system will first zip target_file directory
into a .zip file, and then invoke ota_from_target_files. We
ota_from_target_files can work directly on top of directories, we can
parallelize OTA generation and target_file zipping, making builds
faster.

Bug: 227848550
Bug: 277028723
Test: th
Change-Id: Id72bd7cca708af0e1bae2db754f39b27777cd601
2023-04-18 17:47:29 -07:00
Po Hu
81c3f4a884 Support to merge PREBUILT_IMAGES
For example, pvmfw.img comes from framework target files package
and dtbo.img comes from vendor target files package.

Test: merge_target_files
Change-Id: If2e6fac5ce3671e3387e801808a195fb7b2c55b5
2023-04-19 08:23:40 +08:00
Wei Li
49af939a23 Copy SBOM files of unbundled APKs to dist directory.
Bug: 266726655
Test: CIs
Test: tapas Browser2 Calendar arm userdebug && m dist
Change-Id: I82328dc4916451a99ad0bf6d7bb945c9b98d0bea
2023-04-18 15:57:34 -07:00
Treehugger Robot
67ca3c05c7 Merge "Fix duplicate super_empty.img" 2023-04-17 21:19:13 +00:00
Treehugger Robot
b7a45ea13d Merge "Try with search_path for some avb path args" 2023-04-17 20:43:12 +00:00
Kelvin Zhang
aecdc18222 Fix duplicate super_empty.img
When calling add_img_to_target_files twice, super_empty.img will be
written twice, and resulting zip would contain duplicate entries.

Test: th
Bug: 278522974
Change-Id: I2419d0c4f8b04f876a8cc69a1517f59cab94d75d
2023-04-17 09:52:39 -07:00
Alex Buynytskyy
2ba40b5be6 Merge "Finalization script fixes." 2023-04-17 15:26:16 +00:00
Alex Buynytskyy
f7a5e2fa4b Finalization script fixes.
- actually do the first step instead of just logging a message,
- make sure extension SDK bump gets picked up by the topic,
- fix the resources_sdk_int in first step, and unfix in the second.

Bug: 278246368
Fixes: 278246368
Test: local run
Change-Id: I0d0f4e2ec7f0b584b9fc14a545cfec73a9fcbdea
2023-04-16 21:15:18 -07:00
Treehugger Robot
3fb8d2bad8 Merge "Fix the following issues mentioned in Pixel SBOM review." 2023-04-15 20:34:52 +00:00
Wei Li
5290825452 Fix the following issues mentioned in Pixel SBOM review.
1) PackageSupplier should be NOASSERTION if there is no homepage
   information in METADATA file of source packages
2) PackageDownloadLocation of upstream packages should be NOASSERTION if
   there is no code repository URL in METADATA file of source packages

Test: CIs
Test: atest --host sbom_writers_test
Change-Id: I8a0298b7bacc2f96555f9d7dde0d21ada8c6b564
2023-04-15 06:05:32 +00:00
David Anderson
23c2df71bc Merge "ota_from_target_files: Disable XOR on <T vendor." 2023-04-15 04:52:46 +00:00
Treehugger Robot
7b640806da Merge "Revert "Remove all ZIP64LIMIT hack"" 2023-04-15 01:48:58 +00:00
Dennis Song
5da012adb0 Merge "Include META/* in the vendor item list when rebuild-sepolicy" 2023-04-15 01:15:44 +00:00
David Anderson
1c59617820 ota_from_target_files: Disable XOR on <T vendor.
Bug: N/A
Test: ota_from_target_files
Change-Id: Ia9093a3c3f79d88f98f0777e8a0f8c72741055b8
2023-04-14 16:01:55 -07:00
Kelvin Zhang
f92f7f046a Revert "Remove all ZIP64LIMIT hack"
This reverts commit 37a4290909.

Reason for revert: b/278156419

Change-Id: I67ea667619a9623be849d911993010ef0f0bfd88
2023-04-14 21:32:54 +00:00
Treehugger Robot
ebf41e9a91 Merge "Create separate python libraries for the following logic and refactor SBOM generation script accordingly." 2023-04-14 20:43:58 +00:00
Treehugger Robot
6fb4c8dcee Merge "Order entries in apex_info.pb" 2023-04-14 20:33:18 +00:00
Håkan Kvist
01e381954b Order entries in apex_info.pb
Adding the entries in apex_info.pb in sorted order makes it easier to
compare ota packages generated between the same source and target on
different computers/environments, ideally the generated ota zips should
be identical.

os.listdir() was used to find the apex files which should be
included in apex_info.pb. listdir() does not guarantee any order,
solution is to sort the result to ensure consistent order.

Bug: 278095305
Test: Manual. Confirm that apex_info.pb is generated sorted
    protoc --decode_raw < apex_info.pb
Change-Id: I2851d207f828a6ac31e63e20c9025965ac4b0eba
2023-04-14 10:36:04 +02:00
Dennis Song
09f5c5dc0b Include META/* in the vendor item list when rebuild-sepolicy
To ensure that `AddImagesToTargetFiles` can still be used with
vendor item list that do not specify all of the required META/
files, those files should be included by default.

Test: atest --host releasetools_test
Bug: 278133178
Change-Id: I5a04bfc43d405d6838028f2535ced2124dbd43aa
2023-04-14 12:13:42 +08:00
zhangyongpeng
707569711b Try with search_path for some avb path args
If we can't find relative signing_helper path, try with the OPTIONS.search_path dir prefix, and integrate the avb_*_key_path for the same logic.

Test: Build && releasetools_test

Signed-off-by: zhangyongpeng <zhangyongpeng@xiaomi.com>
Change-Id: Ifb1096ddea90693668f3344eb242bf9725113d11
2023-04-14 12:12:47 +08:00
Wei Li
dec97b1462 Create separate python libraries for the following logic and refactor SBOM generation script accordingly.
1) writer classes of generating SBOM in different SPDX formats
2) data classes to model the SBOM structure in SPDX

Bug: 272358880
Test: CIs
Test: build/soong/tests/sbom_test.sh
Test: atest --host sbom_writers_test

Change-Id: I1175cf0d99864bc4304559a59484ef0ba401cd64
2023-04-13 13:34:57 -07:00
Ibrahim Kanouche
8c745a436b Added validation to SBOM generator
Test: m compliance_sbom
Change-Id: I1ff2dfbc48361cfb785c64306112bc687ca51057
2023-04-13 16:10:12 +00:00
Treehugger Robot
858e08e0ca Merge "Fix s to t OTA" am: 64bfc41359 am: c4e1d12853
Original change: https://android-review.googlesource.com/c/platform/build/+/2531966

Change-Id: Ia20bdef8a788e1a4fbb8facf047c2bf211bd8495
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-13 01:46:13 +00:00
Treehugger Robot
64bfc41359 Merge "Fix s to t OTA" 2023-04-13 01:01:57 +00:00
Kelvin Zhang
6c5f1c32a3 Merge "Fix releasetools timeouts" am: 010bbea401 am: d434bd4c02
Original change: https://android-review.googlesource.com/c/platform/build/+/2530977

Change-Id: I6c8c2360e17434139d2f0beffe5c0af807e9595d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-12 16:39:03 +00:00
Kelvin Zhang
010bbea401 Merge "Fix releasetools timeouts" 2023-04-12 15:37:59 +00:00
Kelvin Zhang
629bc8dc1c Fix s to t OTA
Android S update_engine has a smaller minor version, we should use
update_engine version number from source build when generating an
incremental OTA.

Test: th
Bug: 277837157
Change-Id: Ic1ccdccd26c19bf9fb13d146a9151e699e481201
2023-04-11 21:30:42 -07:00
Treehugger Robot
766eaa6d78 Merge "Invoke delta_generator directly" am: 84031f7b49 am: 651e2a94c5
Original change: https://android-review.googlesource.com/c/platform/build/+/2529019

Change-Id: I7471c375cf5dc05680e71f64435325fb96159f2f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-12 02:49:54 +00:00
Treehugger Robot
af7728ebfe Merge "Script updates." am: b2be62551c am: acd53a5601
Original change: https://android-review.googlesource.com/c/platform/build/+/2530965

Change-Id: I5efe54f2055cda5ae02851ae374d7e99d64ed610
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-12 02:46:28 +00:00
Treehugger Robot
84031f7b49 Merge "Invoke delta_generator directly" 2023-04-12 01:00:43 +00:00
Treehugger Robot
b2be62551c Merge "Script updates." 2023-04-11 21:52:43 +00:00
Kelvin Zhang
ea84d42199 Fix releasetools timeouts
Release tools test uses sleep(5) to make sure mtime on files change in a
visible way. Use hardcoded mtime instead of sleeps.

Improvement: 145.6s -> 65s

Test: atest releasetools_test
Bug: 277782284
Fixes: 277782284

Change-Id: I4d7b04707f3b6c5843cde883f43e95a1e7a69879
2023-04-11 13:53:05 -07:00
Kelvin Zhang
fcd731e3d6 Invoke delta_generator directly
Currently, ota_from_target_files(a python script) calls
brillo_update_payload(a bash script), which then calls delta_generator(a
C++ binary) to do the actual diffing. Having brillo_update_payload in
the middle does not offer any additional flexibility, but it makes
maintaince more difficult. Bash code is less readable and harder to
debug. Further more, everytime we want to add a new flag to
delta_generator, we have to add the flag in three places:
ota_from_target_files, brillo_update_payload, delta_generator.

Historically, brillo_update_payload was there because we inherited from
ChromeOS side. This bash scripts extracts target_files.zip and invoke
delta_generator to generate the actual OTA. Any customizations we want
on OTA must be implemented by modifying the input target_files.zip ,
Manipuating big zip files is slow and inefficient.

To make thing simpler/faster, remove the intermdiary call to
brill_update_payload. ota_from_target_files will now extract target
files and call delta_generator directly.

Test: th
Bug: 227848550
Change-Id: I44b296e43bf7921bcf48ef6a1e4021a12669739c
2023-04-11 13:53:05 -07:00
Alex Buynytskyy
d98c43c8dd Script updates.
- add a mode to disable finalization steps if they were already merged,
- add the extension version into commit message.

Bug: 243966946
Test: local run
Change-Id: I51505e5d5715b56f3b385d714e1aabaae06f58ed
2023-04-11 16:51:03 +00:00
Dennis Song
7ffe8ab317 Merge "Support merging target files from directory" am: a0ffed1fa1 am: 609dd3b00f
Original change: https://android-review.googlesource.com/c/platform/build/+/2525591

Change-Id: I4fe623e0f07875ca112b593e83c00c048ceb436d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-11 06:51:03 +00:00
Dennis Song
a0ffed1fa1 Merge "Support merging target files from directory" 2023-04-11 05:40:05 +00:00
Treehugger Robot
fab0963700 Merge "Allow setting future api level before REL" am: 52fdcf5457 am: 9358c91d08
Original change: https://android-review.googlesource.com/c/platform/build/+/2527081

Change-Id: I9d22b49d076d6bf57b409c2871b01da79294ab70
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-11 01:20:50 +00:00
Treehugger Robot
52fdcf5457 Merge "Allow setting future api level before REL" 2023-04-11 00:09:23 +00:00
Treehugger Robot
7c93b50eca Merge "Check if an installed file exists and report error if not." am: 0bbde41728 am: 9d38ce9784
Original change: https://android-review.googlesource.com/c/platform/build/+/2529028

Change-Id: If6ae7c5d886b560a9e6bc67690e30e8c18b2459b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-10 19:17:50 +00:00
Dennis Song
5bfa43e5eb Support merging target files from directory
Expand `merge_target_files.py` API capabilities so that
`--framework-target-files` and `--vendor-target-files`
can be either zip archives or directories.

Test: Create a merged package by vendor target files folder
Test: atest --host releasetools_test
Bug: 276068400
Change-Id: I200be2a458ae59a61e05bfd7c78ab66093db32eb
2023-04-10 17:07:03 +08:00
Justin Yun
870ea2e188 Allow setting future api level before REL
At the dev stage, devices may set ro.board.(first_)api_level to the
future API level

Bug: 276927022
Test: test_post_process_props.py
Change-Id: I85c29af74ed8daa780278f64b023480bb6659781
2023-04-10 15:37:19 +09:00
Wei Li
3bcd0bca6f Check if an installed file exists and report error if not.
So far there is only one case happened in b/277039235 that an installed file in that product is moved to another directory in LOCAL_POST_INSTALL_CMD. The team agreed to convert to Android.bp, but better to add a check and report the error.

Resend this to check symlinks using os.path.islink(), which doesn't follow the link. os.path.isfile() follows symlinks and returns false since the symlinks are for devices and could not be resolved on host file systems.

Bug: 277039235
Test: m sbom
Test: build/soong/tests/sbom_test.sh
Change-Id: Ia9f1cd24dc974a3e41487bc17c9c76a26d419395
2023-04-07 16:36:30 -07:00
Wei Li
a4c29b4ecc Merge "Revert "Check if an installed file exists and report error if not."" am: 0bb86d0515 am: 3b488ddaac
Original change: https://android-review.googlesource.com/c/platform/build/+/2529026

Change-Id: I5f4574afa7e9899a75834975c47e9fba644dceca
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-07 22:37:55 +00:00
Treehugger Robot
579e5d2dcd Merge "Add comments explaining how secondary OTA works" am: d8e23f9519 am: a1c42f5b17
Original change: https://android-review.googlesource.com/c/platform/build/+/2527438

Change-Id: I56d60c850c851f47905d5c23a5543b3e67b29008
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-07 22:37:28 +00:00
Wei Li
0bb86d0515 Merge "Revert "Check if an installed file exists and report error if not."" 2023-04-07 21:40:09 +00:00
Wei Li
fd559f89b5 Revert "Check if an installed file exists and report error if not."
This reverts commit f049389e2e.

Reason for revert: the check includes more files that should not be excluded.

Change-Id: I7f7d260218826cc8fd033400b2cfaf40e4c280d0
2023-04-07 21:35:13 +00:00
Treehugger Robot
d8e23f9519 Merge "Add comments explaining how secondary OTA works" 2023-04-07 20:57:36 +00:00
Treehugger Robot
0ce108c06e Merge "Check if an installed file exists and report error if not." am: bd5a6e882d am: 1b3b6ff8b2
Original change: https://android-review.googlesource.com/c/platform/build/+/2527433

Change-Id: I287adc2e6ac3642368e46d09fc0468819d599783
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-07 18:37:05 +00:00
Kelvin Zhang
bd111ccae2 Add comments explaining how secondary OTA works
Test: th
Change-Id: I72f890e3dcb6f8369dea8071da040b4c27877a2b
2023-04-07 09:47:04 -07:00
Wei Li
f049389e2e Check if an installed file exists and report error if not.
So far there is only one case happened in b/277039235 that an installed file in that product is moved to another directory in LOCAL_POST_INSTALL_CMD. The team agreed to convert to Android.bp, but better to add a check and report the error.

Bug: 277039235
Test: m sbom
Test: build/soong/tests/sbom_test.sh
Change-Id: I9a2302ced6dd605e60e54c49a8778426444dcc4f
2023-04-07 07:33:11 +00:00
Alex Buynytskyy
7807b77323 Merge "Minor renaming and documentation." am: 0fce469f2d am: fc5ca8ba20
Original change: https://android-review.googlesource.com/c/platform/build/+/2526606

Change-Id: I40840fd9119090bd1aaef0ba24121dabba086412
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-07 00:34:03 +00:00
Alex Buynytskyy
0fce469f2d Merge "Minor renaming and documentation." 2023-04-06 23:38:33 +00:00
Alex Buynytskyy
307d9bcfdf Minor renaming and documentation.
Bug: 276752264
Test: local run
Change-Id: I75814313a81ca041fa1461e48733bd40a020b777
2023-04-06 15:28:39 -07:00
Alex Buynytskyy
f6729d2255 Merge "Copy ABI dumps from current/64 to FINAL_PLATFORM_SDK_VERSION/64" am: f5b6dd80ef am: ddc0d018e8
Original change: https://android-review.googlesource.com/c/platform/build/+/2527080

Change-Id: I3dc73e46ea6d20c9c168663947f910ef5b7ba5df
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-06 20:43:51 +00:00
Alex Buynytskyy
f5b6dd80ef Merge "Copy ABI dumps from current/64 to FINAL_PLATFORM_SDK_VERSION/64" 2023-04-06 19:52:00 +00:00
Jihoon Kang
398a89be8a Merge "Specify list_files to be built with embedded launcher" am: 0c76cab34e am: 10bc93a66e
Original change: https://android-review.googlesource.com/c/platform/build/+/2526959

Change-Id: I57a7cf94a8cf5c48ee69a0f75b348087341d62e1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-06 17:59:40 +00:00
Jihoon Kang
0c76cab34e Merge "Specify list_files to be built with embedded launcher" 2023-04-06 16:54:02 +00:00
Hsin-Yi Chen
ebce0d9501 Copy ABI dumps from current/64 to FINAL_PLATFORM_SDK_VERSION/64
Because prebuilts/abi-dumps/ndk/current contains additional ABI dumps
that are not included in the finalization process, the script copies
only the subdirectory to the finalized ABI dump directory.

Test: ./finalize-sdk-rel.sh
Bug: 276503801
Change-Id: I76287cf110323baf40035a957564a1e8f39e8015
2023-04-06 14:01:07 +00:00
Jihoon Kang
8f6edbbf04 Specify list_files to be built with embedded launcher
In the current use case of list_files, the module is built with a
possibly incompatible host machine's python version. This change fixes
this by specifying module to be built with embedded launcher.

Test: m list_files
Bug: 277124374
Change-Id: Id894271042136c9db50e63852075a8c4ef36a71e
2023-04-06 05:25:20 +00:00
Ibrahim Kanouche
52d2d30323 Merge "Added Document Fields to SBOM generator" am: aeeea61aa0 am: ac35dfa24a
Original change: https://android-review.googlesource.com/c/platform/build/+/2521055

Change-Id: I6714effcd6899c51feffe7f53b3247e17d3dcf7a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-05 21:06:14 +00:00
Ibrahim Kanouche
aeeea61aa0 Merge "Added Document Fields to SBOM generator" 2023-04-05 20:37:04 +00:00
Kelvin Zhang
3dc5fb7392 Merge "Fix choosing wrong diff tool for recovery-from-boot patch" am: 3aa4644117 am: c8e58a10a0
Original change: https://android-review.googlesource.com/c/platform/build/+/2501818

Change-Id: Ic11be84be27ee80860202f387961de1e518f6ff4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-05 17:46:57 +00:00
Kelvin Zhang
3aa4644117 Merge "Fix choosing wrong diff tool for recovery-from-boot patch" 2023-04-05 16:40:36 +00:00
Ibrahim Kanouche
f89fc4aa9b Added Document Fields to SBOM generator
Added functions to generate unique spdx doc namespace and generate a
clean document name

Test: m compliance_sbom

Bug: 265472710
Change-Id: I86ea9ddf50d066e139b757e8a093f98b8df8c81f
2023-04-04 18:53:10 +00:00
Jihoon Kang
5ab24a7070 Merge "Create a python script to list files given a directory as an input" am: 155095a314 am: 3a99151087
Original change: https://android-review.googlesource.com/c/platform/build/+/2516096

Change-Id: I219da8935b43c249ccad462ef0dd02d9f2db4fa1
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-04 00:26:04 +00:00
Jihoon Kang
155095a314 Merge "Create a python script to list files given a directory as an input" 2023-04-03 23:42:19 +00:00
Ibrahim Kanouche
a4c8c66a6e Merge "Revert "Revert "Updated SBOM generator module to generate JSON spdx utility bill of""" am: 960a4700e0 am: 0417e0417f
Original change: https://android-review.googlesource.com/c/platform/build/+/2518815

Change-Id: I01ea6aeb582477c61715eb18121b25e06a4f088b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-03 21:33:15 +00:00
Ibrahim Kanouche
960a4700e0 Merge "Revert "Revert "Updated SBOM generator module to generate JSON spdx utility bill of""" 2023-04-03 19:20:29 +00:00
Jihoon Kang
108379310d Create a python script to list files given a directory as an input
The script will be used in generating a file that lists generated stub
files from metalava, which will be passed to soong_zip to extract
selected stub files when generating stubs from java_api_library modules
with incomplete api surface text files.

Test: build java_api_library modules in aosp/2487335
Change-Id: I36b830f14c714315f81e3fd8608d84c29f673f83
2023-04-03 17:52:41 +00:00
Ibrahim Kanouche
91f2f9d851 Revert "Revert "Updated SBOM generator module to generate JSON spdx utility bill of""
This reverts commit 928ee9d9f7.

Reason for revert: Fixed the initial cause of the revert. Added spdx-tools to the missing branches. See b/276427351

Change-Id: I7bd0b3f194b27dc9a255ccadeb2a9a12a3d59f66
2023-04-01 21:24:30 +00:00
Treehugger Robot
c8fb22c156 Merge "Move adb keys creation to CI-only step." am: 90206e3493 am: 32e87bddce
Original change: https://android-review.googlesource.com/c/platform/build/+/2518355

Change-Id: I8cedaec529422aa8a6f861d817323192f4373fa0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-04-01 04:13:44 +00:00
Alex Buynytskyy
5dfdbe12bc Move adb keys creation to CI-only step.
It's easily automatable build step, but it needs to be done way before
REL to allow enough time for manual key propagation.
As such, moving it to local step.

Bug: 243966946
Test: manual
Change-Id: I979e8500c3c0b768af30dff93c9b73ab998a0151
2023-03-31 22:20:29 +00:00
Bob Badour
710e637732 Merge "Revert "Updated SBOM generator module to generate JSON spdx utility bill of"" am: 00670e0c03 am: 73536cb8b4
Original change: https://android-review.googlesource.com/c/platform/build/+/2517455

Change-Id: If3f21e68105fccf843012d78dc19027231c41fa2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-31 17:39:21 +00:00
Bob Badour
00670e0c03 Merge "Revert "Updated SBOM generator module to generate JSON spdx utility bill of"" 2023-03-31 15:56:17 +00:00
Bob Badour
928ee9d9f7 Revert "Updated SBOM generator module to generate JSON spdx utility bill of"
This reverts commit e97adc5db9.

Reason for revert: Roll back until the kernel manifests are updated with the spdx-tools library.

Change-Id: Ib2327862acd928ebcea0f328daecc162b46d2c78
2023-03-31 14:51:36 +00:00
Treehugger Robot
dc77a78bed Merge "Updated SBOM generator module to generate JSON spdx utility bill of material" am: 09df4c6562 am: 63734a593f
Original change: https://android-review.googlesource.com/c/platform/build/+/2497576

Change-Id: I363ffc954d2659c77ae92e66a83c7971628992f5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-31 09:04:36 +00:00
Treehugger Robot
09df4c6562 Merge "Updated SBOM generator module to generate JSON spdx utility bill of material" 2023-03-31 07:05:53 +00:00
Ibrahim Kanouche
e97adc5db9 Updated SBOM generator module to generate JSON spdx utility bill of
material

Test: m compliance_sbom

Bug: 265472710
Change-Id: Iad9ddbd2abf17ff0b034f1410c55dd99051f7127
2023-03-30 23:34:32 +00:00
Oleg Lyovin
6d75a854ef Fix choosing wrong diff tool for recovery-from-boot patch
'bsdiff' tool should be used when recovery and boot image
have mismatching entries. This includes not only the case
when system_as_root enabled, but include_recovery_dtbo and
include_recovery_acpio too.

Add check if they are enabled to synchronize logic with
core/Makefile, which already takes this into account.

Test: make dist -j
Change-Id: Ie673403ae8eae446d006cc524dd48ac6c56194fc
Signed-off-by: Oleg Lyovin <ovlevin@sberdevices.ru>
2023-03-22 17:53:26 +03:00
Treehugger Robot
e2b36a78d8 Merge "Rename rbcrun/cmd to make go install work properly" am: 7a40e97d74 am: 191c775746
Original change: https://android-review.googlesource.com/c/platform/build/+/2492675

Change-Id: I38c87021bf2330a3cf59ac0523184bac263ed93f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-16 20:58:51 +00:00
Treehugger Robot
7a40e97d74 Merge "Rename rbcrun/cmd to make go install work properly" 2023-03-16 20:26:22 +00:00
Wei Li
58230623d7 Merge "Clean up the strings and use f-strings instead of string.format()." am: 4e824bc8e8 am: 757ba511e2
Original change: https://android-review.googlesource.com/c/platform/build/+/2491846

Change-Id: I25506dc0f3c21c413833a832bfc9045ca21b5d8c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-03-16 05:04:34 +00:00
Dan Willemsen
ec5e3b8d28 Rename rbcrun/cmd to make go install work properly
The standard go tooling assumes that a package's binary name should be
the name of the containing folder. Before this change, `go install` or
`go build` (without `-o`) names this binary `cmd`.

Also run `go mod tidy` while we're here, so the tooling doesn't try to
download github.com/nbutton23/zxcvbn-go, which we don't have a local
copy of.

Test: treehugger
Change-Id: I8f79724e928720caf961cdad128655ef31c3e9b2
2023-03-15 20:06:59 -04:00