You don't have to call module.ConfigurableEvaluator(ctx) if ctx is
already a ModuleContext, you only need to do that for more restricted
contexts like SingletonContext.
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I7612290d43dae7decfae283a341882d9016c98a3
This allows using select statements with these.
* apps
* binaries
* prebuilts
Bug: 354824866
Test: m --no-skip-soong-tests
Change-Id: I8e28937d2fa6514b41bd189f56f9f584a60d2c80
This allows using select statements with these.
* androidManifest
* canned_fs_config
* systemserverclasspath_fragments
Bug: 354824866
Test: m
Change-Id: I4c2182944ec14d99332f437c39a19ba0dc6b7731
So that users can use select statements with it.
Fixes: 347605145
Bug: 342006386
Test: m nothing --no-skip-soong-tests
Change-Id: Ica0ca6d1725b000b3748c0293e5a9f9b38ed87f9
Partner worksapces contain two versions of mainline prebuilts - BigAndroid
and Go. These two prebuilts export dexpreopt'd system server artifacts
to be installed in system image. Since the install paths are same, we
run into duplicate installation rules issue unless one of them is
hidden.
This hiding was previously done by creating a dependendency between
source aosp apex to BA and Go google prebuilts. However, this
implementaion had the unfortunate side effect on the packaging name of
the Google mainline prebuilts - the name becomes the aosp apex name.
Instead of creating the dependency to aosp apex, this CL hides all
mainline apex_set(s) if it has not been flagged using
RELEASE_APEX_CONTRIBUTIONS_*. Since there are some non mainline apex
prebuilts, apex_name will be used to determine whether the prebuilt is a
mainline module.
Test: m nothing --no-skip-soong-tests
Test: In partner workspaces, downloaded the CLs in b/355682304#comment7
Test: m out/target/product/generic/obj/PACKAGING/system_intermediates/file_list.txt
verified that aosp apexes are not installed, but mainline prebuilts are
installed
Test: unset RELEASE_APEX_CONTRIBUTIONS_ADSERVICES to build from source
Test: m out/target/product/generic/obj/PACKAGING/system_intermediates/file_list.txt
verified that aosp adservices is installed, and adservices prebuilt is
**not* installed.
Bug: 355682304
(cherry picked from https://android-review.googlesource.com/q/commit:85bd4625edc95c6e030acf4b4289724ff39e1d6e)
Merged-In: Idacb65313553bdea5c0593976694de478034229e
Change-Id: Idacb65313553bdea5c0593976694de478034229e
https://r.android.com/2901309 added support for handling installation
rules for multiple prebuilts. One of the implementation details there
was to change LOCAL_MODULE name to the source apex name in the generated
.mk files.
This causes issues in partner builds where the google singed apex
com.google.android.foo gets renamed to com.android.foo in
out/soong/Android-$PRODUCT.mk. If the partner builds does not include
the aosp apex in its PRODUCT_PACAKGES, then the google signed apex gets
elided from packaging.
This CL undoes that change. After this CL, the name of the module as it
appears in Android.bp will match the LOCAL_MODULE name emitted for
product packaging.
Test: in build/soong, go test ./apex
Bug: 355682304
(cherry picked from https://android-review.googlesource.com/q/commit:a8e2d6173d0d83ead3e481124311ab59deced404)
Merged-In: Icadbb75609174cff5326f52baf7d53e901f9f1c0
Change-Id: Icadbb75609174cff5326f52baf7d53e901f9f1c0
Soong generates AndroidMk modules and Make installs the required
dexpreopt files for APEX bundles. This dependency is not tracked by
the soong and missing from the soong filesystem.
Call PackageFile for the dexpreopt files of APEX bundles to install
the files in the soong-built system image.
Bug: 346439786
Test: lunch aosp_cf_x86_64_phone-trunk_staging-userdebug \
&& m aosp_cf_system_x86_64
Change-Id: I6af4afe5b3183c89bf687ac779007b87e1d7e948
The unit test is useful for verifying that
min_sdk_version/max_sdk_version information is populated correctly.
Followup to https://r.android.com/3128893
Bug: 345621958
Test: go test ./apex
Change-Id: Id7696a8cefaab6d0b7f38b65a33e326152ac12d3
In the context of incremental soong, the output files
inter-module-communication will be through OutputFilesProvider.
The OutputFileProducer interface will be deprecated.
These module types are included in this change:
linker_config
llndk_libraries_txt
sanitizer_libraries_txt
java_sdk_library_xml
vndksp_libraries_txt
vndkcore_libraries_txt
vndkprivate_libraries_txt
vndkpublic_libraries_txt
Test: CI
Bug: 339477385
Change-Id: I35575bbad137df5ff8001db9a61ba5b3d13eaa6d
`com.android.art` and its overrides include a `etc/boot-image.prof`
which is used on device for profile guided dexopt.
```
$ deapexer list <path_in_product_out>/com.android.art.apex | grep
boot-image
$ deapexer list <path_in_product_out>/com.google.android.art.apex | grep
boot-image
```
To identify that we should include a boot-image.prof in the override
apexes, we currently look at ApexInfo.InApexVariants in the context of
art's bootclasspath fragment module. InApexVariants are colated based on
the min_sdk_version of the top-level apex. At ToT, we have a single
variant of `art-bootlcasspath-fragment` for aosp art apex, google art
apex and google go art apex.
When google go art apex overrides the min_sdk_version, ApexInfo is
cleaved, and two distinct variants of art-bootclasspath-fragment are
created. The one corresponding to go art apex does not know we should
include boot-image.prof
To fix this, use AllApexInfoProvider instead. If any of the apexInfos
corresponds to com.android.art, include etc/boot-image.prof
Test: Added a unit test
Test: With https://b.corp.google.com/issues/345173231#comment2 reverted,
m com.google.android.go.art && deapexer list <apex> # verified that
boot-image.prof exists
Bug: 345173231
Bug: 295311875
Change-Id: I5a0e8f74725388f05343c64f268260b1eb139ae5
This changes makes bpf module type uses OutputFilesProvider,
instead of current OutputFileProducer for inter-module-
communication.
Test: CI
Bug: 339477385
Bug: 342406930
Change-Id: I85d1141e9f6583cc5427756107da99f56b0c7ea1
As VNDK definition is fully removed from Android.bp, VNDK related code
can be removed from Soong. This change removes VNDK related code except
VNDK prebuilt which is required to build former versions of VNDK APEX
with prebuilts.
Bug: 330100430
Test: AOSP CF build succeeded
Ignore-AOSP-First: Resolve Conflict
Change-Id: Id9c8993343221c8464c97296bde0ff40b14b9b0b
VNDK is fully deprecated, so KeepVndk variable will have fixed value.
This change removes KeepVndk config value, and updates any logic using
the value as VNDK is always deprecated.
Bug: 330100430
Test: Soong tests passed
Ignore-AOSP-First: Resolve merge conflict
Change-Id: I98b7590c059883e06bf3fb236d88966de64991d7
Merged-In: I98b7590c059883e06bf3fb236d88966de64991d7
Since overrides are implemented as variants of the source module, the
override module should not be replaced with prebuilts of the source
module even when the prebuilt is preferred.
Test: go test ./apex
Change-Id: I26e97f700276e7beaf6d1bd61b164f11d57a5e09
This is a followup to https://r.android.com/3073624 that moved
validation of bcp jars to the top-level prebuilt apex. It is possible
that there can be multiple prebuilt variants of a mainline module and
each prebuilt might have a skew in bcp jars. This CL limits the check to
only the selected apex prebuilt.
Test: go test ./apex
Bug: 328578801
Change-Id: If225a1af6004b6584b86ec442f99672f0d1f8314
* changes:
Revert^2 "Refactor how jni_libs dependencies are added"
Revert^2 "Add make java.dependencyTag installable or not"
Revert "Revert "APK-in-APEX should set use_embedded_native_libs:..."
Revert^2 "Install jni symlinks in Soong"
Revert submission 3094658-revert-3088867-QEHDREAABY
Reason for revert: not a regression
Reverted changes: /q/submissionid:3094658-revert-3088867-QEHDREAABY
Change-Id: Ie1e4a196f181643a3e64e573b132d52d7455461b
The use case for this are go apexes which are only installed in T and
above, even though the base AOSP apexes might be installable on < T
devices.
If provided, the overridden min_sdk_version will be
1. Used as the `min_sdk_version` in the manifest file of the
top-level override apex binary
2. Used to build the transitive closure of its dependency with that
min_sdk_version, i.e. with a different apex variant.
(2) requires some special handling. At ToT, the outgoing transition
value is the base apex name (e.g. com.android.foo). Since
min_sdk_version of the overridding apex can be different than the
overridden apex, the base apex name is no longer sufficient. Instead,
transition to the name of the overriding apex com.mycompany.android.foo.
If deduping is possible, transitive deps will get deduped to
`apex_<min_sdk_version>` later.
Test: added a unit test
Test: in internal, modified min_sdk_version of com.google.android.go.art
locally, built BA and Go apexes, and used `aapt2 dump badging` to verify
that BA has minSdkVersion of 31 and Go has minSdkVersion of 33
Bug: 295311875
Change-Id: Ifbe123d1517fccbc0c058042b8a6eeb3609b6787
* changes:
Revert "Install jni symlinks in Soong"
Revert "APK-in-APEX should set use_embedded_native_libs: true"
Revert "Add make java.dependencyTag installable or not"
Revert "Refactor how jni_libs dependencies are added"
Revert submission 3088867
Reason for revert: On cf_auto build, we are seeing a symlink of jni lib pointing to lib64/libcarservicejni.so, which does not exist on the device.
Reverted changes: /q/submissionid:3088867
Bug: b/341335305
Change-Id: I3064caef0cb55d1594951835a1173c667f58e607
* changes:
Refactor how jni_libs dependencies are added
Add make java.dependencyTag installable or not
APK-in-APEX should set use_embedded_native_libs: true
Install jni symlinks in Soong
Whenever any two Rust static libraries are included
as static libraries anywhere in a CC dependency tree, we sometimes
get duplicate symbol errors. To avoid this, we no longer
directly link multiple rust static libs to CC modules.
Instead, we build rust_ffi_rlib modules and produce the actual
static library that gets linked against the CC module based on
that CC module's full list of Rust rlib dependencies.
This introduces a new static_rlibs property for cc modules to
define the rust_ffi_rlib dependencies, which are then used to
generate the module above.
This CL is intended to deprecate rust_ffi_static. It leaves
rust_ffi_static and rust_ffi static variants in place until
the remaining rust_ffi_static declarations and uses can be
removed. In the meantime, rust_ffi_static produces
rust_ffi_rlib variants as well to make the transition easier.
Bug: 254469782
Test: m # with no changes
Test: m libapexsupport # with static_rlibs
Test: m libunwindstack # with static_rlibs
Test: m netsimd # with static_rlibs, no duplicate symbols
Test: m blueprint_tests # New Soong tests
Change-Id: I47e27ac967ef0cad46d398ebf59d8275929ae28a
So far, we automatically have embedded JNI libs for APKs in APEX, even
if use_embedded_native_libs was not set or set to false.
With this change, such APKs should explicitly set the property.
This is in preparation for an upcoming change for using different
dependency tags to JNI deps depending on whether they are embedded (thus
no install is needed), or not (thus installation to the partition is
needed).
shouldEmbedJni function now doesn't make use of the ApexInfoProvider
which is not available during deps mutator.
Bug: N/A
Test: m
Change-Id: I836171aacba19dbfa0e09f16a773ae498c56d60b
During trunk stable development, it is possible that a new boot jar is
added to the source apex, but not available in prebuilt apex yet.
Thefore we need to conditionally check the `contents` of the respective
bootclasspath_fragment modules. https://r.android.com/2822393 did this
using isActiveModule. This function relies on soong config namespaces to
"hide" the source bootclasspath_fragment module when
<module>.source_build is false.
Soong config namespaces for mainline source vs prebuilt selection is no
longer in use, so this CL replaces `isActiveModule`. The CL cleaves the
implementation
1. For source builds, the check will run in the context of the
bootclasspath_fragment module. `disableSourceApexVariant` will be
used to skip the check if prebuilts are selected.
2. For prebuilt builds, the prebuilt bootclasspath_fragment module sets
a provider, and the top-level apex will do the check.
(2) is necessary to handle the edge case of multiple versioned mainline
prebuilts and possible skew in apex boot jars across them. In case of
prebuilt builds, the unselected mainline prebuilts will have
HideFromMake called on them, so the check will only run on the apex that
is actually used during the build.
Bug: 328578801
Test: go test ./apex
Change-Id: I6eec603397eea926f3a481b79ca938245064d809
Merged-In: I6eec603397eea926f3a481b79ca938245064d809
platform-bootclasspath constructs the monotlithic hiddenapi flags by
looking at PRODUCT_BOOT_JARS which are not included in another
bootclasspath fragment. PRODUCT_BOOT_JARS is a product specific
property, and non java devices like minidroid have an empty value for
this. For such devices, the monolithic flag generation runs into an
error because there are no jars to run this on.
This CL disables the generation of monolithic specific hiddenapi flags
when there are no monolithic boot jars in the build.
Bug: 338363444
Test: lunch aosp_cf_x86_64_minidroid-trunk_staging-userdebug && mmma
frameworks/base
Change-Id: I093690786bcf85b2aa6f01d0c689fc2a35861b5c
Currently, you can't have two prebuilt_etcs in one apex with the same
file name, because apexes emit make modules for all the files in the
apex, and the module name for the prebuilt_etc's make representation
is based on the base filename of the installed file. We can change it to
be qualified based on the full relative path of the outputfile so that
you don't hit the conflicts as much.
Fixes: 340207931
Test: Presubmits
Change-Id: I7836fd4661fcaafd91901eba7e0b89506946c3e2
This reverts commit d94cccc523.
Reason for revert: Patchset 2 was wrong, doesn't actually fix the bug
Change-Id: Ie2d931ad3e2277ce1923284b13f50f62ac2f8917
Currently, you can't have two prebuilt_etcs in one apex with the same
file name, because apexes emit make modules for all the files in the
apex, and the module name for the prebuilt_etc's make representation
is based on the base filename of the installed file. We can change it to
be qualified based on the full relative path of the outputfile so that
you don't hit the conflicts as much.
Bug: 340207931
Test: Presubmits
Change-Id: I6708d89c755c31c17cce112fb08a810e51926c76
android.ModuleBase already calls aconfigUpdateAndroidBuildActions()
that is the same with CollectDependencyAconfigFiles(). Remove the
CollectDependencyAconfigFiles() to avoid duplication with
aconfigUpdateAndroidBuildActions().
To make the aconfig information available in
GenerateAndroidBuildActions() of all modules, call
aconfigUpdateAndroidBuildActions() before calling
GenerateAndroidBuildActions() of each module.
Also, we don't need SetAconfigFileMkEntries(), which is a duplicate
of aconfigUpdateAndroidMkData()
Bug: 335363964
Test: diff `adb shell printflags` before and after the change.
Change-Id: I52808e442e9fed7db1eae7b7c5ed0b1c5ba74f5d
This change modifies the build actions of java_sdk_library module type
so that it does not perform any compilation actions (i.e. does not
create the top level java_sdk_library jar file). Instead, it delegates
the build actions the top level jar file was performing to the
dynamically created ".impl"-suffixed java library module. The build
actions that are delegated to the impl library module include hiddenapi
processing, dexing, and dexpreopt.
This change relands https://r.android.com/3035972. Implementation
changes from the original change:
- "all_apex_contributions" is added as a dependecy to the implementation
library modules where the parent sdk_library module has a prebuilt
equivalent. This allows the source apex variant to be hidden from make
when the prebuilt is active.
Test: patch in internal main, lunch barbet-ap2a-userdebug && m nothing
Test: m nothing --no-skip-soong-tests
Bug: 332785297
Change-Id: I017938e5567aef82e428e7ceb557d9c9090e0257
Revert submission 3070882-sdk_lib_remove_compilation
Reason for revert: Potential culprit for build breakage of barbet-ap2a-userdebug in git_main
Reverted changes: /q/submissionid:3070882-sdk_lib_remove_compilation
Change-Id: I5135760e13e0152480c68fe91a3c88564e9bc7cb
This change modifies the build actions of java_sdk_library module type
so that it does not perform any compilation actions (i.e. does not
create the top level java_sdk_library jar file). Instead, it delegates
the build actions the top level jar file was performing to the
dynamically created ".impl"-suffixed java library module. The build
actions that are delegated to the impl library module include hiddenapi
processing, dexing, and dexpreopt.
Test: m nothing --no-skip-soong-tests
Bug: 332785297
Change-Id: I7534f9eaacf6d9f72fbf8d540b1e26af84106c20