Commit graph

7935 commits

Author SHA1 Message Date
Jiyong Park
3d65d9cb90 Revert "Prevent multiple PackagingSpecs having same installation..."
Revert submission 3066748-duplicate_entry_fs

Reason for revert: b/338159248

Reverted changes: /q/submissionid:3066748-duplicate_entry_fs

Change-Id: I89906e160f62f1bf84eb65a1b99940f139626786
2024-05-01 05:25:41 +00:00
Jiyong Park
a51c4ce10e Prevent multiple PackagingSpecs having same installation path
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
2024-04-30 18:50:06 +00:00
Jiyong Park
4152b192e0 Distinguish the intent of PackagingSpec
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
2024-04-30 22:35:20 +09:00
Treehugger Robot
29067ccade Merge changes from topics "fix_selects_appending", "refactor_selects" into main
* changes:
  Update accesses to ConfigurableCondition
  Add test for configurable defaults applied to multiple modules
2024-04-30 01:15:42 +00:00
Ted Bauer
10fff94e2e Drive instrumentation with build flag for C/C++
Bug: 328444881
Test: m
Change-Id: I20c92c61f855adb772d6aa173e85a6d8092460d7
2024-04-29 19:53:43 +00:00
Cole Faust
8afc514ebb Update accesses to ConfigurableCondition
So that we can have a guarantee that ConfigurableCondition is
immutable.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I7c42d6899914bc5fa8927377d359ed6506ba7378
2024-04-26 16:30:19 -07:00
Cole Faust
693494682f Add test for configurable defaults applied to multiple modules
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I510472a81ae682e5a55171ec4a9aec420d577307
2024-04-26 12:37:57 -07:00
Cole Faust
703248196c Merge "Keep replace_instead_of_append in arch prop structs" into main 2024-04-24 21:36:17 +00:00
Cole Faust
5fda87b822 Keep replace_instead_of_append in arch prop structs
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
2024-04-24 11:21:14 -07:00
Weijia He
3835928537 Merge "Generate test lists for Ravenwood and Robolectric tests" into main 2024-04-23 22:54:37 +00:00
Treehugger Robot
d47220d470 Merge "Add support to Soong config list variable" into main 2024-04-23 01:14:44 +00:00
Colin Cross
a17792e2eb Merge "Remove more unused code" into main 2024-04-22 18:50:08 +00:00
Colin Cross
757e88a9df Merge "Convert apex mutator to a TransitionMutator" into main 2024-04-22 18:32:22 +00:00
Inseob Kim
02c8618e1b Add support to Soong config list variable
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
2024-04-22 14:51:07 +09:00
Weijia He
299d62dd51 Generate test lists for Ravenwood and Robolectric tests
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>
2024-04-19 23:10:35 +00:00
Spandan Das
2182c08f3e Merge "Drop use_source_config_var from prebuilt selection" into main 2024-04-19 18:44:28 +00:00
Ronald Braunstein
c864b242da Prefer variants test-only:true attribute when grouping.
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
2024-04-18 15:56:54 -07:00
Spandan Das
7e674e69ef Drop use_source_config_var from prebuilt selection
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
2024-04-18 22:35:42 +00:00
Colin Cross
7c035064db Convert apex mutator to a TransitionMutator
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
2024-04-18 15:08:43 -07:00
Treehugger Robot
e25cc5c909 Merge "Revert^2 "Use Module interface in addRequiredDeps"" into main 2024-04-17 22:37:56 +00:00
Jihoon Kang
48a01ad142 Merge "Unify the behaviors of Shard*(...) utility functions" into main 2024-04-17 17:21:02 +00:00
Jiyong Park
f21dd65c08 Revert^2 "Use Module interface in addRequiredDeps"
This reverts commit bbcdaa0c32.

Reason for revert: relanding with a forward fix

Change-Id: I14b83010a4b8d9cb9cb317f2aa07875c17f6cdaa
2024-04-17 05:22:37 +00:00
Daren Liao
5ff02b5005 Merge "Revert "Use Module interface in addRequiredDeps"" into main 2024-04-17 03:28:48 +00:00
Daren Liao
bbcdaa0c32 Revert "Use Module interface in addRequiredDeps"
This reverts commit de18a3d55a.

Reason for revert: b/335332155

Change-Id: Ib5b74b1704c1446713466e8617c42b212c960d49
2024-04-17 03:07:53 +00:00
Jihoon Kang
cd5bfe2bf1 Unify the behaviors of Shard*(...) utility functions
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
2024-04-17 00:32:48 +00:00
Treehugger Robot
4e1cf60c15 Merge "Change the syntax for arch selecting and add os selecting" into main 2024-04-16 23:50:12 +00:00
Jiyong Park
8f8b695f6f Merge "Use Module interface in addRequiredDeps" into main 2024-04-16 23:13:06 +00:00
Treehugger Robot
2b11ced7cc Merge changes I4a044e86,Ibf8b0feb,I2e1d7ac7,Icc61f2c3 into main
* 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
2024-04-16 22:25:31 +00:00
Colin Cross
9132ced405 Remove sort from mergeApexVariations
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
2024-04-16 14:09:36 -07:00
Cole Faust
1a8906d938 Merge "Update the ConfigurableEvaluator for typed selects" into main 2024-04-16 18:09:59 +00:00
Colin Cross
af333f5aed Support reading Providers from TransitionMutator IncomingTransition and OutgoingTransition
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
2024-04-16 09:32:24 -07:00
Colin Cross
d67425d763 Set DebugMutators and DebugVariations when creating Transition variations
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
2024-04-16 09:32:24 -07:00
Linus Tufvesson
ba270c503a Update soong to use flag for min supported sdk
Test: Build and flash
Test: adb shell getprop ro.build.version.min_supported_target_sdk
Bug: 297603927
Change-Id: I5123c58c8397ae44f163c2c2ee557dce9b0437c1
2024-04-16 08:08:59 +00:00
Jiyong Park
de18a3d55a Use Module interface in addRequiredDeps
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
2024-04-13 10:51:18 +09:00
Treehugger Robot
06485000db Merge "Let deps property be conditional on debuggability" into main 2024-04-13 00:43:04 +00:00
Treehugger Robot
ef0cbf11a6 Merge "Remove duplicates in PathsAndMissingDepsRelativeToModuleSourceDir" into main 2024-04-12 23:39:04 +00:00
Jihoon Kang
0e3a5352e1 Remove duplicates in PathsAndMissingDepsRelativeToModuleSourceDir
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
2024-04-12 21:57:05 +00:00
Colin Cross
76d1b42c9f Remove more unused code
Bug: 315353489
Test: builds
Change-Id: I34cf772ba3c927bbbc141afb149cf0501ca6351f
2024-04-12 13:45:35 -07:00
Jiyong Park
62532d7d62 Let deps property be conditional on debuggability
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
2024-04-12 16:16:28 +09:00
Cole Faust
fc57d40bf1 Change the syntax for arch selecting and add os selecting
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
2024-04-11 12:09:44 -07:00
Cole Faust
fdbf5d476b Update the ConfigurableEvaluator for typed selects
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
2024-04-11 11:40:02 -07:00
Paul Duffin
7f5073a94a Remove unused writeFile var
Test: TH
Change-Id: I09922d8f837f41dad01bc64192fa174d988eb39a
2024-04-10 13:21:28 +01:00
Hsin-Yi Chen
1edffe1dc4 Merge "Filter ABI dumps by LLNDK headers and version scripts" into main 2024-04-10 08:36:07 +00:00
Ronald Braunstein
c560309e30 Add test-only and test-target fields to all_teams proto.
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
2024-04-09 16:36:29 -07:00
Cole Faust
8982b1c49e Remove "exported" ninja variables
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
2024-04-09 09:42:37 -07:00
Hsin-Yi Chen
64b2d0389c Filter ABI dumps by LLNDK headers and version scripts
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
2024-04-09 18:45:03 +08:00
Treehugger Robot
ccd5b5545b Merge "fix: required property doesn't track deps to java, apex, ..." into main 2024-04-09 03:12:39 +00:00
Cole Faust
42a8b256af Merge changes from topics "replace_instead_of_append", "selects_get_and_get_default" into main
* changes:
  Rename Evaluate() to Get() and add GetDefault()
  Add tests for android:replace_instead_of_append
2024-04-08 20:45:55 +00:00
Treehugger Robot
ed2adb879f Merge "Remove Device VNDK version usage from Soong" into main 2024-04-08 19:24:36 +00:00
Jiyong Park
73e5babafe fix: required property doesn't track deps to java, apex, ...
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
2024-04-05 15:12:16 +09:00