Commit Graph

82206 Commits

Author SHA1 Message Date
Spandan Das
c2452d90ad Merge "Disable monolithic hiddenapi flags generation for non java devices." into main am: d700486907
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3089366

Change-Id: I0ddba09be3cef955d66d7788d80d94dc242e46b0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-17 21:38:27 +00:00
Spandan Das
d700486907 Merge "Disable monolithic hiddenapi flags generation for non java devices." into main 2024-05-17 21:11:31 +00:00
Priyanka Advani
0b4f1a337a Merge "Revert "Enable -Wfortify-source"" into main am: 99d9068bfc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3093509

Change-Id: Id15663d74cbda38d318bce7d3af820bec25ff8c6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-17 20:24:45 +00:00
Priyanka Advani
99d9068bfc Merge "Revert "Enable -Wfortify-source"" into main 2024-05-17 20:07:50 +00:00
Priyanka Advani
89ed157a2f Revert "Enable -Wfortify-source"
This reverts commit 4412723f63.

Reason for revert: Droidmonitor triggered revert due to build breakage in b/341339765. 

Change-Id: Id2880f6c0e38504f1adace5e4dab3fd7f6b9b792
2024-05-17 19:42:55 +00:00
Aditya Kumar
222a727b66 Merge "Enable -Wfortify-source" into main am: 6c9f524953
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3080156

Change-Id: I3c123780d38864895de16cfa412d5170ad519929
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-17 19:21:54 +00:00
Aditya Kumar
6c9f524953 Merge "Enable -Wfortify-source" into main 2024-05-17 18:58:08 +00:00
Ivan Lozano
b86eaab1d9 Merge "rust: Add an option to disable LTO for Rust" into main am: 9b2422d890
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3087691

Change-Id: Ia8b5a6f0ccb636af735246708b7cf097ee4305bf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-17 17:59:21 +00:00
Ivan Lozano
9b2422d890 Merge "rust: Add an option to disable LTO for Rust" into main 2024-05-17 17:44:48 +00:00
Colin Cross
c8c1e89360 Merge "Reapply "Convert overrides to a TransitionMutator"" into main am: 229b0098bd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3086645

Change-Id: I9e65bb0863edf0f96457126f707fe77a0a4ac59e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-17 15:14:28 +00:00
Colin Cross
229b0098bd Merge "Reapply "Convert overrides to a TransitionMutator"" into main 2024-05-17 14:56:18 +00:00
Ivan Lozano
ab58647b2e rust: Add an option to disable LTO for Rust
This adds an option to disable LTO when building a Rust module. This is
mostly intended to speedu p local prototyping, and LTO should not
normally be disabled for production builds.

Bug: 339628497
Test: m blueprint_tests && m rust
Change-Id: I21d5d4513a259a56f101ce8906e2bef7404e4efb
2024-05-17 10:11:57 -04:00
Ivan Lozano
5345113a86 Merge changes from topic "rust-made-to-order-staticlibs" into main am: e8fcd37775
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3080891

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

Change-Id: I8dff2a1e410bf135879b5a46945453f81176d41a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-17 07:07:11 +00:00
Jiyong Park
4332f7bf9e Merge "filesystem modules gathers first target only" into main 2024-05-17 06:52:00 +00:00
Yi Kong
67ced9c270 Merge "Revert^5 "Upgrade to clang-r522817"" into main am: 728e9178bd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3092263

Change-Id: I30d1b08f49227c31cd1103b65c59790a8b521189
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-17 03:21:53 +00:00
Yi Kong
728e9178bd Merge "Revert^5 "Upgrade to clang-r522817"" into main 2024-05-17 03:06:24 +00:00
Jiyong Park
fcff59eabc Merge changes I1bc9ceb8,I9b1c7809,I836171aa,I0930cb1e into main am: 4e8ab4e103
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3088867

Change-Id: Ice027db615ec6abf4cb9889e9d23d23f59116389
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-17 02:58:04 +00:00
Jiyong Park
4e8ab4e103 Merge changes I1bc9ceb8,I9b1c7809,I836171aa,I0930cb1e into main
* changes:
  Refactor how jni_libs dependencies are added
  Add make java.dependencyTag installable or not
  APK-in-APEX should set use_embedded_native_libs: true
  Install jni symlinks in Soong
2024-05-17 02:44:31 +00:00
LaMont Jones
b44b31915a Merge "rename workflow enum for lint" into main am: 6afa342b2e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3092264

Change-Id: I00158217692c5f393d75da0ef1c63063358fff63
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-17 00:59:48 +00:00
LaMont Jones
cb6c212aa4 Merge "export list of files used by the release config" into main am: 97dd1c0f09
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3092261

Change-Id: I3227a0cf81babc31e665e152a5bd60c7cbf14e39
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-17 00:59:20 +00:00
LaMont Jones
6afa342b2e Merge "rename workflow enum for lint" into main 2024-05-17 00:49:21 +00:00
LaMont Jones
97dd1c0f09 Merge "export list of files used by the release config" into main 2024-05-17 00:40:54 +00:00
Cole Faust
bad5697e7d Merge "Add support for prebuilt_overlay module type in soong" into main am: e9478ea842
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3090487

Change-Id: I773162db886e1569a63a8fdfa71fb6024f9a76ca
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-17 00:27:55 +00:00
Cole Faust
e9478ea842 Merge "Add support for prebuilt_overlay module type in soong" into main 2024-05-17 00:21:04 +00:00
Spandan Das
52c8d9524d Merge "Align boot jar exclusion with apex_contributions" into main am: 42e1fc8d1e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3073624

Change-Id: I391b1b97153fd198ffab84cf2be3597763942bd0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-16 23:58:48 +00:00
Spandan Das
42e1fc8d1e Merge "Align boot jar exclusion with apex_contributions" into main 2024-05-16 23:57:13 +00:00
LaMont Jones
2efc8e2e82 rename workflow enum for lint
Bug: 339672075
Test: manual
Change-Id: I55f7fff9f1f367e13566fc23fb5379f6732a8e8d
2024-05-16 16:08:56 -07:00
LaMont Jones
693c703ab3 export list of files used by the release config
Also use a different name for the output.

Bug: 341117082
Bug: 328495189
Bug: 339707888
Test: manual, TH
Change-Id: Ib98d487f57cf8b55dff61a7969139a6e199fee90
2024-05-16 15:47:01 -07:00
Priyanka Advani
55d4abde48 Revert^5 "Upgrade to clang-r522817"
This reverts commit 0135499554.

Reason for revert: Droidmonitor triggered revert due to b/341148479 and b/341138217. Will be verifying through ABTD before submission.

Change-Id: I22e069178dfda0b1791bd77c908afff8cb87bf26
2024-05-16 22:00:02 +00:00
Yi Kong
55e202cc20 Merge "Revert^4 "Upgrade to clang-r522817"" into main am: aac481527e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3074031

Change-Id: I52bcfba7c9b916d8fc4486352076d90592460dab
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-16 18:21:10 +00:00
Yi Kong
aac481527e Merge "Revert^4 "Upgrade to clang-r522817"" into main 2024-05-16 18:07:51 +00:00
Aditya Kumar
4412723f63 Enable -Wfortify-source
This reverts commit 9b7e07c7aa.
Workaround for the post-submit failure in b/339523786 has been merged.

Fixes: 315245071
Change-Id: I517f13334ad169429daaa68bda7d5f600f653977
2024-05-16 17:00:53 +00: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
LaMont Jones
fe2578be27 Merge "sort release configs when creating artifacts" into main am: c77d6259cb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3089365

Change-Id: Ic511e9b0a6582c55bf16a9fe160a784955af1b48
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-16 16:24:01 +00:00
LaMont Jones
c77d6259cb Merge "sort release configs when creating artifacts" into main 2024-05-16 16:10:08 +00:00
Ivan Lozano
28ed8f4f83 rust: refactored transformSrctoCrate
Refactor transformSrctoCrate and the functions it calls to not rely
on rust.ModuleContext, preparing it to be callable from soong-cc
context to build a Rust staticlib.

This also refactors out common default flags used when building
libraries, again to prepare for building a Rust staticlib from
a soong-cc context.

Bug: 254469782
Test: m blueprint_tests && m
Change-Id: I678f6fee989c61bb15c340b9887e4d1934991907
2024-05-16 10:32:08 -04:00
Jiyong Park
cf68460114 Refactor how jni_libs dependencies are added
This CL brings three changes in how jni_libs are depended on.

1. SDK variants of the jni_libs are depended on only when they can be
   embedded. This is because SDK variants are not installable.
Previously, app could depend on SDK variants without embedding them, but
this didn't cause a problem because the installation of the jni libs was
done in Make. However, as it's done in Soong, we need to depend on a
correct variant.

2. Non-SDK variants of the jni_libs are now tagged with jniInstallTag.
   This automatically installs the libraries along with the app. The
installation of the jni libs is no longer done in app.

3. checking of the sdk version of the jni libs is done only when they
   are embedded. Doing the check even when the libs are not embedded
triggers a lot of false alarms. Note that with #1, many platform apps
have started depending on non-SDK variants.

Bug: 330276359
Test: m
Change-Id: I1bc9ceb8f79b102caeb23476c3fb03989e184a91
2024-05-16 23:31:55 +09:00
Jiyong Park
4384d294c3 Add make java.dependencyTag installable or not
java.dependencyTag now has a new field installable which contols whether
the dependency should be added as the install dep of the app or not.

This allows us to model all the dependency tags for Java using the same
struct.

Bug: N/A
Test: m
Change-Id: I9b1c7809a0bde3f15579aefd9bb34d828764b84b
2024-05-16 19:40:01 +09:00
Jiyong Park
5f0943f33f APK-in-APEX should set use_embedded_native_libs: true
So far, we automatically have embedded JNI libs for APKs in APEX, even
if use_embedded_native_libs was not set or set to false.

With this change, such APKs should explicitly set the property.

This is in preparation for an upcoming change for using different
dependency tags to JNI deps depending on whether they are embedded (thus
no install is needed), or not (thus installation to the partition is
needed).

shouldEmbedJni function now doesn't make use of the ApexInfoProvider
which is not available during deps mutator.

Bug: N/A
Test: m
Change-Id: I836171aacba19dbfa0e09f16a773ae498c56d60b
2024-05-16 19:40:00 +09:00
Jiyong Park
4f487c5b56 Install jni symlinks in Soong
The installation of the symlink
(<partition>/app/MyApp/lib/<arch>/libfoo.so) and its target
(/system/lib64/libfoo.so) are now done int Soong.

I gave up the idea of always embedding jni libs to apps, due to a
hard-to-fix regression in storage usage. Specifically, consider this
case.

app --(jni_lib)--> libfoo
    --(jni_lib)--> libbar

libfoo --(shared_lib)--> libbar

Ideally, with the embedding idea, both libfoo and libbar should be
embedded into the app and there should be no libfoo or libbar outside of
the apk, unless there's no dependency to any of them from outside of the
apk.

However, the previous implementation installed libbar to /system/lib64,
leading two copies of the lib; one in /system/lib64, the other in the
apk.

This was happening because libbar was also considered as a transitive
dep of libfoo, and therefore a dependency to its installation path is
added to the apk. The problem here is that the app doesn't know that
libfoo depends on libbar. We in theory can write a very delicate
dependency traverse routine which filters libbar out of the transitive
deps, but that looked too complicated.

Bug: 339923078
Bug: 330276359
Test: Build and watch any bloatbuster warning
Test: m aosp_cf_system_x86_64
The following three files are found
* system/lib64/libnfc_nci_jni.so
* system/etc/libnfc-nci.conf
* system/priv-app/NfcNci/lib/arm64/libnfc_nci_jni.so

Change-Id: I0930cb1ebb8ca8a6efd64b1ce2cdfd1c47fe19ef
2024-05-16 19:40:00 +09: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
Kevin
93f7cd8528 Add support for prebuilt_overlay module type in soong
In Android 11 or higher, you can use OverlayConfig
to configure the mutability, default state, and priority
of overlays.

To configure an overlay, you need to create a config.xml
in partition/overlay/config/. Since there is no module type
in soong to install prebuilt artifacts on that location
(like prebuilt_etc for example) we need to manually create
and move that file using Make duing the build process.

This commit adds support to instead create that file
using soong. Then we can instead do something along the
lines of:

prebuilt_overlay {
    name: "test-overlay",
    src: ":generate-test-overlay",
    sub_dir: "config",
    filename: "config.xml",
    product_specific: true,
}

which would create a config.xml file at the overlay/
directory of the partion in which the overlay is configured,
product/ in this example.

Test: cd build/soong/etc ; go test -run \
      TestPrebuiltOverlayInstallDirPath

Bug: 340833016

Change-Id: Iaecae7784683fb9c4306a6834b3ee705c9c20806
2024-05-16 11:00:32 +02:00
Justin Yun
b3d004bb9a Build aconfig storage files from soong filesystem am: 162098358c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3084947

Change-Id: If6fe4c9be71d42ee9c0c721af9199fd40e41bc22
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-16 05:53:08 +00:00
Justin Yun
162098358c Build aconfig storage files from soong filesystem
`gen_aconfig_flags_pb: true` additionally generates, aconfig storage
files in `etc/aconfig` directory. That includes, package.map,
flag.map and flag.val files.

Bug: 329187549
Test: m aosp_cf_system_x86_64
Change-Id: Ibbfde390cd84ca06bdd345ce0d0b4baa30a60773
2024-05-16 13:25:37 +09:00
Cole Faust
dc707eb7fa Merge "Restrict visibility of EXTRA_INSTALL_ZIPS" into main am: 741f0e7115
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3089892

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

Change-Id: I3cec354d4d0db7075820c5594ef40ede2e5c3402
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-16 00:53:22 +00:00
Cole Faust
741f0e7115 Merge "Restrict visibility of EXTRA_INSTALL_ZIPS" into main 2024-05-16 00:36:16 +00:00
Spandan Das
3d0d31a8c6 Align boot jar exclusion with apex_contributions
During trunk stable development, it is possible that a new boot jar is
added to the source apex, but not available in prebuilt apex yet.
Thefore we need to conditionally check the `contents` of the respective
bootclasspath_fragment modules. https://r.android.com/2822393 did this
using isActiveModule. This function relies on soong config namespaces to
"hide" the source bootclasspath_fragment module when
<module>.source_build is false.

Soong config namespaces for mainline source vs prebuilt selection is no
longer in use, so this CL replaces `isActiveModule`. The CL cleaves the
implementation
1. For source builds, the check will run in the context of the
   bootclasspath_fragment module. `disableSourceApexVariant` will be
used to skip the check if prebuilts are selected.
2. For prebuilt builds, the prebuilt bootclasspath_fragment module sets
   a provider, and the top-level apex will do the check.

(2) is necessary to handle the edge case of multiple versioned mainline
prebuilts and possible skew in apex boot jars across them. In case of
prebuilt builds, the unselected mainline prebuilts will have
HideFromMake called on them, so the check will only run on the apex that
is actually used during the build.

Bug: 328578801
Test: go test ./apex

Change-Id: I6eec603397eea926f3a481b79ca938245064d809
Merged-In: I6eec603397eea926f3a481b79ca938245064d809
2024-05-16 00:35:28 +00:00