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
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
So that we can have a guarantee that ConfigurableCondition is
immutable.
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I7c42d6899914bc5fa8927377d359ed6506ba7378
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
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