Commit Graph

8274 Commits

Author SHA1 Message Date
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
565716f531 Merge "deps in the packaging modules supports select" into main am: bd6b1fcab4 am: ad3f5045dc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3093680

Change-Id: Ibbe7b70e0ed8b3df42264d2478806ac00d41eb5e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-18 04:37:07 +00:00
Treehugger Robot
bd6b1fcab4 Merge "deps in the packaging modules supports select" into main 2024-05-18 03:47:33 +00:00
Jiyong Park
8b2c350525 Merge "Select supports product_variable("debuggable")" into main am: 93a7a6dfe4 am: 023c76dead
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3093679

Change-Id: I3c8c55343b2525b804c4f5a3b378a482bae919cb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-18 00:31:56 +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
baa703b797 Merge "Reapply "Convert overrides to a TransitionMutator"" into main am: 229b0098bd am: c8c1e89360
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3086645

Change-Id: I379c135b1ac6f0feba54d6faea7e1d222d11543e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-17 15:32:21 +00:00
Colin Cross
229b0098bd Merge "Reapply "Convert overrides to a TransitionMutator"" into main 2024-05-17 14:56:18 +00:00
Ivan Lozano
fc7f829326 Merge changes from topic "rust-made-to-order-staticlibs" into main am: e8fcd37775 am: 5345113a86
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3080891

Change-Id: I76932b282119b0c63b0457ea7ed5ff839daf253a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-17 13:28:51 +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
29065344f6 Merge "filesystem modules gathers first target only" into main am: 4332f7bf9e am: 1c7939a0c9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3091206

Change-Id: I57d4b7e02fcbd02e45cd3851edd14ad6d5e1621a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-17 07:20:07 +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
79fa9eaa30 Merge "Restrict visibility of EXTRA_INSTALL_ZIPS" into main am: 741f0e7115 am: dc707eb7fa
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3089892

Change-Id: Ic4e8d3c2f0b9261b37eac51e8950051cdd64aea2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-16 01:09:11 +00:00
Treehugger Robot
79a3ee1ba0 Merge "Filter-out deps of unsupported arch" into main am: c6541077de am: fdb18c6500
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3084949

Change-Id: Ia0fe6c4b8b8ae7a814f4f659e17e7e26cfe2d5c6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-16 01:08:32 +00: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
a98ec40e0e Merge changes I5645ddb9,Ib3d50f15,Ib4c5815a,If3b63706 into main am: e8cb9178ec am: 5312102ca0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3086468

Change-Id: Ieb2e4fa051e1886c613c7071c40175bebe221ab5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-14 20:43:26 +00: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
20a2412848 Merge "Fix: required deps from native module to phony module is respected" into main am: 635e1218bd am: 6c74838269
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3081414

Change-Id: Ib71c7668a515f514fdb38188f3c583f4b989b0e5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-14 05:25:18 +00: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
297565ac5b Soong filesystem may install aconfig_flags.pb am: 74f3f30ae4 am: b2c9f6a8f1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3046652

Change-Id: I030ba183d5ba347e8aeef8c2069daa4e61b9f6ac
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-14 01:54:49 +00:00
Treehugger Robot
b61e815c10 Merge "Add the primary file to EXTRA_INSTALL_ZIPS" into main am: 82d7cdc547 am: f17dc26a26
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3081585

Change-Id: Ib035c6e25e0c9bb0a1017dcb288035c16d3e9be6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-13 23:39:53 +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
6c37d5e046 Merge changes from topic "reland_embedded_jni" into main am: b544a8b9ec am: fdc7f1d37e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3079286

Change-Id: I14324929dddff89b80f95dab5b2dc42d0e59623a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-10 23:31:22 +00: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
Justin Yun
2448ce6385 Remove duplicated CollectDependencyAconfigFiles() am: 40182b6ff3 am: 6928bcfa4a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3074027

Change-Id: I03e902b51aa19cb89b651cc580ccebf27a705707
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-10 07:16:35 +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
844777e315 Merge "Create EXTRA_INSTALL_ZIPS variable" into main am: dd056e087e am: e194ae5c8f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3079840

Change-Id: Ib0fb452910a3e69504738c2dcb34709f9257ab62
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-10 00:51:14 +00:00
Treehugger Robot
d8bbc3865a Merge "Rename release_variable to release_flag in selects" into main am: ef14cae605 am: 7ea99bfb3c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3081788

Change-Id: If2e7efc078c3310fc416c2d208a507bdf9e29e1f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-10 00:23:51 +00: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
Treehugger Robot
6653d8c4ff Merge "Add RELEASE_APEX_CONTRIBUTIONS_PRIMARY_LIBS build flag" into main am: 1dbb9d91ce am: 9fb76d9594
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3079430

Change-Id: I172018e37aa939f9de327ebeb9fbc7f691c6b171
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-09 23:00:20 +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
38ab34d1bf Merge "Revert "Convert overrides to a TransitionMutator"" into main am: efdbfe1ede am: aebc946cb3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3079841

Change-Id: I71982e785c28496f6497efb4b8acfeafd7d56944
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-09 22:07:20 +00:00
Colin Cross
efdbfe1ede Merge "Revert "Convert overrides to a TransitionMutator"" into main 2024-05-09 21:35:12 +00:00