Commit graph

8057 commits

Author SHA1 Message Date
Hugo Drumond Jacob
44616ccdce Dump the required modules into module-info.json
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
2024-05-20 18:40:09 +02:00
Spandan Das
50801e20a3 Support min_sdk_version overrides in apexes
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
2024-05-20 16:24:52 +00:00
Jiyong Park
e604378aed Add multilib.prefer32.deps to packaging base
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
2024-05-20 16:47:44 +09:00
Treehugger Robot
bd6b1fcab4 Merge "deps in the packaging modules supports select" into main 2024-05-18 03:47:33 +00:00
Jiyong Park
105e11ca12 deps in the packaging modules supports select
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
2024-05-18 08:44:58 +09:00
Jiyong Park
93a7a6dfe4 Merge "Select supports product_variable("debuggable")" into main 2024-05-17 23:40:14 +00:00
Colin Cross
229b0098bd Merge "Reapply "Convert overrides to a TransitionMutator"" into main 2024-05-17 14:56:18 +00:00
Ivan Lozano
e8fcd37775 Merge changes from topic "rust-made-to-order-staticlibs" into main
* changes:
  rust: made-to-order rust staticlibs
  rust: refactored transformSrctoCrate
2024-05-17 12:40:36 +00:00
Jiyong Park
e325075163 Select supports product_variable("debuggable")
Bug: N/A
Test: run soong test with the next change
Change-Id: Id7a83961dc9f47191135219f0cea2c02b64a1666
2024-05-17 16:09:32 +09:00
Ivan Lozano
0a468a4f3b rust: made-to-order rust staticlibs
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
2024-05-16 13:00:43 -04:00
Jiyong Park
3ea9b65990 filesystem modules gathers first target only
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
2024-05-16 18:23:20 +09:00
Cole Faust
741f0e7115 Merge "Restrict visibility of EXTRA_INSTALL_ZIPS" into main 2024-05-16 00:36:16 +00:00
Treehugger Robot
c6541077de Merge "Filter-out deps of unsupported arch" into main 2024-05-16 00:33:24 +00:00
Cole Faust
b23bae72c3 Restrict visibility of EXTRA_INSTALL_ZIPS
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
2024-05-15 15:44:21 -07:00
Colin Cross
98cea0e0d1 Reapply "Convert overrides to a TransitionMutator"
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
2024-05-15 12:01:23 -07:00
Treehugger Robot
e8cb9178ec Merge changes I5645ddb9,Ib3d50f15,Ib4c5815a,If3b63706 into main
* 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"
2024-05-14 20:16:05 +00:00
Jiyong Park
1d4907e027 Revert "Add SkipToTransitiveDepsTag interface for dependency tags"
This reverts commit 1fb7c35129.

Change-Id: Ib4c5815a06785cd876caa37acc0522adc26bc495
2024-05-15 03:32:23 +09:00
Jiyong Park
c6a773df64 Filter-out deps of unsupported arch
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
2024-05-14 21:56:42 +09:00
Jiyong Park
635e1218bd Merge "Fix: required deps from native module to phony module is respected" into main 2024-05-14 05:04:27 +00:00
Justin Yun
74f3f30ae4 Soong filesystem may install aconfig_flags.pb
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
2024-05-13 23:14:42 +00:00
Treehugger Robot
82d7cdc547 Merge "Add the primary file to EXTRA_INSTALL_ZIPS" into main 2024-05-13 22:56:45 +00:00
Cole Faust
07c4537424 Add the primary file to EXTRA_INSTALL_ZIPS
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
2024-05-13 11:04:18 -07:00
Jiyong Park
c4b1d55707 Fix: required deps from native module to phony module is respected
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
2024-05-13 16:47:30 +09:00
Jiyong Park
b544a8b9ec Merge changes from topic "reland_embedded_jni" into main
* 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"
2024-05-10 22:53:08 +00:00
Jiyong Park
1fb7c35129 Add SkipToTransitiveDepsTag interface for dependency tags
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
2024-05-10 14:03:04 +09:00
Justin Yun
40182b6ff3 Remove duplicated CollectDependencyAconfigFiles()
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
2024-05-10 10:00:14 +09:00
Cole Faust
dd056e087e Merge "Create EXTRA_INSTALL_ZIPS variable" into main 2024-05-10 00:11:16 +00:00
Treehugger Robot
ef14cae605 Merge "Rename release_variable to release_flag in selects" into main 2024-05-09 23:27:58 +00:00
Cole Faust
b81dc0efd0 Add tests for unhandled select condition errors
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: Ic36545c2730216c514c1530ded35829966e974f0
2024-05-09 15:51:52 -07:00
Cole Faust
e19f741052 Rename release_variable to release_flag in selects
To be more consistent with the terminology used in the rest of the
release flag infrastructure.

Bug: 323382414
Test: Presubmits
Change-Id: I176ce164c00e95ef7653608298b0051da3298aa9
2024-05-09 15:14:04 -07:00
Treehugger Robot
1dbb9d91ce Merge "Add RELEASE_APEX_CONTRIBUTIONS_PRIMARY_LIBS build flag" into main 2024-05-09 22:11:58 +00:00
Colin Cross
efdbfe1ede Merge "Revert "Convert overrides to a TransitionMutator"" into main 2024-05-09 21:35:12 +00:00
Cole Faust
99bec75197 Create EXTRA_INSTALL_ZIPS variable
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
2024-05-09 14:20:11 -07:00
Colin Cross
d7b2a45d47 Revert "Convert overrides to a TransitionMutator"
This reverts commit 49be24b833.

Reason for revert: b/338643193
Bug: 319288033
Bug: 338643193

Change-Id: I7106e779e52ffc943bdcf7ee3b7c7b65fe34122e
2024-05-09 20:18:49 +00:00
Pedro Loureiro
57b1b6802f Add RELEASE_APEX_CONTRIBUTIONS_PRIMARY_LIBS build flag
Bug: 339132327

Test: m out/soong/prebuilt_info.json
Test: manually inspect that json file
Change-Id: Ib20164c82316fe02fe04a52461e344f1dfb03b90
2024-05-09 16:11:05 +00:00
Treehugger Robot
7eaf503cfd Merge "Revert^2 "Remove compilation actions from java sdk library"" into main 2024-05-08 22:28:05 +00:00
Jihoon Kang
a3a05460b4 Revert^2 "Remove compilation actions from java sdk library"
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
2024-05-08 17:46:31 +00:00
Cole Faust
3f01580c04 Merge "Make the enabled property configurable" into main 2024-05-07 17:49:10 +00:00
Jooyung Han
197b56f58b Merge ".capex is a container" into main 2024-05-07 01:36:41 +00:00
Jihoon Kang
5284ad3b33 Merge "Revert "Remove compilation actions from java sdk library"" into main 2024-05-07 00:03:05 +00:00
Jihoon Kang
8f25d296b5 Revert "Remove compilation actions from java sdk library"
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
2024-05-06 22:40:22 +00:00
Treehugger Robot
f91daab1ab Merge "Remove compilation actions from java sdk library" into main 2024-05-06 21:06:54 +00:00
Christopher Ferris
be83e748d4 Merge "Replace Malloc_not_svelte with Malloc_low_memory." into main 2024-05-06 19:45:05 +00:00
Jiyong Park
7c9ab4f5b1 Merge changes from topic "revert-3069323-revert-3066748-duplicate_entry_fs-CIBDJQYRHU-FVLDIVWUZV" into main
* changes:
  Revert^2 "Filesystem modules follow the installation semantic"
  Revert "Revert "Prevent multiple PackagingSpecs having same inst..."
2024-05-04 03:56:55 +00:00
Treehugger Robot
b92fc67f50 Merge "Correct the order of the SdkKinds" into main 2024-05-04 01:17:19 +00:00
Jihoon Kang
248cc0072c Correct the order of the SdkKinds
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
2024-05-04 00:06:59 +00:00
Jihoon Kang
d831af4267 Remove compilation actions from java sdk library
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
2024-05-03 20:51:11 +00:00
Colin Cross
5694d3f290 Merge "Convert overrides to a TransitionMutator" into main 2024-05-03 17:54:51 +00:00
Treehugger Robot
baaa1b1eeb Merge "Use no_full_install: true instead of installable: false" into main 2024-05-03 15:15:23 +00:00
Inseob Kim
364740b4a4 Merge "Merge logtags from cc modules too" into main 2024-05-03 05:10:22 +00:00
Jooyung Han
4191da7292 .capex is a container
.capex should be handled as a container when generating NOTICE.

Bug: n/a
Test: Presubmits
Change-Id: Ief4b0a8d18d52ff6510521e0a2b1f4588e259a75
2024-05-03 11:41:11 +09:00
Colin Cross
814e80038b Merge changes from topic "replace_dependencies" into main
* 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
2024-05-02 22:50:28 +00:00
Cole Faust
a963b94cde Make the enabled property configurable
This allows using select statements with it.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I6f3efaaa3d82505e38a91ee4ba0e18e404360191
Merged-In: If355d24506e3f117d27b21442a6c02bca3402dc7
2024-05-02 15:41:24 -07:00
Colin Cross
49be24b833 Convert overrides to a TransitionMutator
Replace the performOverrideMutator with a TransitionMutator.

Bug: 319288033
Flag: NONE
Test: all soong tests pass
Test: no change to build.ninja
Change-Id: I358f260f1bcd894d7803036ce77ba666c0429355
2024-05-02 15:31:58 -07:00
Colin Cross
888046f053 Only update DebugMutator and DebugVariation for non-empty transition variations
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
2024-05-02 14:39:40 -07:00
Colin Cross
86771326fe Update docs for ReplaceDependencies[If]
Update docs for ReplaceDependencies[If] to match changes in blueprint.

Bug: 319288033
Flag: NONE
Test: all soong tests pass
Change-Id: I7c79d3ac8dd80946760eb89b6577dc9965cb1541
2024-05-02 14:39:40 -07:00
Aditya Kumar
c9b4d4c584 Merge "IsEnvTrue and IsEnvFalse should take True and False as valid values respectively." into main 2024-05-02 18:14:59 +00:00
Treehugger Robot
512b52f759 Merge "Add a new property trim_extension for gensrcs" into main 2024-05-02 01:43:26 +00:00
Cole Faust
bf18d23827 Merge "Add tests for error when assigning select to nonconfigurable property" into main 2024-05-01 20:56:57 +00:00
AdityaK
1938410342 IsEnvTrue and IsEnvFalse should take True and False as valid values respectively.
Change-Id: Ibca5800c0846a45e3811db76fb5ad46b8a7eb1c1
2024-05-01 13:51:25 -07:00
Treehugger Robot
83ede7c225 Merge "Add RELEASE_APEX_CONTRIBUTIONS_MODULE_METADATA build flag" into main 2024-05-01 18:06:00 +00:00
Jiyong Park
3f627e661a Use no_full_install: true instead of installable: false
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
2024-05-01 22:43:45 +09:00
Jiyong Park
16ef7ac14e Revert "Revert "Prevent multiple PackagingSpecs having same inst..."
Revert submission 3069323-revert-3066748-duplicate_entry_fs-CIBDJQYRHU

Reason for revert: relanding with forward fix

Reverted changes: /q/submissionid:3069323-revert-3066748-duplicate_entry_fs-CIBDJQYRHU

Change-Id: Ica5a126446ca2dc07a40e4ff9866389b5d164eab
2024-05-01 12:36:10 +00:00
Adam Wright
0141b4acad Merge changes from topic "revert-3066748-duplicate_entry_fs-CIBDJQYRHU" into main
* changes:
  Revert "Prevent multiple PackagingSpecs having same installation..."
  Revert "Filesystem modules follow the installation semantic"
2024-05-01 09:59:21 +00:00
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
Treehugger Robot
543d4f3b7d Merge changes from topic "duplicate_entry_fs" into main
* changes:
  Filesystem modules follow the installation semantic
  Prevent multiple PackagingSpecs having same installation path
2024-05-01 02:43:23 +00:00
Cole Faust
60f6bb2cd1 Add tests for error when assigning select to nonconfigurable property
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I2403aa846238e5c0ea11d7a1b74d3915b3c7b739
2024-04-30 13:58:55 -07:00
Treehugger Robot
2f5d35347b Merge "Move coverage builds prebuilt special case to make" into main 2024-04-30 20:04:44 +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
Spandan Das
dab69e1001 Add RELEASE_APEX_CONTRIBUTIONS_MODULE_METADATA build flag
This can be used to select a specific prebuilt ModuleMetaData prebuilt

Test: go build ./android
Bug: 338003071
Change-Id: Ia96ba102107161021c78ad3f87a938f8a788e932
2024-04-30 18:14:49 +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
yangbill
6d032dd911 Add a new property trim_extension for gensrcs
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
2024-04-30 05:06:56 +00: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
Spandan Das
36c329ce77 Move coverage builds prebuilt special case to make
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
2024-04-29 22:04:02 +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
Inseob Kim
37e0bb0db4 Merge logtags from cc modules too
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
2024-04-29 17:40:40 +09: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
Christopher Ferris
a5a6b9c766 Replace Malloc_not_svelte with Malloc_low_memory.
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
2024-04-24 17:42:23 -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