This change adds flag files in mainline module into the read path of
printflags.
Bug: 327466668
Test: build image, flash device with new image, and adb shell printflags
Change-Id: I3c88019086b17ce2eed3c00afff651b1ebd55353
Previously, aconfig repo is the root directory of aconfig binary crate,
but it also hosts printflags crate inside, and there is no cargo support
for printflags binary crate. In addition, with more aconfig development,
more crates are being added to this repo. Thus this repo should be
configured as a Cargo workspace with multiple crates rather than a
single crate.
Note the top level Cargo.toml file specifies the crates this workspace
carries:
(1) aconfig_protos: the proto library crate that will be used by many other
crates such as aconfig binary crate and printflags binary crate
(2) aconfig: the aconfig binary crate
(3) printflags: the printflags binary crate
(1) aconfig_protos crate setup:
Inside aconfig_protos dir we set up the aconfig_protos crate, the
previously src/proto.rs is now aconfig_protos/src/lib.rs, the build.rs
is carried over to this crate.
(2) aconfig binary crate setup:
Notice its Cargo.toml file claims package dependency on aconfig_protos
crate. It no longer carries proto related module and build.rs file.
(3) printflags binary crate setup:
Similary, notice that in its Cargo.toml file, it claims package
dependency on aconfig_protos crate.
With this setup, we can Cargo build/test each crate individually when
inside a specific crate dir. But we can also run Cargo build/test at
repo root level, which will build/test all the crates in this workplace.
This is the structuring cl. The next cl is to move storage modules into
its own library crate. This storage file library crate will be used by
both aconfig binary crate as well as flag read library crate (to be
created as another new crate here).
Bug: b/321984352
Test: top and individual crate dir level Cargo build/test, m each
individual targets
Change-Id: I75833f4997f7ee554ff6c1557df9ac87f62b2732
Merged-In: I75833f4997f7ee554ff6c1557df9ac87f62b2732
The aconfig tests used to be implicitly run by Treehugger, but something
has changed and Treehugger no longer verifies aconfig uploads. Fix this
by explicitly listing all aconfig tests in the TEST_MAPPING file.
Treehugger does not allow new tests in presubmit before they have proven
themselves (in terms of flakiness and execution speed) in postsubmit.
For this reason this CL adds the tests to postsubmit; a follow-up CL
will move them to presubmit.
This has the added benefit of allowing developers to easily run all
tests locally, either by
$ atest
if current working directory is build/tools/aconfig or one of its
subdirectories, or
$ atest --test-mapping $(gettop)/build/tools/aconfig
from anywhere in the Android tree.
Also add all tests to "general-tests" to enable Treehugger to run them.
Move aconfig.test from "device-tests" to "general-tests"; the former
group is intended for tests that depend on device-specific
functionality. See [1] for more info.
1. https://source.android.com/docs/core/tests/development/test-mapping
Bug: N/A
Test: atest --test-mapping $(gettop)/build/tools/aconfig
Change-Id: If857733834c8ad43a16e6162e50e6b1f713f979d
Include the file path and first bytes of file in the error message in
case aconfig fails to parse one of the protobuf files.
Example output:
$ adb shell printflags
Error: failed to parse /vendor/etc/aconfig_flags.pb ([0a], 1 byte(s))
Caused by:
Unexpected EOF
Bug: 304278614
Test: atest printflags.test
Change-Id: I18ff88bd25d72dd477c4b11a32505e75884906ee
Amend the default flag values read from
/<partition>/etc/aconfig_flags.pb with the currently used values as
stored in device_config.
Bug: 301547297
Test: atest printflags.test
Test: adb shell printflags
Change-Id: Ic11702a0ae093d2e9dc3ff543b5ca0684b67e0dc
Metadata about all feature flags used on device are located in
/<partition>/etc/aconfig_flags.pb. Add a new tool, printflags, to read
and pretty-print these files.
printflags is only intended for debugging purposes.
Bug: 301547297
Test: adb shell printflags
Change-Id: I0a3277fecfc8a60eea0aa6bf362a25a311360b71