Commit graph

81540 commits

Author SHA1 Message Date
Treehugger Robot
7bfe1377af Merge "Remove extractEncodedDexJarsFromModules" into main 2024-04-17 20:46:34 +00:00
Jihoon Kang
6d6d067c37 Remove extractEncodedDexJarsFromModules
The usages of this function have been removed with
https://r.android.com/2816477 and https://r.android.com/2816578, and
this function is currently unused.

Test: Presubmits
Change-Id: Ic1ae71ade16b930b777fa251febc4d071c0dd65e
2024-04-17 18:19:14 +00:00
Jihoon Kang
48a01ad142 Merge "Unify the behaviors of Shard*(...) utility functions" into main 2024-04-17 17:21:02 +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
LaMont Jones
76e05c8cac Merge changes If068597b,Icbadbe6d into main
* changes:
  release_config: make the code more sharable
  release_config: add namespace to proto
2024-04-16 19:02:21 +00: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
Colin Cross
7b0975d42f Fix more tests when ANDROID_BUILD_TOP is set
The bpfix code (also used by androidmk) reads the ANDROID_BUILD_TOP
environment variable, causing the tests to fail when it is set.  Clear
it in the bpfix and partner androidmk tests the same way the main
androidmk tests do.

Test: go test ./...
Change-Id: Icc61f2c3ebdbecab34c1d18399c6846db207c6dd
2024-04-16 09:32:24 -07:00
Treehugger Robot
9a8255f48e Merge changes from topic "cherrypicker-L27000030003160683:N90900030051335582" into main
* changes:
  Propagate transitive missing optional_uses_libs.
  Refactor the contruction of the manifest check inputs.
2024-04-16 13:35:54 +00: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
LaMont Jones
ac79679f77 release_config: make the code more sharable
This will allow the `build-flag` command to use release_config_lib code.

Bug: 328495189
Test: manual
Change-Id: If068597b1d68c52c941788931997b7f77c73d2b3
2024-04-15 17:41:44 -07:00
Ronald Braunstein
6a08d4915a Add test-only for test-per-src cc modules
When testing test-only validations, I noticed that some cc_test modules
where not reporting that they were test-only.

This happened because test-per-src variations were short-circuiting
writing out the provider.

The `all_teams` target is using the first variation for a module, but
it possibly should see if any variation is test-only.
For now, just making this fix to cc.

Test: m all_teams  && gqui from  "flatten(out/soong/ownership/all_teams.pb, teams)" proto build/soong/android/team_proto/team.proto:AllTeams ' where teams.kind = "cc_test" and teams.target_name="libnativebridge-tests"'
Test: go test ./cc
Change-Id: I6d44a521f5f2457527049399509d979559d7dc17
2024-04-15 23:21:23 +00:00
LaMont Jones
e6f5468ef2 release_config: add namespace to proto
flag_declaration needs to include the namespace, and origin is not
needed.

Bug: 328495189
Test: manual
Change-Id: Icbadbe6d9888323874c07d84ccd6f50c284e1a1c
2024-04-15 14:05:15 -07:00
Colin Cross
935b4db4cb Merge "rust: Remove unnecessary escaping in grep call" into main 2024-04-15 17:35:10 +00:00
Jiakai Zhang
369370818f Propagate transitive missing optional_uses_libs.
Bug: 331528424
Test: m --no-skip-soong-tests
Ignore-AOSP-First: Depends on internal changes. Will cherry-pick once merged.
Merged-In: Ied2821f11b6a5056ecf577e1e25765bc6dd212c0
Change-Id: Ied2821f11b6a5056ecf577e1e25765bc6dd212c0
2024-04-15 12:16:21 +00:00
Jiakai Zhang
f98da19a07 Refactor the contruction of the manifest check inputs.
This is a no-op change for a majority of cases.

Before this change, the contruction of the manifest check inputs is
confusing. It mutates uses_libs properties in place just for the
manifest check, by replacing module names with library names for
direct dependencies and merging library names from CLC for both direct
denpendencies and transitive denpendencies, and then constructs manifest
check inputs from those mutated uses_libs properties. This is
error-prone and leads to insistency: the goal is to check that the CLC
matches the manifest, but the inputs to the check don't reflect the CLC.

After this change, we no longer mutate uses_libs properties in place.
Instead, we maintain a separate list of missing denpendencies, and then
construct manifest check inputs directly from the CLC for all existing
libraries, no matter they are direct or transtive, and from the separate
list of missing libraries. This change makes the logic more
consistent and straightforward, and it also allows us to easily do the
next change, which is to propagate transtive missing denpendencies.

In fact, this change revealed several bugs around library optionality
and order in CLC construction, and fixed them.

Bug: 331528424
Test: m --no-skip-soong-tests
Ignore-AOSP-First: Depends on internal changes. Will cherry-pick once merged.
Merged-In: I0de82e76c47995b54aba9efd41538d950256a95f
Change-Id: I0de82e76c47995b54aba9efd41538d950256a95f
2024-04-15 11:15:41 +00:00
Hsin-Yi Chen
c0df1afc07 Merge "Pass system include dirs to header ABI checker" into main 2024-04-15 05:34:44 +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
9a7898d800 Merge "Allow override of -Wno-error=format" into main 2024-04-12 23:43:06 +00:00
Treehugger Robot
ef0cbf11a6 Merge "Remove duplicates in PathsAndMissingDepsRelativeToModuleSourceDir" into main 2024-04-12 23:39:04 +00:00
Ronald Braunstein
720146b2f2 Merge "Add "test-only" flag for java modules" into main 2024-04-12 23:13:51 +00:00
Treehugger Robot
c5c54803e6 Merge "Add support for transitive resources to android_library_import" into main 2024-04-12 22:04:27 +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
607bbd64dd Add support for transitive resources to android_library_import
Collect and propagate resource jars from static dependencies of
android_library_import modules.

Bug: 288358614
Test: TestAndroidLibraryOutputFilesRel
Change-Id: I076f3c8e4ce42f71a52b612b77eb0265fa1e974c
2024-04-12 13:45:35 -07:00
Ronald Braunstein
cdc66f4268 Add "test-only" flag for java modules
As part of aosp/3022586 where we added the idea of "test-only" modules
and top_level_test_targets, this CL implements that for java modules.

We let users set "test-only" on java_library, but not on other modules
where the module kind is implicitly test-only, like java_test.
The implementation, not the user decides it is test-only.
We also exclude it from java_defaults.

	% 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 |
	+--------------------------+----------+

	 % gqui from  "flatten(~/aosp-main-with-phones/out/soong/ownership/all_teams.pb, teams)" proto team.proto:AllTeams 'select teams.kind, count(*) where teams.top_level_target = true and teams.kind not like "%cc_%" group by teams.kind'
	+--------------+----------+
	|  teams.kind  | count(*) |
	+--------------+----------+
	| android_test |     1382 |
	| java_fuzz    |        5 |
	| java_test    |      774 |
	+--------------+----------+

Test: m nothing --no-skip-soong-tests
Test: go test ./java
Test: m all_teams

Bug: b/327280661
Change-Id: I9c3ad947dc3d68d6427abada27449526d69daa6b
2024-04-12 11:42:10 -07:00
Alex
91c74762f8
rust: Remove unnecessary escaping in grep call
Replicate cfeec1c2dd in the Clippy rule.

Bug: 333445551
Change-Id: I84134569af0f28730a483f091e6da4c78de83b9c
2024-04-12 11:04:22 +02: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
Juan Yescas
fc5cdcbdf5 Include __BIONIC_NO_PAGE_SIZE_MACRO flag to avoid breaking libraries
The __BIONIC_NO_PAGE_SIZE_MACRO flag has to be passed to
the build system because there are C/C++ libraries using
__BIONIC_NO_PAGE_SIZE_MACRO to decide whether to use getpagesize()
or PAGE_SIZE macro.

Bug: 333973679
Test: Build manually
Change-Id: Ie5d71f4b2b256ab8f429ed4724b8d249b364d5da
2024-04-12 07:06:12 +00:00
Ronald Braunstein
a115e2615b Add "test-only" flag for cc modules
As part of aosp/3022586 where we added the idea of "test-only" modules
and top_level_test_targets, this CL implements that for cc_ modules.

We let users set "test-only" on cc_library, but not on other modules
where the module kind is implicitly test-only, like cc_test.
Here the implementation, not the user decides it is test-only.

% gqui from  "flatten(~/aosp-main-with-phones/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'                    aosp_shiba[6:15:47]/0
+--------------+----------+
|  teams.kind  | count(*) |
+--------------+----------+
| art_cc_test  |       56 |
| cc_benchmark |       68 |
| cc_fuzz      |      515 |
| cc_test      |     3518 |
| cc_test_host |        6 |
+--------------+----------+

 % 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'                           aosp_shiba[6:16:26]/0
+--------------------------+----------+
|        teams.kind        | count(*) |
+--------------------------+----------+
| art_cc_test              |       56 |
| art_cc_test_library      |       13 |
| cc_benchmark             |       68 |
| cc_fuzz                  |      515 |
| cc_test                  |     3518 |
| cc_test_host             |        6 |
| cc_test_library          |      484 |
+--------------------------+----------+

Bug: b/327280661

Test: m nothing --no-skip-soong-tests
Test: go test ./cc
Test: m all_teams
Change-Id: I344436c424a9dfbdcf27e10f42f5cebc3d2b1261
2024-04-12 02:15:05 +00:00
Treehugger Robot
80214e550e Merge "Strip relative paths from java_import output files" into main 2024-04-12 01:22:10 +00:00
Colin Cross
5e87f349b8 Strip relative paths from java_import output files
androidx.annotation_annotation is used as a test data file, and
converting it from a java_library to a java_library_import causes
the relative path used in the test data path to change. Clear the
relative path in java_import the same way that other java based
modules do.

Bug: 288358614
Test: TestJavaLibraryOutputFileRel
Change-Id: I1f494110da32e916043ca94ac6ebeeafccc06f9a
2024-04-11 16:51:21 -07:00
Treehugger Robot
0565fdc3cb Merge "Make app.go not executable" into main 2024-04-11 22:26:09 +00:00
Cole Faust
7a51454f5b Make app.go not executable
Test: Presubmits
Change-Id: I983e58980cab2aa58797714c216851a1a7eb7f73
2024-04-11 14:13:20 -07:00
Treehugger Robot
1065ed8fbd Merge "java_sdk_library: Use WriteFileRule for writing permissions.xml" into main 2024-04-11 20:55:30 +00:00
Treehugger Robot
7965e1c9a8 Merge "Remove unused writeFile var" into main 2024-04-11 20:54:49 +00: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
Jihoon Kang
033ffb9533 Merge "Collect aconfig_declarations of the dependent java_aconfig_library modules" into main 2024-04-11 17:37:58 +00:00
Charlie Boutier
291a4912d1 Merge "Revert "Make embedded_launcher true by default"" into main 2024-04-11 17:21:35 +00:00
Spandan Das
d5b05655bb Merge "Revert "Add the implicit deps of javacRE"" into main 2024-04-11 16:53:12 +00:00
Charlie Boutier
578066be90 Revert "Make embedded_launcher true by default"
This reverts commit 8a038ed871.

Reason for revert: investigate breaking test suits Avatar and BumbleBluetoothTests

Change-Id: I8e4498fb5854bf62df6d161ac0c6cce49d471afe
2024-04-11 16:10:00 +00:00
Ivan Lozano
2aee601e95 Merge "rust: Fix handling of bindgen header libs" into main 2024-04-11 13:20:46 +00:00