Commit graph

8711 commits

Author SHA1 Message Date
Ted Bauer
ca355c09a2 Merge "Revert^2 "Cache Java codegen'd flags in static member variables."" into main 2023-11-16 18:48:00 +00:00
Ted Bauer
c3073786b3 Revert^2 "Cache Java codegen'd flags in static member variables."
This reverts commit efda207c09.

Reason for revert: this unrevert contains the fix for b/311187402

Test: cargo test
Change-Id: I210aebd30edd864a7c141ede336c12aebf4f1fcd
2023-11-16 12:26:41 -05:00
Aditya Choudhary
432c41ecbf Merge "Refactor metadata tool to support metadata generation for different rules." into main 2023-11-15 22:11:22 +00:00
Treehugger Robot
5003ff741a Merge "Move signing related options to a shared place" into main 2023-11-15 18:32:40 +00:00
Treehugger Robot
f0e5c7e321 Merge "Allow ParseOptions to compose multiple option parsers easily" into main 2023-11-15 18:32:00 +00:00
Aditya Choudhary
a96ce3223a Refactor metadata tool to support metadata generation for different rules.
Bug: 296873595
Test: Manual test (use go test inside tools/metadata/testdata)

Change-Id: I881fd76213ec78001f9e12ed2fbc860d1503a364
2023-11-15 18:05:11 +00:00
Ted Bauer
a06cff1048 Merge "Revert "Cache Java codegen'd flags in static member variables."" into main 2023-11-15 18:04:10 +00:00
Aditya Choudhary
4277d617f2 Merge "Add metadata generator tool for test spec metadata generation. Bug: 296873595 Test: Manual test (use go test inside tools/metadata/testdata)" into main 2023-11-15 17:13:28 +00:00
Ted Bauer
efda207c09 Revert "Cache Java codegen'd flags in static member variables."
This reverts commit afe55106e5.

Reason for revert: causes a bug b/311187402

Change-Id: Ic3f56fbb66a6412cd702cebd9e4247032f950324
2023-11-15 16:52:02 +00:00
Jihoon Kang
3b12b769e4 Merge "Set BUILD_FROM_SOURCE_STUB=true for finalization" into main 2023-11-15 16:29:12 +00:00
Aditya Choudhary
51f97c1963 Add metadata generator tool for test spec metadata generation.
Bug: 296873595
Test: Manual test (use go test inside tools/metadata/testdata)

Change-Id: I404b57224828149f26bcf4deadb662f513886231
2023-11-15 16:08:14 +00:00
Jihoon Kang
59c61acf64 Set BUILD_FROM_SOURCE_STUB=true for finalization
Build from text stub feature was initially implemented to improve build
performance and may be unstable for api finalization, as the stubs
generated from api signature files miss some methods, which may cause
backward compatibility issues. Therefore, this change disables building
from text stub for api finalization.

Test: build/tools/finalization/finalize-aidl-vndk-sdk-resources.sh and inspect generated ninja file to verify that the stubs are generated from source Java files.
Bug: 310279899
Change-Id: I9d374e973788bc97514815f64eeb949a94a97647
2023-11-15 00:38:41 +00:00
Kelvin Zhang
68252b801a Move signing related options to a shared place
Move OTA signing flags to payload_signer.py so that we can re-use these
flags in multiple binaries.

Test: th
Bug: 293313353
Change-Id: I44f9910cee37c449397e174a5784f747ec9fb0d6
2023-11-14 12:41:58 -08:00
Kelvin Zhang
c68c6b9530 Allow ParseOptions to compose multiple option parsers easily
There are certain options which we need to share in multiple binaries,
for example, the signer options. Current options parsing function only
accepts 1 extra option handler, which is inflexible. Extend it to take a
list of extra option handlers.

Currently, to add a new CLI flag, caller must append the flag name to
`extra_long_opts`, then pass an extra option handler which can handle
that option. Define a new dataclass which contains both the CLI flag
name and the code to handle that flag for better composition.

Test: th
Bug: 293313353
Change-Id: I758db66dfd95934f5b2701454d97bfe7d37dc16d
2023-11-14 12:41:56 -08:00
Ted Bauer
afe55106e5 Cache Java codegen'd flags in static member variables.
By caching flag values directly in member variables instead of caching
a HashMap and accessing that, flag reads avoid `hashCode()`, map
lookup, and Boolean.parse runtime costs. Flag reads are turning out
to have performance problems in hot paths, so this should help to
alleviate that.

Bug: 309625014
Test: m
Change-Id: I923bf6af2ae3fcbbf2fee7126b492a47cd6049ad
2023-11-14 12:02:01 -05:00
Justin Yun
136fa83d4e Merge "Define BOARD_API_LEVEL and BOARD_API_LEVEL_FROZEN" into main 2023-11-13 23:40:06 +00:00
Treehugger Robot
534b47bc8e Merge "Require scl files in ExecutionModeScl" into main 2023-11-13 21:39:12 +00:00
Cole Faust
6309234411 Require scl files in ExecutionModeScl
Also remove json from scl file builtins, as it's not in bazel.

Bug: 309686282
Test: Presubmits
Change-Id: I6227c5dc14922b4682380254b4716b4ae38c47b9
2023-11-13 11:47:30 -08:00
Zi Wang
2b09495e2a Merge "Update test: true to mode: "test"" into main 2023-11-13 19:23:55 +00:00
Justin Yun
23d52435f3 Define BOARD_API_LEVEL and BOARD_API_LEVEL_FROZEN
BOARD_API_LEVEL and BOARD_API_LEVEL_FROZEN are set by the release
flags.
BOARD_API_LEVEL sets ro.board.api_level that shows the API level of
the vendor API surface.
BOARD_API_LEVEL_FROZEN sets ro.board.api_frozen that shows if the
ro.board.api_level is finalized.

Bug: 295269182
Test: getprop ro.board.api_level
Change-Id: Ie57c57b6c9f1fc0c98968195843059a48da8e512
2023-11-10 16:31:04 +09:00
Zi Wang
0ab8a96dcf Update test: true to mode: "test"
Test: CI

Bug: 309990433
Change-Id: I31644510002560fd81c41fbe37f0872fc1135390
2023-11-09 16:33:39 -08:00
Treehugger Robot
124101862b Merge "Prevent using symlinks to starlark files" into main 2023-11-10 00:00:41 +00:00
Cole Faust
ccd26808af Prevent using symlinks to starlark files
Symlinks are frequently confusing / a source of bugs. They also don't
provide much utility over just loading the other file and re-exporting
its symbols, so recommend doing that instead.

Test: Presubmits
Change-Id: Ie3052ebc0add77f1746d6321fbdf7bc15df9819b
2023-11-09 14:32:55 -08:00
Dennis Shen
05585a9fa3 Merge changes from topic "rust_caching" into main
* changes:
  aconfig: Cache flag values for rust codegen
  aconfig: Cache flag values for c/c++ codegen
2023-11-09 20:03:42 +00:00
Dennis Shen
737b8e30a1 aconfig: Cache flag values for rust codegen
Bug: b/307336730
Test: atest aconfig.test
Change-Id: I01741a4205cbe4e9b007f43b043505bcbcf05cd8
2023-11-09 15:15:54 +00:00
Abhishek Nigam
1dfca46094 Revert "Move more non-AB code to separate files"
This reverts commit 513b86e5c2.

Change-Id: I6aae60642772a052404eb1773966b2e637864bbc
2023-11-08 22:29:18 +00:00
Abhishek Nigam
b148ac22f8 Revert "Fix non-AB ota generation failure"
This reverts commit 782b752889.

bug: 308932171
tested: locally generated and applied ota on nonab device
Change-Id: I67b26be01d6240b2cb332e13bc7c7959de128755
2023-11-08 22:29:18 +00:00
Dennis Shen
96506f4349 aconfig: Cache flag values for c/c++ codegen
Bug: b/307336730
Test: atest aconfig.test
Change-Id: Id604cf154d09a48f657277af6d799f0e17bc4e93
2023-11-08 19:19:35 +00:00
Treehugger Robot
bf25b080d6 Merge "Generate incremental OTAs for 16K/4K boot option" into main 2023-11-08 00:11:41 +00:00
Cole Faust
5b8dda087d Only allow .scl files to load other .scl files
.scl files are starlark configuraiont language files, which is starlark
without any of the bazel buildin symbols.

This is to match bazel's behavior, and it doesn't make sense for
scl files to load bzl files.

We should change all the release config bzl files to scl, and then
also make it so that when using executionModeScl you can only load
scl files.

Test: go test
Change-Id: I196bcf3a4548118791ed1d47c2d37e46a1ef86c4
2023-11-07 11:27:41 -08:00
Kelvin Zhang
65c1162eb5 Generate incremental OTAs for 16K/4K boot option
Previously, the 16K/4K boot options OTAs are full OTAs, resulting in
file size of ~20MB each, and ~40M for both OTAs. To reduce the space
usage, use incremental OTAs instead.

Test: th
Bug: 302759296
Bug: 293313353
Change-Id: I61cc84c6c13f151dd6bc5ff37dd31daa5fb31abd
2023-11-06 12:37:49 -08:00
Oriol Prieto Gascó
8b1d74ec60 Merge "Revert^2 "aconfig: cache flag value in generated java code"" into main 2023-11-01 21:56:38 +00:00
Kelvin Zhang
8c9166ae37 Convert partition size to int before CheckSize
Test: th
Change-Id: Ic312e40fdad99afd65b4fc259395b8952bb038c6
2023-11-01 10:14:13 -07:00
Kelvin Zhang
9f9ac4e8a0 Fix prebuilt boot image hermetic build
Break when we find a working salt, certain devices have boot image
containing both the kernel and ramdisk, resulting in the ramdisk being
used as salt. Since core/Makefile uses kernel as salt, update python
code to match.

Bug: 293313353
Test: th
Change-Id: I68b5a8c2f0747ddf68f775bc2a6c5db46eb7eb64
2023-11-01 10:14:13 -07:00
Zhi Dou
72c2a93006 Revert^2 "aconfig: cache flag value in generated java code"
This reverts commit 257f64347d.

Reason for revert: fix in Roboletric will subimt together with this change

Change-Id: I03c9ed627e6a4153db9c9074daf821ea6d19bc33
2023-11-01 16:42:31 +00:00
Kelvin Zhang
782b752889 Fix non-AB ota generation failure
Test: ota generation on pinot target
Bug: 308615740
Change-Id: I8b540516c0ba9e3acb23eebad8569a6dbf2ef9f3
2023-10-31 19:42:39 -07:00
Dan Shi
d22a5558f4 Merge "Remove EXTRA_TEST_RUNNER_CONFIGS option in template for autogen instrumentation test" into main 2023-11-01 00:56:21 +00:00
Dan Shi
042bb8c6dc Remove EXTRA_TEST_RUNNER_CONFIGS option in template for autogen instrumentation test
Instrumentation test config created by autogen is still using python script
auto_gen_test_config.py, which doesn't support extra_runner_options yet.

Bug: 308627607
Test: m FrameworksCorePackageInstallerSessionsTests
Change-Id: Ib3bef791a9d1b3e0b68f5845dc20d2c5ec5791ec
2023-10-31 15:44:16 -07:00
Treehugger Robot
a8d60eb042 Merge "Move more non-AB code to separate files" into main 2023-10-31 17:47:23 +00:00
Kelvin Zhang
513b86e5c2 Move more non-AB code to separate files
non-AB has different lifetime and development cycles from AB. To avoid
accidentally breaking each other when making changes, put non-AB code in
its own files.

Test: local non-AB OTA generation
Bug: 296485685

Merged-In: I0736ecef343834c746464666a454a8bfcd4a20ea

Change-Id: I0736ecef343834c746464666a454a8bfcd4a20ea
2023-10-30 23:43:15 +00:00
Wei Li
52c2ea6a18 Merge "Generate SBOM of .kcm files in layoutlib." into main 2023-10-30 17:37:09 +00:00
Dave Mankoff
9d9d6556dc Merge "Let aconfig protos be read by FlagFlipper" into main 2023-10-30 15:27:33 +00:00
Zhi Dou
257f64347d Revert "aconfig: cache flag value in generated java code"
This reverts commit 3dea629a9e.

Reason for revert: b/308228560

Change-Id: I6511def2e53ab793c5fd78f65bea14eeebc5cdb2
2023-10-30 13:24:31 +00:00
Zhi Dou
3dea629a9e aconfig: cache flag value in generated java code
This change add cache in generated jave code to improve the performance.

The cache is a DeviceConfig.Properties. One Properties contains all
flag values from the given namesapce.

The Properties for a given namespace is initialized as null, and the
first call for any flags in that Properties will trigger the call to
fetch all the values. After the first call, the flag values are stored
in the Properties, so the following calls will directly get the value
from the Properties instead from the backup storage.

Test: atest aconfig.test.java
Bug: 307511846
Change-Id: Ic43626101c28099199b6faa419cf1945bd53b15d
2023-10-27 23:53:09 +00:00
Dave Mankoff
0e0c3dec70 Let aconfig protos be read by FlagFlipper
Bug: 307526764
Test: manually built
Change-Id: I689a15cc8c97a814df6f8e45bcf7f732d1693835
Merged-In: I689a15cc8c97a814df6f8e45bcf7f732d1693835
2023-10-27 18:43:50 +00:00
Kelvin Zhang
2ab6986dd9 Make non-ab code path compatible with extracted target files
Bug: 296485685
Test: ota_from_target_files -v -i non_ab.zip non_ab.zip ota.zip
Change-Id: I13ed54bfe7d14d2d1e87f45564da465a77bc2d1d
2023-10-27 11:01:27 -07:00
Wei Li
ee4ab5359d Generate SBOM of .kcm files in layoutlib.
Bug: 303905932
Test: CIs; m layoutlib dist
Change-Id: Iab35c44bdfff7ea82734a8efd37dfa005bae2664
2023-10-25 15:49:26 -07:00
Kelvin Zhang
160762a276 Use deterministic salt for AVB footer of prebuilt boot img
When target specified a prebuilt boot.img, current build system will add
avb hash footer to it with a random salt. Use a deterministic salt
instead for more reproducible builds. To stay consistent with
non-prebuilt boot.img code path, we extract the kernel image from
prebuilt boot.img and uses sha256sum of kernel image as the salt.

Test: th
Bug: 293313353
Change-Id: I988999ddc4f18e0b8677b05a3165c847b6a11b52
2023-10-25 13:28:11 -07:00
Kelvin Zhang
9d74128194 Allow -v option to change log level
Setting logging level to 'NOTSET' would tell logging module to inherit
logging level from handlers. Since the verbosity of handlers is
controlled by -v option, this allows sign_apex.py to give verbose output
if -v is specified.

Test: th
Bug: 307191956
Change-Id: I9c1db107cf4eae80ab570d892b0465b3902298fd
2023-10-24 21:58:28 -07:00
Wei Li
420d7d5878 Merge "Initial implementation of layoutlib SBOM generation." into main 2023-10-24 17:11:20 +00:00