Commit Graph

83123 Commits

Author SHA1 Message Date
Jiyong Park
8f90ba8a7c Merge changes I1bc9ceb8,I9b1c7809,I836171aa,I0930cb1e into main am: 4e8ab4e103 am: fcff59eabc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3088867

Change-Id: Ic2df73c22fe5462d17aed4db796df9e3a1f8af53
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-17 03:11:50 +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
4c3fc4b8ca Merge "rename workflow enum for lint" into main am: 6afa342b2e am: b44b31915a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3092264

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

Change-Id: If21fcb677b1f02381aa2ce6f52e390ef85eddff5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-17 01:16:25 +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
88a082bfb9 Merge "Add support for prebuilt_overlay module type in soong" into main am: e9478ea842 am: bad5697e7d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3090487

Change-Id: Iec02b1073a68c8fe14189ae971754699fbe40b54
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-17 00:28:26 +00:00
Spandan Das
c5552cd351 [automerger skipped] Merge "Align boot jar exclusion with apex_contributions" into main am: 42e1fc8d1e am: 52c8d9524d -s ours
am skip reason: Merged-In I6eec603397eea926f3a481b79ca938245064d809 with SHA-1 13af441368 is already in history

Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3073624

Change-Id: I5835cb362100aa9b3ddbbc686629b98fd6de5538
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-17 00:28:10 +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
Yi Kong
8f3a9ce4ab Merge "Revert^4 "Upgrade to clang-r522817"" into main am: aac481527e am: 55e202cc20
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3074031

Change-Id: Icc631ced630196adff5c78e0ad46a93f9bb26009
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-16 18:52:44 +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
LaMont Jones
1f6288c740 Merge "sort release configs when creating artifacts" into main am: c77d6259cb am: fe2578be27
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3089365

Change-Id: Ieed3140c7cfdc01a50e47f436fe8762e9b07a299
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-16 16:43:41 +00: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
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
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
31b76e8f53 Build aconfig storage files from soong filesystem am: 162098358c am: b3d004bb9a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3084947

Change-Id: I34987f7f2626aa67d74b2a1377d9f27f444c1936
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-16 06:16:23 +00: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
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
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
Spandan Das
9d3bc89337 Merge "Align boot jar exclusion with apex_contributions" into main 2024-05-16 00:34:56 +00:00
Treehugger Robot
c6541077de Merge "Filter-out deps of unsupported arch" into main 2024-05-16 00:33:24 +00:00
LaMont Jones
41eeb7112d [automerger skipped] Don't panic when a map is included twice am: cdbe0acfbd -s ours
am skip reason: Merged-In I90c55a800ecad932f8f67cf6f9f60dba571f7c48 with SHA-1 05d59c5905 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/27364160

Change-Id: I8d2d7ceb735481ad9cb396a6b216f9ba57fa84e9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-15 23:09:09 +00:00
LaMont Jones
293738ecd8 [automerger skipped] clean up RELEASE_ACONFIG_VALUE_SETS am: ef3de5188f -s ours
am skip reason: Merged-In I671d4b5f57c9bdd252d98e048f16aa9c7b3b2ffa with SHA-1 8e2a6b1fe9 is already in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/27364159

Change-Id: Idb0943f544a55ece946a69e9ce1a68b62066db7c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-15 23:09:06 +00:00
LaMont Jones
ce599ef878 sort release configs when creating artifacts
Bug: 328495189
Test: manual
Change-Id: I0b579c6fdbee5bb09826854dadb9f89955980ca8
2024-05-15 15:48:35 -07: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
Cole Faust
369bad573f Merge "Qualify prebuilt_etc apex module name by relative paths" into main am: 277e444cb3 am: aae86c8947
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3086647

Change-Id: Id200b319f28ffd3521b939f33c04092e50f7c28c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-15 21:51:58 +00:00
Cole Faust
aae86c8947 Merge "Qualify prebuilt_etc apex module name by relative paths" into main am: 277e444cb3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3086647

Change-Id: I19ab713bbe61020894ec88b5aff08cb3765bff44
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-15 21:34:06 +00:00
Cole Faust
277e444cb3 Merge "Qualify prebuilt_etc apex module name by relative paths" into main 2024-05-15 21:21:04 +00:00
Joe Onorato
39c05e1f5f Merge "Move aninja and overrideflags from shell functions to real scripts" into main am: 6e2d36dacb am: 3ee466f8f8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3087345

Change-Id: I559b322e7edf72524e484101ab4f66a98439fa09
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-15 19:21:42 +00:00
Joe Onorato
3ee466f8f8 Merge "Move aninja and overrideflags from shell functions to real scripts" into main am: 6e2d36dacb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3087345

Change-Id: I4861b5dd779052f212ee3f9c1f75c117642001c9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-15 19:00:04 +00:00
LaMont Jones
cdbe0acfbd Don't panic when a map is included twice
If a map was included twice, we had side effects when skipping the extra
inclusion.

Bug: 340659219
Test: manual, TH
Merged-In: I90c55a800ecad932f8f67cf6f9f60dba571f7c48
Change-Id: I90c55a800ecad932f8f67cf6f9f60dba571f7c48
2024-05-15 18:50:20 +00:00
LaMont Jones
ef3de5188f clean up RELEASE_ACONFIG_VALUE_SETS
Only add a repository to the trace when it actually specifies
aconfig_value_sets.

Also default to only generating the release config .mk file for the
current TARGET_RELEASE (rather than all), to reduce kati reruns.

Bug: 340126861
Test: manual, TH
Merged-In: I671d4b5f57c9bdd252d98e048f16aa9c7b3b2ffa
Change-Id: I671d4b5f57c9bdd252d98e048f16aa9c7b3b2ffa
2024-05-15 18:50:11 +00:00