Commit graph

85514 commits

Author SHA1 Message Date
Mårten Kongstad
65efa27f71 Revert "Revert "aconfig: @hide generated Java code""
This reverts commit c0e8ffea41.

Reason for revert: The detected build breakage was unrelated to the aconfig change. Details in b/297881670#comment11.

Change-Id: Ia32bc2e796ed3de7fa049c2c2db340f4325a2853
2023-09-11 12:17:25 +00:00
Mårten Kongstad
c0e8ffea41 Revert "aconfig: @hide generated Java code"
This reverts commit 379e09d157.

Reason for revert: Seems to have broken the build. Reverting while investigating.

Change-Id: I37c9a065853ef07b1f1c18355205a2f49dd816c4
2023-09-11 11:00:42 +00:00
Mårten Kongstad
379e09d157 aconfig: @hide generated Java code
Flagged APIs are annotated using `@FlaggedApi(Flags.FLAG_NAME)`, where
Flags.FLAG_NAME was auto-generated by aconfig.

When metalava generates an API signature file, it can either

  a) insert the value of the constant ("com.foo.bar.flag_name"), or
  b) insert the name of the constant (FLAG.NAME)

In the case of @FlaggedApi, we want a). This requires that

  x) metlava has access to the definition of the constant while generating the API signature file, and
  y) the constant is not part of the API surface of the API signature file

x) is handled by the build system, y) is handled by the aconfig code
generation.

This CL @hide:s all generated Java code, to make sure it is accessible
within the platform, but never part of any API surface.

Bug: 297881670
Test: atest aconfig.test aconfig.test.java
Change-Id: I328ed1a652a4e5e293f2f4b11f916d29fc2fbcbd
2023-09-11 10:31:46 +02:00
Alan Stokes
7d63a84642 Merge "Add a build-time flag for DICE Changes in AVF" into main 2023-09-08 12:21:41 +00:00
Firman Prayoga
44d86b138b Merge "Revert "Clean staging dirs in build_image.py"" into main 2023-09-08 04:06:57 +00:00
Firman Prayoga
df21706765 Revert "Clean staging dirs in build_image.py"
Revert submission 2736954-proper_installclean

Reason for revert: Potential culprit for build breakage b/299545346

Reverted changes: /q/submissionid:2736954-proper_installclean

Change-Id: I2b0671bd40b7a74ef02923a777ec899401691454
2023-09-08 01:24:45 +00:00
Cole Faust
420f6978ca Merge changes I1cfdc6f4,I22c91c79 into main
* changes:
  Validate release config with a schema
  Make release_config.bzl match internal
2023-09-07 20:43:04 +00:00
Cole Faust
8a7efafe50 Validate release config with a schema
To more thouroughly check that it's valid.

Test: m nothing
Change-Id: I1cfdc6f4d20e826eb870f5e1e71d0386c589bc9a
2023-09-07 12:32:39 -07:00
Cole Faust
0c869edcd1 Make release_config.bzl match internal
To avoid merge conflicts. These are buildifier errors that will be
fixed in a followup cl.

Test: presubmits
Change-Id: I22c91c796aee16ef16f05471c2ff5221fa41d7b3
2023-09-07 12:29:21 -07:00
Treehugger Robot
05a03698b7 Merge "[zip] Set all entry times before 1980 to 1980-01-01" into main 2023-09-07 18:54:47 +00:00
Alan Stokes
95cfb629d1 Add a build-time flag for DICE Changes in AVF
Bug: 299472719
Test: Builds
Change-Id: I1c9f4085781681e0070a0b9abade5e940a8d6ed6
2023-09-07 17:42:17 +01:00
Cole Faust
c383825953 Merge "Clean staging dirs in build_image.py" into main 2023-09-07 16:41:45 +00:00
Treehugger Robot
f49b9a3371 Merge "Fix $(PROGUARD_DICT_ZIP) builds" into main 2023-09-07 02:27:36 +00:00
Cole Faust
206971459d Fix $(PROGUARD_DICT_ZIP) builds
Previously, when building the proguard dict zip, we got a lot of
warnings like these, and the files were always rebuilt:

```
[ 39% 9/23] Copy symbols with mapping: out/target/common/obj/APPS/HTMLViewer_intermediates/proguard_dictionary
ninja: Missing `restat`? An output file is older than the most recent input:
 output: out/target/common/obj/APPS/HTMLViewer_intermediates/proguard_dictionary.textproto
  input: out/soong/.intermediates/packages/apps/HTMLViewer/HTMLViewer/android_common/e10894d3da5db41239526c9048962355/proguard_dictionary
```

For some reason kati wasn't adding `restat=true` on these ninja rules.
Adding $(4) to KATI_RESTAT fixes it for some reason.

Test: m dist repeatedly doesn't give the restat warnings
Change-Id: Ie02526b3ab127f42bdc2db350d2dc468e7888fe2
2023-09-06 18:13:27 -07:00
Mark Punzalan
0d7190b413 [zip] Set all entry times before 1980 to 1980-01-01
Before this change, entry times before 1980 had the year changed to 1980
but the month/day/hour/minutes/seconds were all kept as-is.

Bug: 277978832
Test: atest zipalign_tests
Change-Id: I9f87e98a6b985002578490b87c654fee86c65d62
2023-09-06 21:44:40 +00:00
Cole Faust
48b81e7386 Clean staging dirs in build_image.py
build_image.py now accepts a --input-directory-filter-file argument
that contains a list of files to consider from the input directory.
A new, temporary input directory will be created, and only the
considered files will be copied to it.

This removes most of the need for `m installclean`, as old files or
files built manually will no longer end up on the partition.

Bug: 205632228
Test: Presubmits
Change-Id: I4c82ac7f1ed49a37271755749c8f72afeeb7f295
2023-09-06 11:51:13 -07:00
Treehugger Robot
2462269f1f Merge "Use localtime_r() on Windows too." into main 2023-09-06 18:12:22 +00:00
Zhi Dou
58fd788f51 Merge "aconfig: flag java lib enable optimization" into main 2023-09-06 12:56:46 +00:00
Zhi Dou
deafa792eb aconfig: flag java lib enable optimization
This change adds annotation in the generated code. If the flag is read
only, annotations @com.android.aconfig.annotations.AssumeTrueForR8 or
@com.android.aconfig.annotations.AssumeFalseForR8 will be added in to
the corresponding methods in the interface FeatureFlags, and class
Flags.

Test: atest aconfig aconfig.test.java
Bug: 295328116
Change-Id: Ic1b62a86f0945a5e72ae2c4987cce77fe3f172e9
2023-09-06 12:55:09 +00:00
Nikita Ioffe
9ee5ca6b37 Merge "Propagate device assignment related flags to soong" into main 2023-09-06 12:37:24 +00:00
Treehugger Robot
ed234171f8 Merge "make: HWASan exclude path support" into main 2023-09-06 01:14:12 +00:00
Cole Faust
56e8f7009c Merge "Install LOCAL_SOONG_INSTALL_SYMLINKS even if LOCAL_SOONG_INSTALLED_MODULE isn't set" into main 2023-09-06 00:15:09 +00:00
Elliott Hughes
16caa44298 Use localtime_r() on Windows too.
I don't know why I didn't clean these up when I learned about this
trick.

Test: treehugger
Change-Id: I16e7d92fd79c2dfc006612442bbb924b35a5f213
2023-09-05 21:37:01 +00:00
Cole Faust
c67e769b8c Install LOCAL_SOONG_INSTALL_SYMLINKS even if LOCAL_SOONG_INSTALLED_MODULE isn't set
LOCAL_SOONG_INSTALL_SYMLINKS can now be set by the install_symlink
module type. The install_symlink module type doesn't set
LOCAL_SOONG_INSTALLED_MODULE because make tries to copy that file
around, which doesn't work with a symlink.

Bug: 205632228
Test: built and ran the emulator observed the /system/bin/hwservicemanager symlink is still there
Change-Id: I1ec355b5ae057d0b7fe167674d70da6a4d03f6b5
2023-09-05 14:16:38 -07:00
Treehugger Robot
6c4627369e Merge changes from topic "aconfig-misc-fixes-2023-09-04" into main
* changes:
  aconfig: add invariant checks for `is_fixed_read_only`
  aconfig: re-enable development with cargo
2023-09-05 17:21:22 +00:00
Treehugger Robot
4d779cf4cd Merge "Reland: Add 16k/4k boot OTAs to /system partition" into main 2023-09-05 16:55:20 +00:00
Jared Duke
2674152fdc Merge "Ensure special Dalvik annotations are kept" into main 2023-09-05 15:49:17 +00:00
Nikita Ioffe
7902e5ed63 Propagate device assignment related flags to soong
Bug: 298007909
Test: builds
Change-Id: I0513784c813c856e9cb4674f1e33a7d83e411b02
2023-09-04 22:49:42 +01:00
Mårten Kongstad
21717e744e aconfig: add invariant checks for is_fixed_read_only
Update parsed_flag::verify_fields to verify that the invariant "if a
parsed flag is_fixed_read_only, its permission must be READ_ONLY".

Note: commands.rs will ensure that no value files are used to create an
invalid parsed flag when flag declarations and values are parsed, but
the invariant check should still be added for completeness sake, and to
make sure no invalid hand-crafted test data exists.

Also fix invalid test data found by adding this invariant.

Bug: 298935897
Test: atest aconfig.test
Change-Id: I8cea5c4d28c458525b7034d78ecb34dd09272771
2023-09-04 20:25:59 +02:00
Mårten Kongstad
5cfad6abd2 aconfig: re-enable development with cargo
The integration tests introduced in 906405f5c9 depend on libraries
auto-generated by running aconfig. This works fine for the Android build
system, but breaks `cargo t`.

Disable the tests when using `cargo t` for local development. Cargo can
be used for rapid local development, including running unit tests;
integration tests should be run using atest.

Bug: 298904077
Test: cargo t
Test: atest aconfig.test_mode.test.rust aconfig.prod_mode.test.rust
Change-Id: Ifcd374fa6efdc121cbfd4c4ac4fb43cf9cacc192
2023-09-04 13:22:28 +02:00
Kiyoung Kim
a28e56e1cc Merge "Do not set ro.(product.)vndk.version if VNDK is deprecated" into main 2023-09-04 08:09:56 +00:00
Treehugger Robot
5da26c0ab3 Merge "Add the adevice host tool to standard builds" into main 2023-09-01 23:13:14 +00:00
Jared Duke
cb3505c1be Ensure special Dalvik annotations are kept
These optimization annotations are special in that we don't want them
to have RUNTIME retention, but we do want them to be visible to ART.
R8 already has special rules to handle them, but with R8 full mode
it still requires a minimal keep rule for the given reference.

This allows usage of annotations like @NeverCompile from fully optimized
platform targets like SystemUI.

Bug: 215417388
Test: m + compare SystemUIGoogle.odex w/ @NeverCompile annotations
Change-Id: Id14bcc7b6d0d6dd385c60cfbe4d31f295cbaa5dc
2023-09-01 21:27:30 +00:00
Joe Onorato
08d6ebf118 Add the adevice host tool to standard builds
Test: treehugger
Change-Id: Ib8caceecbcc355f6aa8725a2f134f2d1ac86d387
2023-09-01 13:24:51 -07:00
Treehugger Robot
db21a2aee5 Merge "Don't read the odex zip files when building sbom-metadata.csv" into main 2023-09-01 19:29:31 +00:00
Nikita Ioffe
68e7cb9c67 Merge "Propagate RELEASE_AVF_ENABLE_MULTI_TENANT_MICRODROID_VM to soong" into main 2023-09-01 18:44:17 +00:00
Kelvin Zhang
1738012f6d Reland: Add 16k/4k boot OTAs to /system partition
This allows switching kernels without downloading anything from
internet.

Test: th
Bug: 293313353

This reverts commit 2610f34671.

Change-Id: Iec6c9f9404ac1bb3286613c33d79b00b20c4c8bb
2023-09-01 17:04:43 +00:00
Kelvin Zhang
dfa0c85705 Merge "Use seek() instead of writing 0s" into main 2023-09-01 17:00:52 +00:00
Treehugger Robot
145ca3034f Merge "Mark boot OTAs as partial OTAs" into main 2023-09-01 16:58:26 +00:00
Treehugger Robot
333d29dbb8 Merge "Add missing depdency for 16k boot image" into main 2023-09-01 14:49:32 +00:00
Nikita Ioffe
53d1acaf11 Propagate RELEASE_AVF_ENABLE_MULTI_TENANT_MICRODROID_VM to soong
Bug: 298008232
Test: builds
Change-Id: I1ec0b2cefdac862d3704968046076b59664c2b5d
2023-09-01 13:56:13 +01:00
Inseob Kim
3c7a42328c Merge "Remove code about mixed sepolicy build" into main 2023-09-01 01:06:38 +00:00
Pawan Wagh
904c8194dd Merge "Adding a system property to enable 16k dev options" into main 2023-09-01 00:26:13 +00:00
Kelvin Zhang
542a27eecf Add missing depdency for 16k boot image
Bug: 298295675
Bug: 293313353
Test: th
Change-Id: I9679c151e77398e161c04487699bc3a0d776ab13
2023-08-31 16:25:12 -07:00
Pawan Wagh
8253e12483 Adding a system property to enable 16k dev options
16K dev option should be visible on particular devices which set
PRODUCT_16K_DEVELOPER_OPTION. Adding a system property which will be
enabled based on this option.

Test: m, booted device with PRODUCT_16K_DEVELOPER_OPTION ON/OFF and
verified option visibility.
Bug: 297922563

Change-Id: I6d1cd2ce0c6f38fb43222d8e1ac2b797ef675c62
2023-08-31 20:08:31 +00:00
Treehugger Robot
bf5f9bf015 Merge "Build the proguard dict zip without PACKAGING intermediates" into main 2023-08-31 19:37:27 +00:00
Kelvin Zhang
a87ce9086f Merge "Resize boot_16k.img properly" into main 2023-08-31 19:17:34 +00:00
Kelvin Zhang
8aa6525ad7 Use seek() instead of writing 0s
test_ZipWrite_large_file need to write a 4GB file to zipfile for
testing. Instead of writing sequence of 0s to the test file, use seek().

Test: th
Bug: 298138109
Change-Id: I886bfa0c3f21664e529ba7de9688909518148f61
2023-08-31 12:17:14 -07:00
Kelvin Zhang
c4f737406a Mark boot OTAs as partial OTAs
Boot partition only OTA must be marked as "partial". This is required
for update_engine to correctly copy non-updated partitions to the target
slot.

Test: th
Bug: 293313353
Change-Id: Ic89d03f214e12fa43f686d37854d6fed1d78a6a3
2023-08-31 12:17:14 -07:00
Kelvin Zhang
bf2d400799 Resize boot_16k.img properly
Bootloaders often assume boot partition to be 64MB in size. Correctly
size boot_16k.img so that bootloader can verify the AVB footers.

Test: th
Bug: 293313353
Change-Id: I322277b10e99a41c9a262ff76e2f29c3ed16fec0
2023-08-31 12:17:14 -07:00