Certain applications, like tracking the dependency chain of modules,
knowing the "required" dependencies is required.
In this context, "required" here means the `required` field in
Android.bp files.
Bug: 339193439
Test: Inspect module-info.json for the `required` field
Change-Id: I420c781d410e715ef86823278f99e4ffe51f8022
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
The property is used to prefer the 32-bit variant of a dep over the
64-bit variant. If 64-bit variant is the only available one, it is
depended on.
This will be used to include 32-bit preferred modules like drmserver and
mediaserver in filesystem modules.
Bug: N/A
Test: go test ./... under soong/android
Change-Id: Ic7185eb2044c9987f8d1e9b6cf7f0dbd235cf04c
deps: ["foo"] + select(product_variable("debuggable") {
true: ["bar"],
default: [],
}),
returns ["foo", "bar"] on debuggable builds, and ["foo"] on user builds.
Bug: N/A
Test: go test ./...
Change-Id: I31ca22e69e3316e4007a36ae13c04c7e5c445907
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
With this change, the deps property in filesystem modules gather the
first target of the filesystem module only.
To gather dependencies across both targets, use multilib.both.deps
instead.
Bug: N/A
Test: go test ./...
Change-Id: Ie2ff0c48f08c61c8b219fc2c1540476ff8e4b1fc
After aosp/3089654, Android.mk files will be able to read
EXTRA_INSTALL_ZIPS, which we don't want. Use the new
$(KATI_visibility_prefix) to restrict its usage.
Test: m nothing passes, adding $(warning $(EXTRA_INSTALL_ZIPS)) in build/make/core/main.mk produces an error
Change-Id: Ib3c0079efd534e580a176fc69f746852b66297af
Replace the performOverrideMutator with a TransitionMutator.
This relands I358f260f1bcd894d7803036ce77ba666c0429355, which was
reverted due to a subtle behavior change when converting AliasVariation
into an IncomingTransition. AliasVariation is temporary, losing its
effect after the next call to CreateVariations that doesn't also call
AliasVariation. dexpreopt_bootjar.go was checking if a variant existed
after the apex mutator had run and obsoleted the alias created by the
perform_override mutator. When the alias was replaced by
IncomingTransition it wasn't obsoleted and dexpreopt_bootjar.go found
extra dependencies. The extra dependencies were picked up by the
core licensing code walking dependencies, and caused a significant
increase to the size of system/etc/NOTICE.xml.gz.
ag/27324277 removed flags that triggered the extra dependencies,
which prevents the system/etc/NOTICE.xml.gz increase for now.
b/340911730 tracks avoiding the unnecessary dependencies if the
flags are re-enabled.
Bug: 319288033
Flag: NONE
Test: all soong tests pass
Test: no change to build.ninja
Change-Id: I46171ba69f24482414a20d63a131941a162f025c
* changes:
Revert "Revert^2 "Always embed jni libs and store uncompressed""
Revert "Revert "Revert "Collect transitve deps of jni libs only for bund...""
Revert "Add SkipToTransitiveDepsTag interface for dependency tags"
Revert "Install transitive deps of jni libs, but not the jni libs themselves"
When a common-arch module (ex: phony) has the "required" dependencies on
native modules (ex: cc_library), both 32 and 64-bit variants of the
native modules are added as dependencies. This by itself is fine and
actually is intended, otherwise there's no way for us to install both
arch variants via required deps.
However, this imposes a problem when the common-arch module is depended
on by a filesystem module with compile_multilib: "first". Here, the
expectation is that only the first variant (64-bit) of the native module
is instaled, but in reality both variants are installed.
To handle this situation, make sure that the packaging routine filters
out packaging specs from unsupported architecture.
Bug: N/A
Test: go test ./... under soong/filesyste
Change-Id: Ie1ad5ace2e5d88e00183a115f4a76e5df87a8166
By setting aconfig_flags: true, soong filesystem module installs the
aconfig_flags.pb file to its etc directory.
We need to define aconfigFilePaths to ModuleBase to store the list of
aconfig file paths that is generated from the GenerateBuildActions().
The aconfigFilePaths are collected when build the filesystem module
to build the aconfig_flags.pb for the filesystem image.
Bug: 335363964
Test: compare the cache list with those generated from make.
Change-Id: Ia32b566bf43174e94b9e610b9503608c6b583899
Make needs to know the primary file, because the zip is only extracted
when the primary file is installed.
Bug: 337869220
Test: m out/target/product/emu64x/obj/PACKAGING/system_intermediates/file_list.txt and checking it for the extra NetworkStackGoogle apks, with a local NetworkStackGoogle android_app_set added into the tree
Change-Id: I5cb7243d214f4730e3f9efb6746793f3bf4b8214
This change fixes a bug that required deps from native module to phony
module was ignored. It happened because addRequireDeps incorrectly
thought that both are native modules with different bitness (32->64),
which isn't.
Fix this by doing the bitness check only when both the current module
and the required module are native modules.
Bug: N/A
Test: go test ./... under build/soong/filesystem
Change-Id: I494ebc47e29001f174fa44d72809041f8ceffb0b
* changes:
Install transitive deps of jni libs, but not the jni libs themselves
Add SkipToTransitiveDepsTag interface for dependency tags
Revert "Revert "Collect transitve deps of jni libs only for bund..."
Revert^2 "Always embed jni libs and store uncompressed"
Consider this dependency graph:
A --> B --> C
And let's assume that B is built into A (e.g. static_libs), while B -->
C is a runtime dependency (e.g. required).
We want to install C (but not B of course) when A gets installed.
However, before this change, it was not supported because the dependency
A -> B was not tracked in computeInstallDeps. One had to explicitly add
a A -> C dependency.
This change fixes the problem by introducing the new interface
SkipToTransitiveDepsTag. computeInstallDeps uses it to decide whether to
take all install files and packaging specs or only those from transitive
dependencies. In the above example, if the dependency A --> B implements
the new interface and returns true, B's transitive dependencies (i.e. C)
are added into A's transitive dependencies. B's outputs are not added.
Bug: N/A
Test: go test ./... under soong/android
Change-Id: I3ca03a21633883f320ecb9e5bc82eb134519cd88
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
To be more consistent with the terminology used in the rest of the
release flag infrastructure.
Bug: 323382414
Test: Presubmits
Change-Id: I176ce164c00e95ef7653608298b0051da3298aa9
Make needs to know about the "extra" zip files that are extracted
to the staging directories so that it can track all the installed files
correctly.
Also add a utility tool for listing the contents of relevant zips.
Bug: 337869220
Test: m droid and checked the contents of file_list.txt when adding an android_app_set locally
Change-Id: Idc5dd785b03c05f7972c66620d4e6359892b3863
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
Currently, all sdkKind enums are ordered from the narrower api surface to
the wider api surface, with the exception of the toolchain api surface.
This change corrects the order of the toolchain api surface so that the
enum entries are sorted in the correct order.
Test: m nothing --no-skip-soong-tests
Bug: 338660802
Change-Id: Iad4205c9ce1a83be2f7d80647366fba78e9805ca
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
* changes:
Only update DebugMutator and DebugVariation for non-empty transition variations
Update docs for ReplaceDependencies[If]
Raise test timeout when running soong tests with race detector
This allows using select statements with it.
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I6f3efaaa3d82505e38a91ee4ba0e18e404360191
Merged-In: If355d24506e3f117d27b21442a6c02bca3402dc7
Replace the performOverrideMutator with a TransitionMutator.
Bug: 319288033
Flag: NONE
Test: all soong tests pass
Test: no change to build.ninja
Change-Id: I358f260f1bcd894d7803036ce77ba666c0429355
Non-transition mutators that don't create a variant for a given module
cause no change to DebugMutator and DebugVariation. TransitionMutators
don't have a concept of skipping a module, so Mutate is called on
every module. This causes extra entries in DebugMutator and DebugVariation,
which will confuse error message around missing variations, and require
updating variant strings in some tests.
Skip updating DebugMutator and DebugVariation for empty transition
mutator variations. This isn't entirely correct, but transition mutators
don't currently have a concept of an unaffected module.
Bug: 319288033
Test: all soong tests pass
Flag: NONE
Change-Id: Ia4e659b1e90ffe4320074c9b49528d00fa302c6a
Update docs for ReplaceDependencies[If] to match changes in blueprint.
Bug: 319288033
Flag: NONE
Test: all soong tests pass
Change-Id: I7c79d3ac8dd80946760eb89b6577dc9965cb1541
So far, we have used `instalable: false` to avoid collision with the
other modules that are installed to the same path. A typical example was
<foo> and <foo>.microdroid. The latter is a modified version of the
former for the inclusion of the microdroid image. They however both have
the same instalation path (ex: system/bin) and stem (ex: foo) so that we
can reference them using the same path regardless of whether we are in
Android or microdroid.
However, the use of `installable: false` for the purpose is actually
incorrect, because `installable: false` also means, obviously, "this
module shouldn't be installed". The only reason this incorrect way has
worked is simply because packaging modules (ex: android_filesystem)
didn't respect the property when gathering the modules.
As packaging modules are now fixed to respect `installable: false`, we
need a correct way of avoiding the collision. `no_full_install: true` is
it.
If a module has this property set to true, it is never installed to the
full instal path like out/target/product/<partition>/... It can be
installed only via packaging modules.
Bug: 338160898
Test: m
Change-Id: Iee9be674951d0bf3d5e26432fcbae9afebb6007b
This fixes a bug that different PackagingSpecs having the same
installation path were silently allowed. Previously, a PackagingSpec
that comes the first for the given installation path won, effectively
eclipsing other PackagingSpecs destined for the same installation path.
Bug: 335506668
Test: go test ./...
Change-Id: Ia36f656e8364f95c4be78fff6e9dc16966307526
This can be used to select a specific prebuilt ModuleMetaData prebuilt
Test: go build ./android
Bug: 338003071
Change-Id: Ia96ba102107161021c78ad3f87a938f8a788e932
A PackagingSpec actually means either of two: an installation of a file
(i.e. putting the file on a filesystem image), or a simple gathering.
However, so far, the two different intents was not visible in
PackagingSpecs returns from TransitivePackagingSpecs().
With this change, the two different intents are recorded in
PackagingSpec. A PackagingSpec has a boolean field which records the
value of the SkipInstall() of the module where the PackagingSpec was
created from.
This could be used by a module like android_system_image which wants to
follow the "installation" semantic. For example, the module type doesn't
want to include a stub variant of a shared lib.
This change doesn't make use of the new field, yet.
Bug: 335506668
Test: go test ./...
Change-Id: If0106642a11ba804630df79b4c5ebd608a77a6b1
In order to provide a more flexible ability for gensrcs's output, due to
current output_extension property will only allow to replace the string
after the last "." of input, in order to handle input with multiple dot
in file name, provide a way to trim the suffix of input string.
Bug: 335536003
Test: cd build/soong/genrule ; go test -run TestGenSrcs
Test: cd build/soong/genrule ; go test -run TestGenSrcsWithTrimExtAndOutpuExtension
Test: cd build/soong/genrule ; go test -run TestGenSrcsWithTrimExtButNoOutpuExtension
Test: cd build/soong/genrule ; go test -run TestGenSrcsWithOutpuExtension
Test: cd build/soong/android ; go test -run TestPathsForModuleSrc
Change-Id: I033bbe1d225f207f0f6bdc140df308884f214b51
Having this in make has the following advantages
- allows this to be used in other places in make that are sensitive to
prebuilt selection, e.g. apex boot jars that are present in source but
not in prebuilt apexes
- collocates the various prebuilt special edge cases
Test: presubmits
Test: in internal, lunch cf_x86_64_phone-next-userdebug
Test: EMMA_INSTRUMENT_FRAMEWORK=true get_build_var PRODUCT_BUILD_IGNORE_APEX_CONTRIBUTION_CONTENTS
true
Bug: 308188056
Change-Id: Iea92311759f3bfe0ece7cb45fdb239c8a4db1dde
Merged-In: Iea92311759f3bfe0ece7cb45fdb239c8a4db1dde
Merged logtags files will be used for Soong built filesystem images.
Bug: 336189540
Test: m out/soong/.intermediates/all-event-log-tags.txt
Test: m out/target/common/obj/all-event-log-tags.txt
Change-Id: Ib590c2bc8073e9acee6b45ef08092768237cf9d3
So that we can have a guarantee that ConfigurableCondition is
immutable.
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I7c42d6899914bc5fa8927377d359ed6506ba7378
The Malloc_not_svelte variable name is confusing and makes the
low memory config the default. Change this so that the default is
the regular allocator, and that Malloc_low_memory is used to enable
the low memory allocator.
Test: Verified scudo config is used by default.
Test: Verfified Android GO config uses the jemalloc low memory config.
Change-Id: I02ee2bd304c8367152108caee08dd27d91838659
replace_instead_of_append is read by proptools.ExtendProperties() /
proptools.ExtendMatchingProperties(). These functions are called on
arch property structs, so we need to preserve it when creating the
arch property structs.
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: Ic08704d8a2b710f5a5d99b62d3f8a37730bb6013
List variables act similar to value variables. Each value in a list
variable will be added to a list property after string substitution.
Bug: 329208946
Test: m --no-skip-soong-tests
Test: m selinux_policy_system_soong
Change-Id: I1127bfb0798e7e5f7d665f647307224d5ff5d790
Modify the Ravenwood and Robolectric test suite packaging rules to output a zip file containing the list of test modules contained in the suite.
This is required for supporting Test Mapping with these suites. More specifically, Test Mapping infrastructure uses the test list to determine whether any of the configured TEST_MAPPING file entries reference test modules included in the suite.
Bug: 333895151
Change-Id: I4cb2ff70c799c1c3064c96e04fad11ff0694f51a
Test: m nothing --no-skip-soong-tests
Test: m ravenwood-tests robolectric-tests
Signed-off-by: Weijia He <hwj@google.com>
When looking at more details of modules that are marked test-only, I saw
that `java_test_host` modules were not in the list.
The test I wrote for it passes, but in a real run, there are two variants (one
windows, one linux) which causes it to fail. The `all_teams` code visis
all variants, even not enabled ones. The windows variant, for which
GenerateAndroidBuildActions was not being called, did not have a
provider and its empty data was overriding the variant for which we had
data.
I changed the code to prefer variants where it is true.
Generally for "test-only", the value is logically true independent of variant, so
if one variant sets it true, it should be considered true for all
variants.
I think this is a slightly better check than preferring a variant with a
provider or that is enabled.
Prev CL
% gqui from "flatten(~/aosp-main-with-phones/out/soong/ownership/all_teams.pb, teams)" proto team.proto:AllTeams 'select teams.kind, count(*) where teams.test_only = true and teams.kind not like "%cc_%" group by teams.kind'
+--------------------------+----------+
| teams.kind | count(*) |
+--------------------------+----------+
| android_test | 1382 |
| android_test_helper_app | 1680 |
| java_fuzz | 5 |
| java_test | 774 |
| java_test_helper_library | 29 |
+--------------------------+----------+
After
gqui from "flatten(~/aosp-main-with-phones/out/soong/ownership/all_teams.pb, teams)" proto ~/aosp-main-with-phones/build/soong/android/team_proto/team.proto:AllTeams ' select teams.kind, count(*) where teams.test_only = true and teams.kind not like "%cc_%" group by teams.kind'
+--------------------------+----------+
| teams.kind | count(*) |
+--------------------------+----------+
| android_test | 1382 |
| android_test_helper_app | 1680 |
| csuite_test | 16 |
| java_fuzz | 10 |
| java_test | 774 |
| java_test_helper_library | 35 |
| java_test_host | 495 |
+--------------------------+----------+
Test: go test ./android
Test: m all_teams
Test: m blueprint_tests
Change-Id: Idc5ed1c0375dc7390a0d58fcb4bf0d7fe1c7ab4f
This CL makes this property a no-op from the perspective of prebuilt
selection. The primary user of this was mainline modules, but they have
now switched to RELEASE_APEX_CONTRIBUTIONS_* for prebuilt selection,
both for internal `main` development and in partner drops.
Test: in internal, lunch cf_x86_64_phone-next-userdebug; m nothing; and
verified there was a path to the prebuilt bt apex
Test: in partner workspace, lunch gsi_partner_arm-ap31-userdebug; m
nothing; and verified that there was a path to the prebuilt adservices apex
Bug: 308188211
Change-Id: I124a6dada5c20aca4bdebf70dcbe5bbec28cefbe
Replace the apex mutator with a TransitionMutator. Requires moving the
base.apexInfo value into a provider so that it is still present for the
Mutate pass.
Test: go test ./...
Test: no change to out/soong/build-${TARGET_PRODUCT}.ninja
Change-Id: I1c898eaf30b4021f0f96f439cc0b3b3173710fc7
This change introduces a generic version of Shard*(...) utility
functions to prevent future digressions of the methods.
Test: m nothing --no-skip-soong-tests
Change-Id: I825214f0d79fb0549573ce01f298eea5eb87cf17
* changes:
Remove sort from mergeApexVariations
Support reading Providers from TransitionMutator IncomingTransition and OutgoingTransition
Set DebugMutators and DebugVariations when creating Transition variations
Fix more tests when ANDROID_BUILD_TOP is set