This commit updates the error message in
modify_parsed_flags_based_on_mode, when there is no certain mode flags
in the corresponding library, and this change remove "." at the end of
the error message to conform to existing standard in this project.
Bug: 311152507
Test: atest aconfig.test
Change-Id: Ib120e7f7252981bbeb6ca1cf785da24f329507b4
This CL is part of a larger effort to simplify maintenance by removing
format aliases: with the new --format option, clients of `aconfig dump`
can specify the format they need themselves.
This CL removes the last of the format aliases.
Bug: 317044914
Test: m
Change-Id: I09b706b9931a85a86c17be359902245b9b53d584
This CL is part of a larger effort to simplify maintenance by removing
format aliases: with the new --format option, clients of `aconfig dump`
can specify the format they need themselves.
Bug: 317044914
Test: m
Change-Id: I4db31eb3fe03c34118d61a0a1911e12f5049b77d
This CL is part of a larger effort to simplify maintenance by removing
format aliases: with the new --format option, clients of `aconfig dump`
can specify the format they need themselves.
Bug: 317044914
Test: m
Change-Id: I11efc5d7280402f503ddd05f2dc65bb15ffd8ac7
A few new aconfig tests have been created. Add them to TEST_MAPPING as
postsubmit tests.
Bug: N/A
Test: atest :all
Change-Id: Ifa4d764d26114367227c9c5622fb31b304a6972c
Checking ro.build.date.utc to detect a downgrade is not enough in the
case where several target files are merged, as timestamps can differ
for each partition.
The solution is to check the build timestamp for each partition and
ro.build.date.utc.
With this change ota generation will be aborted during creation
instead of rejected when installing on device.
This also fixes the --override_timestamp so it is possible to generate
a package where timestamps are reversed, as was added in:
3e6161a3b3.
Issue: 315913966
Test: Manual, confirm that ota generation is aborted when timestamp
on post vendor partitions is newer than on pre.
Ota created successfully with --override_timestamp parameter and
installation successful
Test: atest --host releasetools_test
Change-Id: I275e67a3840f4ef2263381c253231068e72f47d2
Rename the 'dump' subcommand to 'dump-cache' for better symmetry with
'create-cache', and to prepare for a potentially upcoming
'dump-storage' subcommand.
Keep 'dump' as an alias for 'dump-cache' for backwards compatibility.
Bug: N/A
Test: m
Change-Id: I521ce507985e4cf450ee1b8517993b798f11430c
Before this change java codegen filter flags for exported mode in the
template. This change move the filter process to commands as other
codegen. Thus the codegen code will only generate code based on the
passed in flags.
Bug: 311152507
Test: atest aconfig.test aconfig.test.java AconfigJavaHostTest
Change-Id: I74045709cde19e6c687c3eb0d94050ea40cf5042
This commit changes modify_parsed_flags_based_on_mode to return Result
instead of vector. This change will have two consequences.
1. Error will be thrown if no flags fit into the current codegen mode
2. Error will be thrown if the flag declaration is empty
Bug: 311152507
Test: atest aconfig.test
Change-Id: I69b9a84312faed9f757bf3974b3cea49c5c5e285
For each container, there will be three storage files: package.map,
flag.map and flags.val. This change adds package.map creation.
package.map is a hash table in file that maps a package name to its
package id and package value offset. This file will be used by flag
storage client lib to locate the fixed offset of a flag in flag value
file. package.map provides the file byte offset to the start of all flag
values for this package. Together with flag value offset within its package
which will be provided by flag.map, we can locate a flag's value in the
value file.
The top level struct for this file is called "PackageTable". The struct
consists of three parts: (1) table header which includes the file
version and other metadata such as number of packages and etc. (2) table
buckets which is an array of u32, each bucket stores the package.map
file offset to the package table node. (3) package table node array.
each node stores package name, package id, package value offset and
offset to the next package table node.
The table uses fixed format serialization. All u32 are encoded using
little endian format as that is the Android format. All strings are UTF8
encoded. This is to ensure cross platform compatibility.
Bug: b/312243587
Test: atest aconfig.test
Change-Id: I1041405db42862573ec320c0e557948732c28eb8
This commit adds exported mode to rust codegen.
When the codegen mode is exported
1. only flags with exported: true will be generated
2. the generated getter should be in a read_write format and with
default value as false, regardless the original permission and state
of the flag
This commit adds integration test for rust codegen exported mode.
Bug: 316357104
Test: atest aconfig.test aconfig.test_mode.test.rust aconfig.exported_mode.test.rust
Change-Id: Ib7dae666e13eb8898289b06d42a4f89326e175c4
This commit adds a new testing flag enabled_fixed_ro_exported to test
the case of a exported and fixed_read_only flag.
Test: atest aconfig.test aconfig.test.java AconfigJavaHostTest
aconfig.test.cpp aconfig.test.cpp.test_mode aconfig.prod_mode.test.rust
Bug: 316357680
Change-Id: Iaedb8a6875166c6a6d24c7c3deee701a496b4964
This commit adds exported mode to c/c++ codegen.
When the codegen mode is exported
1. only flags with exported: true will be generated
2. the generated getter should be in a read_write format and with
default value as false, regardless the original permission and state
of the flag
This change moves process parsed_flags funciton into codegen crate. The
process function is used to process parsed_flags based on the codegen
mode.
The template has also modified to keep readability.
Bug: 316357680
Test: atest aconfig.test aconfig.test.cpp aconfig.test.cpp.test_mode
Change-Id: I511e05ab93b07a04236055d956d1926f4ed89f36
Add support for filtering by fully qualified flag name. (This should
have been part of aosp/2878034.)
Bug: 315487153
Test: atest aconfig.test
Change-Id: I4cd209d6f6940dcaa138e8e0b8e580cea99c350f
similar to general-tests.mk, this will avoid recomputing sha256 when
uploading target files to RBE.
Test: presubmit
Bug: 316952196
Change-Id: I879214ac79f5c269f337fafcede8513c1e90e60e
1, Current codegen would still include an empty flag value cache even if
there are no read write flags. This is important as the flag value cache
is a std::vector. Thus adding this cache would automatically pull in
libc++ dependency which we should not.
2, There lacks of c/c++ codegen unit tests to lock down the generated
code when a flag package contains only read only flags. It should not
include server_configurable_flags header. And it should not include the
flag cache.
Bug: b/316614694
Test: atest aconfig.test
Change-Id: Iee4366672932ee507694f5fc73b526c66fcf0e9b
The aconfig dump command can now limit which flags to print by passing
in one or more --filter=<query> commands.
If multiple --filter arguments are provided, flags that match any filter
will be included in the output.
The <query> syntax is <what>:<value>, where <what> is the name of a
ProtoParsedFlag field. Multiple queries can be AND-ed together by
joining them with a plus ('+') character.
Example queries:
- --filter='is_exported:true' # only show exported flags
- --filter='permission:READ_ONLY+state:ENABLED' # only show flags that are read-only and enabled
- --filter='permission:READ_ONLY' --filter='state:ENABLED' # only show flags that are read-only or enabled (or both)
Current limitations that may be addressed in future CLs:
- No support to invert a query, e.g. "flags *not* in the following
namespace"
- No support to quote strings; this makes description matching
difficult
- No support to glob strings, only exact matches are considered
- No support to filter by description, trace or metadata fields
Bug: 315487153
Test: atest aconfig.test
Test: printflags --format="{fully_qualified_name}={state}" --filter=permission:READ_ONLY # manually verify output
Change-Id: Ie1e40fa444cec429e336048439da955f30e22979
* changes:
aconfig: pass ownership of ProtoParsedFlag items to Java codegen
aconfig: pass ownership of ProtoParsedFlag items to C++ codegen
aconfig: pass ownership of ProtoParsedFlag items to Rust codegen
This is the first step towards teaching dump to (optionally) filter
which flags to print.
A follow-up CL will implement dump::create_filter_predicate.
Bug: 315487153
Test: atest aconfig.test
Change-Id: Ibe0d4ce6563d3b5718fedd3ebfd45fbf5d935b92
Teach `dump --format=<arg>` to format the output according to a
user-defined format string. The format string now accepts these
arguments:
- "protobuf": output all data as binary protobuf (as before)
- "textproto": output all data as text protobuf (as before)
- any other string: format according to the format spec, see below
Custom format spec: placeholders, enclosed in { and } and named after
the fields of ProtoParsedFlag, will be replaced by the actual values.
All other text is output verbatim. As an example:
- "{name}={state}" -> "enabled_ro=ENABLED"
Some fields support an alternative formatting via {<field>:<format>}. As
an example:
- "{name}={state:bool}" -> "enabled_ro=true"
Note that the text replacement does not support escaping { and }. This
means there is no way to print the string "{name}" without expanding it
to the actual flag's name. If needed this feature can be introduced in a
later CL.
For backwards compatibility, the following format strings have special
meaning and will produce an output identically to what it was before
this change:
- "text"
- "verbose"
- "bool"
A follow-up CL will add a new `dump --filter=` argument to limit which
parsed flags are included in the output.
Test: atest
Bug: b/315487153
Change-Id: If7c14b5fb3e7b41ea962425078bd04b4996318f4
Raising the go.mod version to 1.17 or higher enables module graph
pruning (https://go.dev/ref/mod#graph-pruning), which prevents the
go tools like "go build ./..." from loading unused transitive
dependencies, including ones that are missing from our tree.
Bug: 314133304
Test: prebuilts/build-tools/build-prebuilts.sh
Change-Id: If1cc0fda1dc744e65fc3367b7f44b8c91230e5ce
Pass ownership of the ProtoParsedFlag iterator items to the Java
codegen: this removes the need for an explicit lifetime annotation.
Bug: N/A
Test: atest aconfig.test
Change-Id: I78705b65b4cf41c3e23b59afbd122a029ee45df4
Pass ownership of the ProtoParsedFlag iterator items to the C++ codegen:
this removes the need for an explicit lifetime annotation.
Bug: N/A
Test: atest aconfig.test
Change-Id: Ic6606a9ab01ddcb61aa668d7ac901469b1e25a1f