1, Moved "#include <string>" from exported header to test flag provider
header file.
2, For production target and read only flags, the generated c
api should just return default value instead of calling into c++ api
3, Remove using namespace server_configurable_flags from header, instead
of just having the namespace to be spelled out in each api call. Having
using namespace xxx in header is not a c++ best practice.
4, Replace #ifdef #def #endif with #pragma once
Bug: b/279483801
Test: atest aconfig.test
Change-Id: I3e55a7b14301f3de419795467f33e2dc889d371e
Two major changes to c/c++ codegen
(1) explicit setter for each flag instead of a generic flag setter
void override_flag(std::string name, bool val) is replaced with
void <flag name>(bool val) for each flag name
This has several advantages:
(a) generated code is more c++ idomatic
(b) no longer need to create flag name string constants
(c) any typo in the code is caught early in the build time
(2) remove flag setter and flag override reset methods/functions when
generating code targets for production. If developers want to update
their main function to take command line arg for flag overrides, they
can use compile time macros to decide if the flag override code should
be included.
Bug: b/279483801
Test: atest aconfig.test
Change-Id: I6141f7f979b32fe0426154d578edeb997ae5ff7c
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
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
Python's zipfile doens't restore file permission by default, so we need
to manually restore permission.
Test: th
Bug: 290643514
Change-Id: I89c1e2ee178b534fa7e3f02afd04d170100d37e7
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
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
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
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
Add FlagAnnotationTests in presubmit to ensure that test filtering rule
always works as expected.
Test: atest --test-mapping
Bug: 277819423
Change-Id: I7cc3a70495f8d62ed7a5b26edc4fd240e73ccf61
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
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
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
Use is_valid_name_ident to check the flag name, not
is_valid_package_ident.
Bug: 283910447
Test: atest aconfig.test
Change-Id: I3718e7de565b975a1696190e8effbcb077e5fde2
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
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
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
The flag enables list_files to output a list of .class files pattern
that will be generated when compiling the java files in the input
directory. The flag can be used to extract the appropriate class files
from stub jar file provided via dep_api_srcs in per api scope
sdk_library generated java_api_library modules.
Test: m --build-from-text-stub in same topic
Bug: 275570206
Change-Id: I134fcd9781024dcb6781297d02645f5fb9befb18
Flattened apexes are deprecated. mege_dexopt does not need to care about
flattened apexes.
Bug: 278826656
Test: m otapackage
Change-Id: I527eed64c5f1a7466e2c48d73360f47f6cfa0911
Teach `aconfig dump` to print its as text protobuf.
Bug: 288713733
Test: atest aconfig.test aconfig.test.java
Change-Id: Id31ce53226162a563fbe2d4841a8f6cf96c22436
Add a `bug` field on the flag_declaration and parsed_flag proto
messages. This field is optional in the sense that it can occur zero or
more times, and aconfig will simply pass any value through.
Bug fields are included in the aconfig dump format, which can be
processed by other tools.
Also unify how protos.rs checks that fields marked 'optional' in the
proto file, but in practice are 'required', are actually set.
Test: atest aconfig.test aconfig.test.java
Bug: 288261336
Change-Id: I93de0005674822c6ff4d699bdc2c6509763a7f7f
Bug: 285303012
Test: for x in next trunk trunk_food trunk_staging ; do lunch aosp_panther-$x-eng ; m nothing ; done
Change-Id: I174ce3e609fa9077ea6bc61679ddb83e8efe57c8
python3.11's zipfile implementation does not handle symlinks. This
causes important symlinks in ramdisk to be broken, and later causing a
boo failure.
Test: unzip a target files with symlinks, make sure symlinks are created
Bug: 287896098
Change-Id: Ia7d6ac8ffb03807680a36ff648aa11afafb7f481
Change all required proto fields to optional. While the proto file is
supposed to be a backwards compatible API, and fields are not supposed
to be deprecated, this commit will allow for that option if needed.
Implementation wise this change doesn't matter much: any parsed data
needs additional verification outside what the protobuf crate's parser
provides anyway, so adding checks to verify that all required fields,
even though marked optional in the proto file, were found is a minor
increase in code complexity.
If in the future a proto field should no longer be used:
- keep the field in the proto, still marked optional and clearly
document that it is no longer in use
- change protos.rs from checking struct.has_field() to explicitly
dropping any value via struct.clear_field()
Bug: 286337317
Test: atest aconfig.test
Change-Id: Iad1ccfe50ecac286ff7a796aec909bec70b9520d
Generate Java constants for use in @FlaggedApi(flag = ...).
Also update the generated Java code to use the constants when reaching
out to DeviceConfig instead of hard-coding (duplicate) strings.
Bug: 285288440
Test: atest aconfig.test aconfig.test.java
Change-Id: I1127cacba650cc7a7896b1533e03631d7f5ec71b
Remove the hand-crafted wrappers around the structures auto-generated
from protos/aconfig.proto, and use the auto-generated structs directly
intead. This gets rid of a lot of manual repetition, and its inherent
risk.
Also unify how individual fields read from text proto are verified (e.g.
is the flag.name field a valid identifier).
Also change the intermediate cache format from JSON to binary protobuf.
The concept of a 'cache' as an intermediate internal format to represent
parsed input stays. The command line interface still refers to caches.
At the moment a cache file is identical to a parsed_file protbuf, and
the code exploits this internally.
A couple of points regarding the auto-generated structs:
- Vectors are named in the singular (e.g. parsed_flags.parsed_flag is
a Vec<ProtoParsedFlag>) because this improves ergonomics for all
devs working with aconfig input files
- The auto-generated structs have fields that are of type Option<T>
and convenience methods (named the same as the fields) to access T
Test: atest aconfig.test aconfig.test.java
Bug: 283910447
Change-Id: I512820cc4bc6c543dea9f6a4356f863120a10be3
Before java code will directly use the flag name as the method name.
This change adds funciton to try the best to convert flag name to
camelCase, and then use the camelCase string as the method name in the
generated code.
Bug: 279483816
Test: atest aconfig.test aconfig.test.java
Change-Id: I45fc6df46c9d535cd38a657a41313202f9b660af
Group statements with identical #[cfg(feature = "cargo")] attributes in
the same block. This reduces repetition and makes the code easier to
read and less error prone.
Bug: 284779868
Test: atest aconfig.test
Change-Id: Iebdcd20e7cd22cb641424a1af594f5c9ac57b623
Partition images are allowed to be in either IMAGES/ or RADIO/ dir of a
target_files zip, so when searching for .map files we should look in
both dirs.
Test: th
Bug: 227848550
Change-Id: I0a9d2c582d8f5d570237434902fac012513c9aad
This change includes
- refactor generated java code to generate
- Flags.java to support the static API
- FeatureFlagsImpl.java to support injection API
- FeatureFlags.java interface
Bug: 279483816
Test: atest aconfig.test aconfig.test.java
Change-Id: If0d4baf317b9174635cd0fff3832ab7091ee52ed
The Java codegen may translate flag names (snake_case) to Java
camelCase, dropping the underscores. The flags a_b and a__b will
translate to the same camelCase form, which is ambiguous.
Circumvent this problem by disallowing consecutive underscores in flag
names, flag namespaces, and packages.
Bug: 284252015
Test: atest aconfig.test
Change-Id: I2586a38160723c06265a140193da8178655553e4
So that we have a more restricted enviornment for this new configuration
axis that can also be imported into other tools more easily.
Test: Manually (this time also tested setting OUT_DIR outside of the tree)
Change-Id: I01d90e06e45cba756156af16f63e04f575877263
Supply generator with parameter --apex_info_file=META/apex_info.pb
if the file exists.
This ensures that apex_info is included in payload header.
This is identical to the behaviour of brillo_update_payload
which is not being used since:
Invoke delta_generator directly
fcd731e3d6
Issue: 286253576
Test: Manual, confirm that apex_info is included in payload header
Change-Id: Ic096c5f8966beec8686f918aba462c955290a6c5
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
* 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
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
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
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
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
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
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
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
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
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
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
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
Remove unnecessary use from the cache::test module: they already covered
by `use super:*;`.
Bug: 283910447
Test: atest aconfig.test
Change-Id: I9e03385629f38180c0f92080c7f097a8e0d9ef69
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
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
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
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
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
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
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
The whole GTS-Verifier will be removed. Before that, remove GTS-V
license check first.
Ignore-AOSP-First: This CL must be submit with other CLs in the topic to avoid breaking the test. This CL will be cherry pick to AOSP after submitting.
Bug: 283384166
Test: m gts
Change-Id: I5bc8c1f4609f55cedd5bfbed014b65de164e2b16
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
(cherry picked from https://android-review.googlesource.com/q/commit:fd7e6517d345d3b8d4af12dae345434d968b83b9)
Merged-In: I41622366e5e6ed9dc78cca7bc7bb69a1f8f9bd9f
Change-Id: I41622366e5e6ed9dc78cca7bc7bb69a1f8f9bd9f
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.
(cherry picked from https://android-review.googlesource.com/q/commit:1f93ce20c5a5f3e7c2f6b5e1f9fdc4d2572220cc)
Merged-In: I3b926b8cd69bc74dff6ccf8b5ccc72bedffcac6f
Change-Id: I3b926b8cd69bc74dff6ccf8b5ccc72bedffcac6f
Adding an option to configure max number of threads used during
ota_from_target_files
Bug: 277794445
Test: tested ota_from_target_files
(cherry picked from https://android-review.googlesource.com/q/commit:a30989bafa820faf24eca7e11e48f8f122d7991f)
Merged-In: I9bae92ee43c21926434ab04563a2b4f0678b73eb
Change-Id: I9bae92ee43c21926434ab04563a2b4f0678b73eb
this patch is necessary for partner to improve OTA generation b/277794445
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
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
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
Rename enum Format to enum DumpFormat to make it more apparent what it
refers to.
Bug: 279485059
Test: atest aconfig.test
Change-Id: I869be020b69618b036fa05247f155d9e35ff85e2
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
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
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
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
if output_zip isn't None, writing into zip file in parallel is not
thread-safe.
Bug: 281960217
Test: m dist
Change-Id: I10d68a4bb779cee244f40410ec95d38ca6040306
it made total time equal to the longest image build
1m10s->30s in local build
Bug: 281960217
Test: m dist
Change-Id: I13d4f45d9b46b39292a014e3b4e1913365d89b7a
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
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
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
Modifying img_from_target_files to also add fastboot-info to
updatepackage
Test: m updatepackage
Bug: 194686221
Change-Id: I2e08c4269f0d83417b9d7079633bc28796d1cdd6
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
For example, pvmfw.img comes from framework target files package
and dtbo.img comes from vendor target files package.
Bug: 270241811
Test: merge_target_files
Merged-In: If2e6fac5ce3671e3387e801808a195fb7b2c55b5
Change-Id: If2e6fac5ce3671e3387e801808a195fb7b2c55b5
(cherry picked from commit 81c3f4a884)