Commit Graph

8396 Commits

Author SHA1 Message Date
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
e716807083 Install transitive deps of jni libs, but not the jni libs themselves
Consider this case:

app --(jni_libs)--> libfoo --(shared_libs)--> libprivate

Only libfoo is embedded into the app. libprivate is not embedded because
libprivate is very likely to be depended on by other components in the
platform, in which case it will anyway be installed to /system/lib.
Embedding libprivate into the app will increase the storage usage as a
whole. Furthermore, if libprivate is not a shared lib but a config file
(of type prebuilt_etc), it can't be embedded and therefore must be
installed outside of the app.

However, a problem occurs when libprivate is not depended on by anyone
else. Then libprivate is not installed to the system partition, causing
an error at runtime.

This CL fixes that by making the jni_libs dependency to implement the
new SKipToTransitiveDepsTag interface. Now, jni_libs themselves are not
installed, but their transitive deps are depended on by the app
containing the jni libs.

Bug: 330276359
Test: m NfcNci and check if libnfc-nci.config is installed.
Test: m CarService and check android.hardware.automotive.evs-V2-ndk.so
is installed as well.
Test: go test ./... under soong/java

Change-Id: I04cc92b7fad768a20ec60a02b3e7534641b1e74d
2024-05-10 14:03:07 +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
Jiyong Park
ef5511ff77 Revert "Revert "Collect transitve deps of jni libs only for bund..."
Revert submission 3078746-revert-3075263-MMTOVXSVUO

Reason for revert: relanding with forward fix: aosp/3078748

Reverted changes: /q/submissionid:3078746-revert-3075263-MMTOVXSVUO

Change-Id: I207f6fd83190e258eba8b22c0d6a6f0feea9f87f
2024-05-10 06:12:54 +09:00
Jiyong Park
20df11ef2b Revert^2 "Always embed jni libs and store uncompressed"
a71b90cf81

Change-Id: I1c071c5449fa04adb14d17774f882e6adbff196b
2024-05-10 06:12:54 +09:00
Treehugger Robot
1ee43f66ef Merge "Revert^2 "Remove compilation actions from java sdk library"" into main am: 7eaf503cfd am: b2923453b8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3079425

Change-Id: I0b7ae717b6af9df90420ec87acaf20932cdc7fb7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-08 23:10:55 +00:00
Treehugger Robot
7eaf503cfd Merge "Revert^2 "Remove compilation actions from java sdk library"" into main 2024-05-08 22:28:05 +00:00
Jihoon Kang
a3a05460b4 Revert^2 "Remove compilation actions from java sdk library"
This change modifies the build actions of java_sdk_library module type
so that it does not perform any compilation actions (i.e. does not
create the top level java_sdk_library jar file). Instead, it delegates
the build actions the top level jar file was performing to the
dynamically created ".impl"-suffixed java library module. The build
actions that are delegated to the impl library module include hiddenapi
processing, dexing, and dexpreopt.

This change relands https://r.android.com/3035972. Implementation
changes from the original change:
- "all_apex_contributions" is added as a dependecy to the implementation
  library modules where the parent sdk_library module has a prebuilt
  equivalent. This allows the source apex variant to be hidden from make
  when the prebuilt is active.

Test: patch in internal main, lunch barbet-ap2a-userdebug && m nothing
Test: m nothing --no-skip-soong-tests
Bug: 332785297
Change-Id: I017938e5567aef82e428e7ceb557d9c9090e0257
2024-05-08 17:46:31 +00:00
Treehugger Robot
97f5fd9e4b Merge changes from topic "revert-3075263-MMTOVXSVUO" into main am: d02d710570 am: 49a73f2f8f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3078747

Change-Id: I4c62e36ee4b7260f9118010c8b21f6a09d19555c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-08 10:28:08 +00:00
Treehugger Robot
d02d710570 Merge changes from topic "revert-3075263-MMTOVXSVUO" into main
* changes:
  Revert "Always embed jni libs and store uncompressed"
  Revert "Collect transitve deps of jni libs only for bundled apps"
2024-05-08 09:48:24 +00:00
Sam Chiu
a71b90cf81 Revert "Always embed jni libs and store uncompressed"
Revert submission 3075263

Reason for revert: verifying the test failure b/339332424

Reverted changes: /q/submissionid:3075263

Change-Id: I0e1a526893ee6c591eaefadcee4bbbf321dfc1df
2024-05-08 06:49:33 +00:00
Sam Chiu
4f63dc7904 Revert "Collect transitve deps of jni libs only for bundled apps"
Revert submission 3075263

Reason for revert: verifying the test failure b/339332424

Reverted changes: /q/submissionid:3075263

Change-Id: Id976cba1156b13433d86988eaf41926b7d438433
2024-05-08 06:49:33 +00:00
Jiyong Park
0c1a3b7af6 Merge changes Ie866b192,I7df993ea into main am: 14f7714fb4 am: a044598add
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3075263

Change-Id: Ia130187f46ad20fc7c55ce2dc24aebc1efc20a35
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-08 02:20:17 +00:00
Jiyong Park
14f7714fb4 Merge changes Ie866b192,I7df993ea into main
* changes:
  Collect transitve deps of jni libs only for bundled apps
  Always embed jni libs and store uncompressed
2024-05-08 01:28:45 +00:00
Cole Faust
3f01580c04 Merge "Make the enabled property configurable" into main 2024-05-07 17:49:10 +00:00
Jihoon Kang
4a309b5eac Merge "Revert "Remove compilation actions from java sdk library"" into main am: 5284ad3b33 am: 87296e35d3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3074636

Change-Id: I96f97fef6e4dd7dd43ec3c1f65a29541c748a84c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-07 01:02:28 +00:00
Jihoon Kang
87296e35d3 Merge "Revert "Remove compilation actions from java sdk library"" into main am: 5284ad3b33
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3074636

Change-Id: If4a161286b3f03bcbdc1f387487fba72701787ab
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-07 00:24:51 +00:00
Jihoon Kang
5284ad3b33 Merge "Revert "Remove compilation actions from java sdk library"" into main 2024-05-07 00:03:05 +00:00
Jihoon Kang
8f25d296b5 Revert "Remove compilation actions from java sdk library"
Revert submission 3070882-sdk_lib_remove_compilation

Reason for revert: Potential culprit for build breakage of barbet-ap2a-userdebug in git_main

Reverted changes: /q/submissionid:3070882-sdk_lib_remove_compilation

Change-Id: I5135760e13e0152480c68fe91a3c88564e9bc7cb
2024-05-06 22:40:22 +00:00
Treehugger Robot
a4b92f490d Merge "Remove compilation actions from java sdk library" into main am: f91daab1ab am: e5011d8f23
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3035972

Change-Id: I88d9dd8c3dabea01588455c92d8a734e93206e2d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-06 21:39:08 +00:00
Treehugger Robot
e5011d8f23 Merge "Remove compilation actions from java sdk library" into main am: f91daab1ab
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3035972

Change-Id: I2df9d4940eb12bb8d8cb46d05bfef05d2666ae8f
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-06 21:24:03 +00:00
Treehugger Robot
f91daab1ab Merge "Remove compilation actions from java sdk library" into main 2024-05-06 21:06:54 +00:00
Jiyong Park
4bc5231f61 Collect transitve deps of jni libs only for bundled apps
We do this because otherwise we will be embedding platform libs in the
bundled apps bloating their size.

Bug: 330276359
Test: Build Galery2 and check if libc++.so is not included there.
Change-Id: Ie866b192e9816bcb71b7ca3d74331d14d85592a4
2024-05-05 10:49:22 +09:00
Spandan Das
13af441368 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
Ignore-AOSP-First: required to fix merge conflict

Change-Id: I6eec603397eea926f3a481b79ca938245064d809
2024-05-04 00:12:07 +00:00
Jihoon Kang
d831af4267 Remove compilation actions from java sdk library
This change modifies the build actions of java_sdk_library module type
so that it does not perform any compilation actions (i.e. does not
create the top level java_sdk_library jar file). Instead, it delegates
the build actions the top level jar file was performing to the
dynamically created ".impl"-suffixed java library module. The build
actions that are delegated to the impl library module include hiddenapi
processing, dexing, and dexpreopt.

Test: m nothing --no-skip-soong-tests
Bug: 332785297
Change-Id: I7534f9eaacf6d9f72fbf8d540b1e26af84106c20
2024-05-03 20:51:11 +00:00
Treehugger Robot
1792fd5fd1 Merge "Pass module-lib and system-server extension jars for system-server" into main am: 7a4d748669 am: 39435fdcd7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3072144

Change-Id: I702502c8daa496a2283472479f19c0572ae0fccc
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-03 18:16:33 +00:00
Treehugger Robot
39435fdcd7 Merge "Pass module-lib and system-server extension jars for system-server" into main am: 7a4d748669
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3072144

Change-Id: I596139c5cdd1e118dc99c4bfc9b40ca0feb97a0d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-03 17:58:30 +00:00
Treehugger Robot
7a4d748669 Merge "Pass module-lib and system-server extension jars for system-server" into main 2024-05-03 17:54:07 +00:00
Jiyong Park
3eea67d8eb Always embed jni libs and store uncompressed
Previously, unlike unbundled apps, if a platform app depends on a native
library, it is not embedded in the app, but installed to <partition>/lib
and the app is instead provided with a symlink to the lib. This actualy
is a legacy from the original Android where native libraries couldn't be
executed while embedded in the apk. To be executed, the native libs had
to be extracted to a mutable storage, but that had a risk of breaking
the verified boot, so libs couldn't be embedded.

Since API level 23, execute-in-place of native libs has become
possible. But platform apps had to opt-in (use_embedded_native_libs:
true) for the feature for a reason that is unclear today. Perhaps, it
was to save disk space in case when multiple apps share the same native
library, but such cases are found to be very rare, or non-existing.

With this CL, two changes are introduced:

1. jni libs are always embededd for all apps (bundled or unbundled)

2. use_embedded_native_libs is deprecated unless the module type is
   android_test or android_test_helper_app. It is now a
   no-op property. It's left just to not break existing bp files.

This will make unbundled apps bigger, but given that unbundled apps
built using android platform build system are tests, the size increase
should be acceptible.

Bug: 330276359
Test: m
Change-Id: I7df993ea85bce1c0a7222000c403a974818c3362
2024-05-04 01:58:09 +09:00
Oriol Prieto Gascó
ff7d15ed9e Merge "Make container mandatory in aconfig_declarations." into main am: a874e94bab
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3058702

Change-Id: I6e9e2d8eb1f816a96e456d4d287b8821a2a606c4
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-03 14:25:58 +00:00
Oriol Prieto Gascó
a874e94bab Merge "Make container mandatory in aconfig_declarations." into main 2024-05-03 14:09:48 +00:00
Inseob Kim
ea4c73febe Merge changes from topic "logtags_filesystem_module" into main am: 53507d1559 am: 4b45338a9d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3066502

Change-Id: I7131e61a01fc6e86f88f35cd19289cf4fd0b92d9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-03 12:09:35 +00:00
Inseob Kim
4b45338a9d Merge changes from topic "logtags_filesystem_module" into main am: 53507d1559
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3066502

Change-Id: I047402199b93062de23b5f4c3dfa9f4bec6fc018
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-03 11:39:06 +00:00
Paul Duffin
92efc6107f Pass module-lib and system-server extension jars for system-server
While the `system-server` API surface extends the `module-lib` API
surface a library can only provide one or the other as they appear
in bootclasspath and systemserverclasspath respectively. A library
that is on the bootclasspath cannot provide a `system-server` API
as it would be usable by non-system server code. A library that is
on the systemserverclasspath could provide a `module-lib` API but
there is no point as it would only be usable by the system server
making it effectively a `system-server` API anyway.

As a result the `system-server` extension directories only contain
`service-*` jars for libraries that provide system server APIs.

e.g.
```
$ ls prebuilts/sdk/extensions/11/system-server | cat
api
service-adservices.jar
service-sdksandbox.jar
$ ls prebuilts/sdk/extensions/11/module-lib/ | cat
api
framework-adservices.jar
framework-connectivity.jar
framework-connectivity-t.jar
framework-sdksandbox.jar
framework-tethering.jar
```

So, in order to construct the whole `system-server` API, i.e. the API
visible to the system server, it is necessary to add in the
`module-lib` extension jars too which this change does.

This is necessary to construct an `api-versions.xml` file for the
complete `system-server` API.

Bug: 336993217
Test: TARGETS=$(for i in public system module-lib module-lib-complete system-server-complete; do U=$(echo $i | sed "s|-|_|g"); echo "out/target/common/obj/PACKAGING/api_versions_${U}_generated-api-versions.xml"; done)
      m $TARGETS; mkdir -p before; cp $TARGETS before
      m $TARGETS; mkdir -p after; cp $TARGETS after
      meld before after
      # Review differences.
Change-Id: Ic9652dd28f05e5f569a7a30a84b87f227314d119
2024-05-03 12:21:56 +01:00
Inseob Kim
53507d1559 Merge changes from topic "logtags_filesystem_module" into main
* changes:
  Add logtags support to filesystem module
  Export app's logtags too
2024-05-03 11:20:12 +00:00
Paul Duffin
f2963c7f55 Correct lint error when it cannot find api_versions_* module am: 375acd8def am: 5175694880
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3071643

Change-Id: Ic7b62badd880f40112a27d03a153969de6f6234b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-03 10:16:08 +00:00
Paul Duffin
5175694880 Correct lint error when it cannot find api_versions_* module am: 375acd8def
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3071643

Change-Id: I5f13f890df3e692bcfba30ef4a43044a9929345d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-03 10:01:35 +00:00
Paul Duffin
375acd8def Correct lint error when it cannot find api_versions_* module
Also, fixes the error when it cannot find a module containing the
`annotations.zip` file.

Bug: 336993217
Test: change `apiVersionsModule` setting in `lint.go` to refer to
      a non-existent module and then run `m nothing` to see the
      error message correctly lists the module name.
Change-Id: I84a9e241d1c3bedebc26e119bd4b9861664c43c1
2024-05-03 09:37:42 +01:00
Inseob Kim
52827e13e4 Merge "Merge logtags from cc modules too" into main am: 364740b4a4 am: e33423dfc2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3064842

Change-Id: I0cb2c9ead316144372522a94654516614255cdfe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-03 05:53:44 +00:00
Inseob Kim
e33423dfc2 Merge "Merge logtags from cc modules too" into main am: 364740b4a4
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3064842

Change-Id: Ieddffdcc945c279ed06f9475db034854cf057702
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-03 05:31:46 +00:00
Inseob Kim
364740b4a4 Merge "Merge logtags from cc modules too" into main 2024-05-03 05:10:22 +00:00
Cole Faust
a963b94cde Make the enabled property configurable
This allows using select statements with it.

Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I6f3efaaa3d82505e38a91ee4ba0e18e404360191
Merged-In: If355d24506e3f117d27b21442a6c02bca3402dc7
2024-05-02 15:41:24 -07:00
Cole Faust
850469195e Merge "Reapply "Make the enabled property configurable"" into aosp-main-future am: 6c87a53771
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/27185858

Change-Id: I3d2aebc83b476195888476364ce9b15325e6d84c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-02 21:16:39 +00:00
Cole Faust
6c87a53771 Merge "Reapply "Make the enabled property configurable"" into aosp-main-future 2024-05-02 20:57:30 +00:00
Treehugger Robot
329847e1c7 Merge changes I439179a9,I8ad68f0d into main am: a73c4021ec am: 832dfa8b76
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/3069684

Change-Id: I22ebf3750938882c5fb3a08dd54a9003bff0e6d9
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-02 18:50:07 +00:00
Treehugger Robot
a73c4021ec Merge changes I439179a9,I8ad68f0d into main
* changes:
  Add pattern to match android-plus-updatable.jar
  Clean up apiLevelsGenerationFlags deps gathering
2024-05-02 18:17:08 +00:00
Cole Faust
021bf3d973 Reapply "Make the enabled property configurable"
Previously, I had changed some loadhook-appended property structs
to use selects instead of the "target" property struct. This seems
to not be exactly equivalent because "target" properties are merged
with the regular properties later, at the time the arch mutator runs.

With this reapplication, leave those target property structs alone
to avoid breakages, but I'll have to look into what the issue is
with them later.

This reverts commit ed5276f082.

Ignore-AOSP-First: This cl needs to be in a topic with internal-only projects, will cherrypick to aosp after.
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: If355d24506e3f117d27b21442a6c02bca3402dc7
2024-05-02 10:56:36 -07:00
Paul Duffin
5a195f40a0 Add pattern to match android-plus-updatable.jar
Change https://r.android.com/3068903 adds some extra
`android-plus-updatable.jar` files in `module-lib` and `system-server`
directories of API versions 30 through 34 in `prebuilts/sdk`. This
change modifies the build to pass those files, along with appropriate
`--android-jar-pattern` options to Metalava so it can use them when
generating `api-versions.xml` files for the different API surfaces.

The extra patterns are only passed when `extension_info_file` is
specified as there is no point in including the updatable modules that
contribute to SDK extensions without providing information about the
SDK extensions as well.

Bug: 337836752
Test: See https://r.android.com/3068903
Change-Id: I439179a9d35a4bb677e3bf87a3aea4a983724534
2024-05-02 17:33:02 +01:00