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 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
Remove the sort from mergeApexVariations, and instead sort before
calling it as sorting will break the next change that calls
mergeApexVariations on a provider field that must not be modified.
Also remove the unused ctx PathContext parameter, and use
slices.SortFunc.
Bug: 319288033
Test: Test_mergeApexVariations
Change-Id: I4a044e86a8eb262b54af50afe14c678616c499d1
Add a provider method to IncomingTransitionContext and
OutgoingTransitionContext so they implement ModuleProviderContext
and can be passed to android.ModuleProvider.
Bug: 319288033
Test: go test ./...
Change-Id: Ibf8b0feb78e4062fc044c321a23adcb68373e2f8
DebugMutators and DebugVariations are set by CreateVariations, but
TransitionMutators don't call CreateVariations. Set them in
TransitionMutators.Mutate instead.
Bug: 319288033
Test: go test ./...
Change-Id: I2e1d7ac7a04f1ae669602f6c0642cfa5333ada3c
Previously, addRequiredDeps directly called RequiredModuleNames directly on
ModuleBase. As a result, it failed to correctly track the dependencies
for the modules which are overriding RequiredModuleNames. cc_* were
those.
Fixing this by calling RequiredModuleNames via the Module interface.
Bug: 321626681
Test: go test ./... under filesystem
Change-Id: I79de616606b88277da0b3e86b21316ee83e0ec71
This change prevents duplicate paths from being returned when resolving
filepath, glob and ":name{.tag}" syntax to android.Paths. Once all
existing modules are cleaned up to remove duplicates in the source
files, the duplicates removal can be converted into an error so that
passing duplicate source files in the module definition is restricted.
Test: patch to git_main, inspect ninja commands
Bug: 326674683
Change-Id: I38a4ce9238da25cd67968f6bc8058bc9facc4551
This allows us to add dependencies only for debuggable builds.
Bug: N/A
Test: add product_variables.debuggable.deps to the android_system_image
module.
Change-Id: Id90646fff8a8a91c5e768418b9881e93228ec2a5
This changes the syntax from select(variant("arch"), {...}) to
select(arch(), {...}) to make it shorter and to make it clear that
we can restrict what variants you can select on.
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: Iafe05b5f455895313a563ed6292f4016b58180b0
See the blueprint cl for more information.
Also added tests for both multivariable and typed selects.
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I00c1a3c56d34affb88f4b4d911c318b28ffe7695
The `test-only` flag designates the module contains test-only, not
production code. In order to generate code-coverage reports, we wanted
a way to filter out code (like java_library) that is test-only and
doesn't need to be in the report.
The XXX_test modules will have test-only set automatically.
For modules like `java_library`, users will be a able to set this in
the Android.bp file.
As a follow-up, I'll run some queries to find modules that are only
reachable from top level test targets and mark them test-only as
appropriate.
`test-only` is being added to the team.proto and will be written via the
`all_teams` target.
Currently, it is challenging to find "all top level test targets".
I'm adding another field to mark the target as a "top level test
target" if it is a XXX_test or XXX_test_host module. The goal is to
mark all modules the user intended to run as a test, either with
tradefed or directly as a native test.
I added 'module-type/kind' to the proto so I can do some queries:
gqui from "flatten(out/soong/ownership/all_teams.pb, teams)" proto team.proto:AllTeams 'select teams.kind, count(*) where teams.top_level_target = true group by teams.kind'
+--------------+----------+
| teams.kind | count(*) |
+--------------+----------+
| android_test | 1379 |
| art_cc_test | 56 |
| cc_benchmark | 68 |
| cc_fuzz | 515 |
| cc_test | 3519 |
| cc_test_host | 6 |
| java_fuzz | 5 |
| java_test | 773 |
+--------------+----------+
% 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 group by teams.kind'
+--------------------------+----------+
| teams.kind | count(*) |
+--------------------------+----------+
| android_test | 1379 |
| android_test_helper_app | 1678 |
| art_cc_test | 56 |
| art_cc_test_library | 13 |
| cc_benchmark | 68 |
| cc_fuzz | 515 |
| cc_test | 3519 |
| cc_test_host | 6 |
| cc_test_library | 484 |
| java_library | 2 |
| java_test | 773 |
| java_test_helper_library | 29 |
+--------------------------+----------+
All modules can be seen here: https://docs.google.com/spreadsheets/d/1Zqbh7lDDdlI1xVmrN9fZ8bm8XD7EoORjjiPqbMvAKgQ/edit#gid=396553017
FOLLOW UP cls:
*) Add more top level tests, like sh_test and python_test
*) Add validation so that only modules currently marked test-only
can depend on modules marked test-only
*) Remove test_spec, code_metadata, TestModuleProviderKey: aosp/2928500
Test: go test ./java ./cc ./android
Test: m blueprint_tests
Test: m nothing --no-skip-soong-tests
!! android already failing on selects_test
Test: m all_teams && gqui from "flatten(out/soong/ownership/all_teams.pb, teams)"
Change-Id: Ib97dca60989aa9d7f000727c92af2e354926f072
There was infrastructure to export ninja variables to bazel. Now that
the bazel migration is cancelled, we don't need it anymore.
Bug: 315353489
Test: m nothing
Change-Id: I298cc2ac7ebd004557be3b30d75f7357cab0b7a0
This commit changes the parameters to create LLNDK ABI dumps for 202404
and later versions. Soong invokes header-abi-linker with LLNDK headers
and version script rather than the implementation library's parameters.
The output dump contains more precise ABI information.
When soong compares the ABI with the prebuilt dumps in old versions,
it creates the source ABI dumps with the old parameters.
Test: make findlsdumps
Bug: 314010764
Change-Id: I228736188d07029ee1588b3502fd7c0061c104b9
This change fixes a bug that the required property doesn't track
dependencies to modules whose arch is common.
Bug: 321000103
Bug: 321626681
Test: go test ./...
Change-Id: I3d2b3ad8cb2a9f1c5c3d5345bf05402a787f011a
As of VNDK deprecation, Device VNDK version should no longer be used
from build. This change removes all references on Device VNDK version
and related logic with it.
Bug: 330100430
Test: AOSP CF build succeeded
Change-Id: Ibc290f0b41e8321f80c75c69f810223989af68dc
This relands aosp/3026027 with fixes for ndk_library. ndk_library
uses ctx.InstallFile to copy the stubs from an intermediate dir to
out/soong/ndk/sysroot/. The copy rule was created in
out/soong/installs-<product>.mk. This would cause issues when soong_ui
is run in `--soong-only` mode
To fix this, the cp rule is created entirely in soong. The stub library
is marked uninstallable to prevent creation of duplicate rules when
`--soong-only` mode is not used
Test: presubmits
Test: lunch ndk-trunk_staging-userdebug &&
ALLOW_MISSING_DEPENDENCIES=true build/soong/soong_ui.bash --soong-only
out/soong/ndk.timestamp
Change-Id: I6f8b87d88d8ca5ec9a3327e1f11e9aa654f8cdce
Part of the design of property structs is that they were easy to access.
In keeping with that spirit, use a shorter and easier to spell name
for the getter, and add GetDefault() so that you don't need to pass
the result of Get() to one of the
proptools.StringDefault/BoolDefault/etc functions.
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I0b8df151de59f2cd9463425c6666cbfda6bf47f2
Previously I was using an underscore to denote the default branch
because I was thinking that I would allow variable bindings in the
select branches, and 'default' could be mistaken for the name of a
variable. But I think it's better to just introduce alternate syntax,
like `default @ my_var: "foo" + my_var,` to do the variable bindings,
so that we can have a clearer name for the default case.
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I8cbded97a029c06782fb5313d8c0e67f22951482
ndk_headers currently use ctx.Install to install headers in
out/soong/ndk/sysroot. The files are subsequently used to compile ndk
variants of cc libraries on host.
Since these headers are not actually installed on device, use android.Cp
to assemble the NDK sysroot. By itself, it should be a no-op, but
androd.Cp is more friendly with restricting the installation rules to
PRODUCT_PACKAGES.
To make it explicit that the sysroot is not a typical installation path,
this CL also modifies the type to OutputPath
Test: m
Bug: 332778109
Change-Id: I1131c3c764443cbaac525c6022cd09c47695d275
(This relands aosp/3007754. The previous sdk build failures have been
resolved now)
The ignore list is burdensome to maintain once we start adding the
module sdk contents to apex_contributions. Convert the variable to a
boolean. When set to true, all contents in `apex_contributions` will be
ignored
Bug: 308187268
Test: m nothing on aosp,google and google_fullmte devices
Merged-In: Ibdd1e0d0d4f08f4f5251b9c4baa1aaf42e7df34f
(cherry picked from commit f3df7305d653471c70d131177e773b4723247e3a)
Change-Id: I9d57d899c6a9a321e2eb3579c954641f2cb04709
Platform VNDK version is no longer available based on VNDK deprecation.
Remove all code using Platform VNDK version.
Bug: 330100430
Test: AOSP CF build succeeded
Change-Id: I7d0f7e23eff5d153346890f242a94b78bad6736b