Commit Graph

8189 Commits

Author SHA1 Message Date
Cole Faust
b2ed4b3793 Merge "Update select tests for optionals" into main am: 4ab1563fe5 am: fd4249510d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3094707

Change-Id: Ie3fe41647e20b5b14b439e28eee84390b0660ca2
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-22 00:37:24 +00:00
Cole Faust
4ab1563fe5 Merge "Update select tests for optionals" into main 2024-05-22 00:02:41 +00:00
Treehugger Robot
5ea7ecb836 Merge "Remove printf in tests" into main am: c7360364fc am: 382afbaf9b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3096237

Change-Id: Ic42d4c86886f5d27158c3e5fa9f5a767028b162d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-21 23:34:48 +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
2084345022 Add test for selects with variables am: b9519094d9 am: 167c9be663
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3096217

Change-Id: I4001708a538edf54240bbdffaec8e0c64298706c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-21 19:29:54 +00: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
638c28a1a9 Merge "Write ninja file in parallel." into main am: 928cb6d557 am: 2ac88c1e43
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3089625

Change-Id: I0cb321c670c445a87f3cfe868cff3a6ad6f1fa07
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-21 17:53:04 +00:00
Yu Liu
928cb6d557 Merge "Write ninja file in parallel." into main 2024-05-21 17:22:01 +00:00
Jiyong Park
48f2f580ed Merge "Add multilib.prefer32.deps to packaging base" into main am: 46469d6a03 am: 7bf969053d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3093784

Change-Id: Ie041657ae6a35f15ff07e02def31d2cb3b001b5c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-21 01:55:03 +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
75ba7e9d2e Merge "Dump the required modules into module-info.json" into main am: a6ecdd39c8 am: 7bef057a69
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3094443

Change-Id: I7b006fbedb2ffeade29213e9a6e780b0fbb8bf71
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-20 18:17:51 +00:00
Treehugger Robot
f325babc6d Merge changes Ifbe123d1,Ie2e738a6 into main am: 8298134503 am: 665ece7963
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3083813

Change-Id: I849464d86f7b07e661bc4106e3dc2e77eebdeddd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-20 18:17:39 +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
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