Currently inherit-product and the rest of the product
configuration infrastructure does not handle wildcards.
However, they still get passed through unchanged, until
they reach the raw Make include statement, which expands
them. This essentially makes a meta-product that is the
result of combining all the makefiles that were matched.
In Starlark, the behavior is to actually treat each file
as it's own product. This causes a discrepency when using
`m product-graph`, where make shows one node for all those
files and Stalark has a node for each.
This is probably unintentional behavior, so change Make
to also import each file as separate products. On the
product I was investigating, the only difference this
made in the ninja file was in the product graph.
Bug: 221312856
Test: Presubmits
Change-Id: I9ca7aff0b0790aeb6e42861ce2745feed8a1a7c4
Usages of SOONG_CONFIG_art_module_source_build have been
replaced with ART_MODULE_BUILD_FROM_SOURCE now.
Bug: 220940864
Test: Presubmits
Change-Id: Ibe2115e385efe3ec02cd66ff3c5aca73ce986508
prebuilt ART module.
They were added with the intention of flipping the last fallback to use
prebuilts by default, but that has been descoped. Instead let the ART
module variable default to the generic MODULE_BUILD_FROM_SOURCE.
Test: env MODULE_BUILD_FROM_SOURCE=true \
build/soong/soong_ui.bash --dumpvars-mode \
--vars="MODULE_BUILD_FROM_SOURCE ART_MODULE_BUILD_FROM_SOURCE"
MODULE_BUILD_FROM_SOURCE='true'
ART_MODULE_BUILD_FROM_SOURCE='true'
Test: env MODULE_BUILD_FROM_SOURCE=false \
build/soong/soong_ui.bash --dumpvars-mode \
--vars="MODULE_BUILD_FROM_SOURCE ART_MODULE_BUILD_FROM_SOURCE"
MODULE_BUILD_FROM_SOURCE='false'
ART_MODULE_BUILD_FROM_SOURCE='false'
Test: env MODULE_BUILD_FROM_SOURCE=false \
ART_MODULE_BUILD_FROM_SOURCE=true \
build/soong/soong_ui.bash --dumpvars-mode \
--vars="MODULE_BUILD_FROM_SOURCE ART_MODULE_BUILD_FROM_SOURCE"
MODULE_BUILD_FROM_SOURCE='false'
ART_MODULE_BUILD_FROM_SOURCE='true'
Bug: 172480615
Bug: 184842499
Change-Id: I433e0236e595422f4d6fe2b4b2411491e3c600cf
It is needed for code coverage smoke test. Retain the
`llvm-profdata.zip` name since it is used in Tradefed.
Test: `CLANG_COVERAGE=true m dist` and inspect llvm-profdata.zip
Change-Id: Icb48b0fa22deec8c3c49f0e5bb3ae33450883e0e
In order to use Starlark-based product and board configuration for
a product, add its name to the STARLARK_OPT_IN_PRODUCTS list in
the AndroidProducts.mk file where this product is defined.
Fixes: 220379303
Test: Temporarily added STARLARK_OPT_IN_PRODUCTS to build/make/target/product/AndroidProducts.mk
Change-Id: Iacd23cec00a7a1958701873bce0fc9d5f79b1f17
The make version, find-copy-subdir-files, has very
similiar functionality: it adds `| sed "s://:/:g"`
to its results.
Fixes: 223221122
Test: Manually
Change-Id: Iaac96f760d46304aed27a7d31bb4e8bd930c2c55
Most branches, most of the time, will build modules from source. By
changing the default we make it easier to switch a whole branch to use
module prebuilts by requiring only one CL to be committed on that branch
and nowhere else.
Before this change, dozens of Soong targets needed to be updated when
deciding to start using prebuilts for modules and sdk stubs. In
addition, the typical need is to enable prebuilts on a single branch at
the time, which resulted in a dozens of "D0 N0T MERGE ANYWHERE" CLs,
causing a lot of confusion.
Bug: 184842499
Test: (on a branch with ModuleMetadataGoogle enabled as prebuilt):
m out/target/product/sunfish/product/app/ModuleMetadataGoogle/ModuleMetadataGoogle.apk
(verified with `aapt2 dump badging` that apk is built from source)
MODULE_BUILD_FROM_SOURCE=false m out/target/product/sunfish/product/app/ModuleMetadataGoogle/ModuleMetadataGoogle.apk
(verified with `aapt2 dump badging` that apk is prebuilt)
Change-Id: I625c48640c4bb1edf360605a1daac293a4a0a07a
EROFS images by default will only work on newer kernels. Old versions of
5.4 and 4.19 need an extra flag to mkfs.erofs.
Add BUILD_EROFS_USE_LEGACY_COMPRESSION to force this flag.
Bug: 222373106
Test: build with BUILD_EROFS_USE_LEGACY_COMPRESSION enabled
Change-Id: I3818e14356beaa11073c6b9fea6a6ad999bba4aa
Bug: http://b/194128476
Coverage instrumentation will support continuous mode when this flag is
set.
Test: CLANG_COVERAGE_CONTINUOUS_MODE m and verify continuous mode works.
Change-Id: I187574c600ba10145dfb2c6c23551d235c33103a
These wrapper scripts are difficult to maintain and there's not really
any value add. The argument strings don't match and every new build flag
has to be connected in an extra place.
Bug: 222715577
Test: make with EROFS enabled
Change-Id: Ie0e51cc30aa08b004d5d8345a2a2d885e193ffa9
Add PLATFORM_DISPLAY_VERSION to version_defaults.mk that will propagate
to the ro.build.version.release_or_preview_display property and
be shown as the Android version for preview releases by Settings.
Bug: 221950960
Test: manual
Change-Id: I697cc59f77f92aa98a8a2573662797e6d3bd2042
These files are difficult to support in the Starlark product
configuration. They also aren't really a good representation
of products even with Makefiles, because they only display
information from products that have been imported with
import-nodes, but generate empty files for the other products
that are included from the imported ones.
For example, lunching aosp_arm64 then running
`m out/products/build/make/target/product/core_64_bit.mk.txt`
would generate a file full of empty variable assignments.
Bug: 221312856
Test: Presubmits
Change-Id: I18613a628968acc25b57b44e229de7df1b2476ef
When product configuration is converted to Starlark, soong config variables
will be stored in a dictionary and won't be able to be specified directly
on the command line. Add a regular variable that controls the soong config
variable.
Bug: 220940864
Test: Presubmits
Change-Id: Icb6b0c33ea6826ebd8c2ce615dc643eedb9c35a3
Export the list of variants (host, host_cross, device) a build module
supports to module-info for downstream tools. The values correspond to
the Soong `host_supported`, `host_cross_supported`, and `device_supported`
attribute values.
Bug: 220263783
Test: m out/target/product/vsoc_x86_64/module-info.json
Change-Id: I10ae6ea21791d0d100686dcabecbce543a9adc3f
This is clearer and allows us to more easily
add new fields to the struct. One usecase for
more fields is the artifact path requirements.
Bug: 221312707
Test: Verified starlark product config still works for aosp_arm64
Change-Id: I4c4307e916f3b3fc8ca303b10eac3c7c73b76ac6
* Remove 'generic_ramdisk' certification, as we are not certifying
'init_boot' anymore.
* Add a new 'boot' certificate that certifies the whole boot.img.
* The new 'boot' & existing 'generic_kernel' certificates are directly
appended at the end of the boot.img, and the mkbootimg
--boot_signature argument is removed.
Bug: 211741246
Test: m bootimage
Test: ./boot_signature_info.sh boot-5.10.img
Change-Id: I143680b1cab50a6915df56c8273f8741beaf1180
Allows allowlisting modules that can temporarily continue to use a
directory as an input while some module types restrict their allowed
inputs.
Test: CI
Change-Id: Ic968a6f6efad45b6c1095dd214813e326d7493c1
The virt APEX payload public key needs to be embedded in pvmfw so that
is verifies the right set of images. As things are being resigned,
update that embedded key so that it matches the APEX.
Bug: 220018566
Test: sign_target_files_apks
Change-Id: I09be91275ec1d1aa6f921c54a96c5159571ddead
Devices using a prebuilt boot.img, e.g., a GKI, will re-sign
the boot.img to append AVB footers. Currently the value of
"com.android.build.boot.os_version" in the AVB footer is set
to the Android platform version. However, the GKI image might
be from another release branch, e.g., using a Android12-5.10
GKI in a Android 13 codebase.
Adding BOOT_OS_VERSION to allow specify the value separately.
Bug: 211364958
Test: make, then `avbtool info_image --image $OUT/boot.img`.
Change-Id: I335cc7b6c5a455d566f364df6a7dae79facc7a87
The goal of this change is to cause ro.product.first_api_level to be
set in /system/build.prop in targets with PRODUCT_FULL_TREBLE=false
(which may be the case for targets without the usual set of
hardware interfaces, such as the mini targets being added in
https://r.android.com/1966051).
Setting ro.product.first_api_level is necessary for devices with newer
kernels to boot because it controls which metadata encryption format
is used, and an old format that is incompatible with new kernels is
used by default (see commit 4073c0b5241b635cb59e9e8a75ddcc783b5a99ce in
system/vold). There also appear to be e.g. bionic tests that check this
property. So it seems reasonable to set it even if PRODUCT_FULL_TREBLE
is false.
To begin with, stop adding it to ADDITIONAL_SYSTEM_PROPERTIES. There's
basically no point in adding it there because it will be filtered
out by the property blocklist for the system partition, whether
PRODUCT_FULL_TREBLE is true or false. This lets us remove the
blocklist entry, which causes ro.product.first_api_level to
appear in /system/build.prop via ADDITIONAL_VENDOR_PROPERTIES on
PRODUCT_FULL_TREBLE=false targets.
Bug: 217455793
Change-Id: I8c07baf9d308ea734ffed5d9b1776b60cdbf3435
Virtual platforms may have no boot partition as such, so there
is no practical limit on the partition size. Therefore, make it
possible to omit the partition size (i.e. by omitting a definition of
BOARD_*BOOTIMAGE_PARTITION_SIZE), allowing unrestricted boot partition
sizes on those platforms.
The macro get-bootimage-partition-size needs to return an empty string
in the case where the variable is not defined in order for consumers
such as assert-max-image-size and get-hash-image-max-size that test
its result using $(if) to properly disable the size check in that
case. The indentation was causing the macro to return the string
" " instead, which caused an unrequested size check to be inserted.
Fix it by removing the indentation.
A separate patch to avbtool makes it possible to omit the
--partition_size argument when passing --dynamic_partition_size.
Change-Id: Ie836feeb4c3e3b86d9c7950ff45933294cea9410
Bug: 142352330
Some product config makefiles are being refactored for
the conversion to Starlark. In order to test that the
refactor doesn't cause any meaningful change, we test
that the ninja files are the same before/after the refactor.
Currently, they have differences in the order of AB_OTA_PARTIONS,
which shouldn't matter. In order to increase our confidence
and make the ninja files more stable, sort AB_OTA_PARTITIONS
before it's used.
Bug: 220169197
Test: Presubmits
Change-Id: I6a9f9f2990406d810577cf8930416925f2987311
So that it can be added to the soong config.
Bug: 220086085
Test: m nothing && inspect soong.variables
Change-Id: I949059b9284b16220e2489010279aeae98b4b7fb
This change exports the list of test_data_bins as data dependencies
that are required by modules when running the test.
Bug: 215234071
Test: m out/target/product/vsoc_x86_64/module-info.json
Change-Id: Ie5c1ef70055618a5fa0ba1bcfbcba8054743d41a
llvm-ar bundled in the next llvm update will stop accepting the legacy
single-dash argument format.
Bug: 219872355
Test: presubmit
Change-Id: Iede68e4b13c3a01c176d26f335f96879c5c72c12
The PRODUCT_COPY_FILES is populated before definitions.mk mapping
source files to installed files that get copied unchanged.
Need to be able to declare license metadata for the copied files such
that similarly named files in different projects can have different
licenses.
Need a macro to convert target names to their corresponding license
metadata.
Bug: 68860345
Bug: 151177513
Bug: 151953481
Bug: 213388645
Bug: 210912771
Test: m nothing
Change-Id: Ic244b3525e72b6cd8c4c4305bf5ad430d6e24ccb
It defines values for Build.VERSION.KNOWN_CODENAMES constant, and should
contain all codenames starting from Q, including current codename
for in development branches.
Bug: 211747008
Test: presubmit
Change-Id: If8995750e369ba39bfc7041580c21b2f96632a78
This change exports the list of dependencies that are required by
modules at runtime. Note that only the host case is currently
handled.
Bug: 215243373
Test: m out/target/product/vsoc_x86_64/module-info.json
Change-Id: I05199c54da311e59c7ea87595397ee4eecfab6a3
This definition missing will cause merge conflict which is already in
main branch.
Bug: 215243373
Test: m out/target/product/vsoc_x86_64/module-info.json
Change-Id: Ifc103268aad9d6769822ff1eae4db1cc59aee57e
Merged-In: I3b5e9bb3985c2ae83381499a44b339a7b1deb05c
Products can define PRODUCT_VIRTUAL_AB_COMPRESSION_METHOD
to specify the compression algorithm they prefer, or "none"
for no compression at all.
Test: th
Change-Id: I4fa27bd2c87b8f46c51023168d079e9b47ce2924
So that mk2rbc will just read from the file instead
of searching the source tree for makefiles.
Bug: 213508006
Test: m RBC_BOARD_CONFIG=1 nothing
Change-Id: I6b7e2aa000ad9861173c58cc06f6d49c9c11a0a7
Use the `includedescriptorclasses` modifier with the native keep rules
to ensure native method signatures remain preserved. This matches
common native Proguard rules used elsewhere.
Bug: 196084106
Test: m + presubmit
Change-Id: Ie413459ad0f65ce6b8cd6eb34318494c12568c5e
Bug: http://b/215753485
This allows enabling a new warning from the compiler update for
first-party code. This is less precise than the check in build/soong
(also overrides for vendor/google, for e.g.) because of being written in
Make.
Test: With new clang, verify the following:
lunch oriole;
m out/target/product/oriole/obj_arm/SHARED_LIBRARIES/libexynosdisplay_intermediates/libresource/ExynosMPP.o
Change-Id: I13080fec71e282c4b528a6d01b967b1c0c4aef02
Avoid the name as it is currently confusing given that we're not
actually building the image.
Bug: 216975821
Test: -
Change-Id: Ifac7047e72f590d6acb3997efa20f5f348e39491
Starlark configuration output is a makefile containing variable
assignments. Inheritance trace is also written to stdout. Trace lines
need to be comments, otherwise stdout cannot be digested by Make/Ckati.
Test: manual
Change-Id: I3c1ad6554ef4356f9ceff1ff3279b2eac962e9ac
The post-build signing step expects to find a version code in every
APK, add the version code and version name.
Bug: 216584708
Test: manual
Change-Id: Ic43730df50ef32611d5b4159b46c8bbf9906e009
Kati regenerates its ninja file if an environment variable
that was referenced by the makefiles was changed since the
last run. TRACE_BEGIN_SOONG is a constantly changing variable
that was referenced by dump-variables-rbc, which references
all all-caps variables, with a few exceptions.
Add TRACE_BEGIN_SOONG to that exception list so kati doesn't
rerun every time.
Fixes: 216531048
Test: Manually
Change-Id: I2df65b6f6aa968f132380e3410763d907d9e3e0f
Add support to copy built system_dlkm to IMAGES;
or prebuilt image to PREBUILD_IMAGES for release
tools to pick up for the dist zip.
Bug: 200082547
Test: Manual builds:
1. Set BOARD_USES_SYSTEM_DLKM_PARTITION
2. Set BOARD_PREBUILT_SYSTEM_DLKM_IMAGE to external image
- Check "m" builds the system_dlkm.img in both cases;
and drops image at out/target/product/vsoc_x86_64/
- Check that "m dist" can find the image in
$(zip_root)/IMAGES and $(zip_root)/PREBUILT_IMAGES
Test: launch_cvd && atest vts_system_dlkm_partition_test
Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
Change-Id: I77dfcc51746fd97cb205aa9c139a08f5cdf3d9ea
$(MKFSEROFS) -> $(MKEROFS) in target dependency
for INSTALLED_SYSTEM_DLKM_IMAGE_TARGET in case
when AVB is not enabled.
Bug: 200082547
Test: TH
Test: atest vts_system_dlkm_partition_test
Fixes: 1065523a5e ("Add support to build system_dlkm.img")
Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
Change-Id: I03a4463b1fa01b95e706d623aa8a3888e37488d6
There are 2 choices to build system_dlkm.img for
the system_dlkm partition for Android T launch
devices and must choose one.
1. Use kernel prebuilt system_dlkm.img
- BOARD_PREBUILT_SYSTEM_DLKM_IMAGE to point image
2. Build from kernel prebuilt system_dlkm_staging
- PRODUCT_BUILD_SYSTEM_DLKM_IMAGE
Both requires: BOARD_SYSTEM_DLKM_PARTITION_SIZE and
must be 64MB or higher in size (enforced via vts).
Bug: 200082547
Test: TH
Test: atest vts_system_dlkm_partition_test
Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
Change-Id: I83435123bd8aa3d04ab8a8b650a95fbab0bc49f2
Consolidate the Proguard rules for @Keep annotations for:
* android.support.annotation.Keep (existing)
* androidx.annotation.Keep (existing)
* com.android.internal.annotation.Keep (new)
This ensures consistent semantics for clients using these annotations
across the codebase. Ideally there would be a single annotation, but
the support libraries are not available everywhere. In practice, this
change should be a no-op.
Bug: 210510433
Test: m + validate identical artifact sizes
Change-Id: Iab494e03269e5758d7f860331e971826ecc08cdd
This was assigning the INSTALLED_INIT_BOOT_IMAGE_TARGET to bootimage
instead of initbootimage.
Test: m
Bug: 203698939
Change-Id: I5fc6e2296dac8cc35c4d46601fea6ab0ee18fd18
This reverts commit b1b4e1e38b.
Bug: http://b/194128476
Coverage metrics dropped for ~10 of the 40 modules. There are also
regressions in mainline when running tests on older platform builds.
Test: presubmit
Change-Id: Ib34f607292cd64e7cb9fe35c59a4f79b46904ab8
Keep the property for now to keep the ability to toggle on/off the
library we want. If we want to remove this functionality,
we need to cleanup all references to persist.sys.dalvik.vm.lib.2.
Test: build and boot with debug apex
Bug: 214049018
Change-Id: I66c7eb510f5a8b7974391ceafd309fba59a524a1
There are some products whose board configurations
use soong_config_get to read the values of soong config
variables that were set in the product configuration.
These variables were being lost, as dump-variables-rbc
was skipping the soong config variables because mk2rbc
couldn't handle converting the raw SOONG_CONFIG_* variables.
To fix that issue, dump-variables-rbc now dumps them as
calls to soong_config_set instead.
Bug: 201700692
Test: m RBC_BOARD_CONFIG=1 nothing on certain products
Change-Id: I91ca8418635a94cf80362cad1729f48854f6bc98
win_sdk is deprecated, if given on the command line
sdk will be build instead.
Bug: 212724080
Test: Presubmits
Change-Id: Ib3bd51923142b00100b49585ad88bc1292da2463
Right now if PRODUCT_EXPORT_BOOT_IMAGE_TO_DIST is given,
$ m dist bootimage
would copy boot*.img to the dist dir.
After this change, both
$ m dist # droidcore
$ m dist bootimage
would copy boot*.img to the dist dir, the difference is that the latter
builds & copies *only* the boot images.
Bug: 212486689
Test: m dist bootimage
Test: m dist => boot*.img are copied to dist dir
Change-Id: I1c714ce5d75eba93e32078b1ac291a181b05405a
New scheme is to certify kernel & ramdisk image separately, and
effectively decouple kernel & user space ramdisk image.
Under the new scheme, the --os_version and --os_patch_level boot header
field must be empty in order to maintain consistency.
Instead, these values must be in the vbmeta hash descriptor and
GKI certificate.
The new scheme also validates the image metadata, including the security
patch level.
The 'generic_kernel' certificate is associated with the 'boot' partition
and 'generic_ramdisk' certificate with 'init_boot' partition.
The 'generic_ramdisk' certificate may be packed into the 'boot' image if
product configuration doesn't have 'init_boot' image, this is only for
testing purposes and would be removed eventually.
Bug: 210367929
Bug: 211741246
Bug: 203698939
Test: unpack_bootimg --boot_img boot.img
Test: unpack_bootimg --boot_img init_boot.img
Test: avbtool info_image --image out/boot_signature
Change-Id: Iaf48a6e3d4b97fa6bfb5e1635a288b045baa248f
This file will be used by OTA generator to compress generated patches.
We need the host copy of LZ4 to ensure that compressed bytes matches
what the device would get if the compression were to be done on device.
For more details see go/lz4diff
Bug: 206729162
Test: m dist
Change-Id: I9c4ab772b001bf47da75cb87b028a1f27e2321a8
sign_target_files_apks demands it.
Bug: 213823227
Test: run com.google.android.tradefed.ota.SigningToolTest#Testcase1_Signingtest
Change-Id: I1bba2b25a71449a57d284024e77fb76d1b79a0ee