Teach `aconfig dump` to print its as text protobuf.
Bug: 288713733
Test: atest aconfig.test aconfig.test.java
Change-Id: Id31ce53226162a563fbe2d4841a8f6cf96c22436
This reverts commit 7c4f064a2b.
Reason for revert: this caused some CI breakages on git_master, mainline_modules_xxxx
Change-Id: I95354db66991f6c257164d6f808b9fe4350673c1
GNU make bits for https://android-review.git.corp.google.com/c/platform/build/soong/+/2625692.
Bug: N/A
Test: Build {libc, libm, libc++, libm, and libnetd} in internal master
with these patches and an experimental compiler with the lld support.
Also, `SANITIZE_TARGET=memtag_globals m` here with in-tree compiler
without lld support.
Change-Id: I44c239ba907a90a355c46e12afbbbe96bb2e4426
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
Soong no longer supports "flattened" apex. This makes
TARGET_FLATTEN_APEX no-op.
Will remove TARGET_FLATTEN_APEX later.
Bug: 279835185
Test: m && launch_cvd (cuttlefish)
Change-Id: I27c6181f5107fd27552304c5dd25d2c0a21c4bec
We will deprecate flattened apexes. In this change, GSI-specific make
variable (PRODUCT_INSTALL_EXTRA_FLATTENED_APEXES) is removed. The
variable was used to install both image/flattened apexes in the GSI, so
that it works on ro.apex.updatable devices and not-updatable devices.
Now, GSI will have only image APEXes in it.
Bug: 278826656
Test: lunch gsi_arm64-userdebug && m # no flattened apexes
Change-Id: I4702973d4ee75aa693e4e7f4e57577b77059dc09
If the device uses the CMC GC, the file will contain:
extra-args = --runtime-arg -Xgc:CMC
Otherwise, the file will contain an empty line:
extra-args =
Bug: 287652269
Test: -
1. m dist out/dist/boot.zip
2. unzip -p out/dist/boot.zip METADATA.txt
Change-Id: I3d50367eb2a341e1c03286d7a2cd7ed44d59708f
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
to the equivalent soong variable.
Bug: 287607876
Test: Manual test - add a log message to wifi_ext that
only prints if the proper flag is enabled.
Check whether the log is displayed, both before
and after this change.
Change-Id: Id9bfc81384384b915e9772a2016a9843a57897db
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
map_file_generator can generate map files from erofs and ext# file
systems. Check the file system type and copy images and generate map
files if supported. Otherwise skip these steps.
If the image files are not copied, add_img_to_target_files will
generate the image files and map files.
Bug: 286870582
Test: lunch bertha_x86_64-userdebug && m dist
Change-Id: Ib92dd989cf61b1e376107a507eae9222ceb1d0d4
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
The decision to support updatable APEX or not used to be SoC-specific
because updatable APEX (aka non-flattened APEX) requires some kernel
feature support like loopback device. Kernel was considered as part of
BSP then. Therefore, ro.apex.updatable property was in the vendor
partition.
However, with GKI, kernel is no longer SoC-specific. And most APEXes are
installed to the system partition, which means that the decision affects
how the system partition is built. Thus, this CL moves the property to
the system partition. This enables some partners who have been using
flattened APEX to be able to upgrade to non-flattened APEX without
having to upgrade the vendor partition.
Bug: 281007951
Test: check system/build.prop
Change-Id: I81874076862f6047b9daa14518b95adcb5275064