Commit graph

8033 commits

Author SHA1 Message Date
yangbill
585564cab2 Allow required property be conditional for release_aidl_use_unfrozen
Bug: 342336921
Test: cd build/soong/android ; go test -run TestProductVariables
Test: add product_variables.release_aidl_use_unfrozen.required to the
phony module.

Change-Id: I9b934a8fb6245b9b6fd0f2db1e67d5e2876490b2
2024-05-27 02:35:49 +00:00
Kiyoung Kim
60cec95e01 Merge "Remove VndkUseCoreVariant related code from build" into main 2024-05-27 00:59:37 +00:00
Treehugger Robot
c6b5fdbc5c Merge "Convert some properties to Configurable properties" into main 2024-05-24 20:52:27 +00:00
Devin Moore
570d72b1cf Let Release_aidl_use_unfrozen add vintf_fragments
The product_config variable can be used to add different
vintf_fragments.

Ignore-AOSP-First: this is required for vFRC finalization and needs to be submitted ASAP. This can be cherry-picked to aosp after finalization.

Test: launch_cvd && atest hal_implementation_test
Test: lunch `next` && atest vts_treble_vintf_framework_test
Bug: 279809333
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:b93c1a74cf89caef950c63d64b93f2ccfefcbce8)
Merged-In: Ied17ad4c4564a5d97f93001734fba7cc6648bbc2
Change-Id: Ied17ad4c4564a5d97f93001734fba7cc6648bbc2
2024-05-24 10:12:52 +00:00
Kiyoung Kim
22152f6cda Remove VndkUseCoreVariant related code from build
VndkUseCoreVariant feature is deprecated along with VNDK. This change
removes related code from Soong.

Bug: 330100430
Test: AOSP CF build succeeded
Change-Id: Ie182c9e4dc9cf0a4fe9d5fddf5b36754ddb53d18
2024-05-24 10:45:28 +09:00
Jihoon Kang
d02bd377da Merge "Propagate DirectlyInAnyApex to transitive dependencies" into main 2024-05-24 00:58:05 +00:00
Jihoon Kang
46d66de1c1 Propagate DirectlyInAnyApex to transitive dependencies
`UpdateDirectlyInAnyApex` is used to propagate the ApexProperties
`DirectlyInAnyApex` and `InAnyApex` to the direct dependencies of the
direct dependencies of an apex bundle. In other words, this will be
propagated only to two-levels max dependency from the apex bundle.

However, the implementation library of the sdk library can have longer
dependency chain from the apex bundle than two levels:
e.g. apex -> bcpf -> sdk_lib -> sdk_lib impl lib

Therefore, even if the implementation library of the sdk library is
registered as a dependency using the "CopyDirectlyInAnyApexTag"
dependency tag, the ApexProperties would not be propagated to the
implementation library. In order to resolve this issue and recognize
the implementation library to be directly in apex and allow
instrumentation for the implementation library, this change proposes
propagating `DirectlyInAnyApex` and `InAnyApex` to transitive
dependencies on top of direct dependencies.

Test: DIST_DIR=dist_dir TARGET_BUILD_VARIANT=userdebug PRODUCT=mainline_modules_x86_64 COVERAGE_MODULES="uwb" ./vendor/google/build/build_unbundled_coverage_mainline_module.sh && \
unzip -l out/target/product/module_x86_64/jacoco-report-classes-all.jar and ensure that framework-uwb is included
Bug: 341170242

Change-Id: I27d7a74f6e5bc3e0a044d13c619f4897b6b2eb57
2024-05-23 22:40:35 +00:00
Treehugger Robot
788100e2a8 Merge "Add test for parse error" into main 2024-05-23 19:50:12 +00:00
Treehugger Robot
bc44eb03db Merge "Allow experimental Java target 21 by default" into main 2024-05-23 16:37:21 +00:00
Sorin Basca
253f8c045a Allow experimental Java target 21 by default
Bug: 342332820
Test: EXPERIMENTAL_TARGET_JAVA_VERSION_21=true m
Change-Id: I6cc21bf191385df91c2446b7cd6291a0e3532bea
2024-05-23 10:28:24 +01:00
Cole Faust
aeecb75be2 Add test for parse error
This used to error out prior to the other cl in this topic.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I6d95eb00c75836a5a0c60e07bfd4b306388591ed
2024-05-22 17:01:59 -07:00
Cole Faust
c15b0234e9 Merge "Support soong config value variables on Configurable properties" into main 2024-05-22 23:58:50 +00:00
Cole Faust
5f29706843 Support soong config value variables on Configurable properties
Configurable properties were previously not having their %s's
substituted with the actual value.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: Id317e58a1fd878db5452d5d0a5df588021bcdcdb
2024-05-22 14:34:47 -07:00
Cole Faust
fdec8723d5 Convert some properties to Configurable properties
Focusing on the properties needed to remove soong config modules from
packages/modules/Virtualization.

- prebuilt_etc's src and srcs
- filegroup's srcs and exclude_srcs
- rust's cfgs

Bug: 342006386
Test: m nothing --no-skip-soong-tests
Change-Id: I6971da744a17955f98104948e6f9614776955782
2024-05-22 13:33:42 -07:00
Cole Faust
5e79b167b8 Merge "Add tests for unhandled select condition errors" into main 2024-05-22 18:51:10 +00:00
Cole Faust
751a4a5fa2 Export release flag types to make/soong
And use the types to appropriately type selects on the release
variables.

Bug: 323382414
Test: Presubmits
Change-Id: Ide7eca95662caaa7b4be42e20399d9fcd7fed35f
2024-05-21 18:09:05 -07:00
Cole Faust
4ab1563fe5 Merge "Update select tests for optionals" into main 2024-05-22 00:02:41 +00:00
Treehugger Robot
c7360364fc Merge "Remove printf in tests" into main 2024-05-21 22:50:22 +00:00
Cole Faust
749eeaa94c Update select tests for optionals
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I314719c9e287638acbc1ef82651d14fee6e1a55a
2024-05-21 14:19:05 -07:00
Cole Faust
bc82eaf0f6 Remove printf in tests
This causes unnecessary spam when running
m nothing --no-skip-soong-tests.

Test: m nothing --no-skip-soong-tests
Change-Id: I4d893b3da47a9f79774c67274a84ff77be9c4811
2024-05-21 11:22:29 -07:00
Cole Faust
b9519094d9 Add test for selects with variables
I thought this might need extra parsing code to handle, but it appears
to work fine.

Bug: 323382414
Test: Presubmits
Change-Id: I4e8bf44a222427c34b2709a41aa5497984154d9d
2024-05-21 11:20:15 -07:00
Yu Liu
928cb6d557 Merge "Write ninja file in parallel." into main 2024-05-21 17:22:01 +00:00
Jiyong Park
46469d6a03 Merge "Add multilib.prefer32.deps to packaging base" into main 2024-05-21 01:00:58 +00:00
Yu Liu
1b2ddc8093 Write ninja file in parallel.
Bug: 335718784
Test: CI
Change-Id: Ie36d78478a60359b704767689846e76b1c2ba76d
2024-05-20 20:28:44 +00:00
Treehugger Robot
a6ecdd39c8 Merge "Dump the required modules into module-info.json" into main 2024-05-20 17:55:15 +00:00
Treehugger Robot
8298134503 Merge changes Ifbe123d1,Ie2e738a6 into main
* changes:
  Support min_sdk_version overrides in apexes
  Support min_sdk_version overrides in apps
2024-05-20 17:38:11 +00:00
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