Commit graph

81787 commits

Author SHA1 Message Date
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
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
Tomasz Wasilczyk
d848dcc9e6 Disable cc_cmake_snapshot outside of Linux
Test: cd build/soong/cc && go test
Bug: 339782737
Change-Id: Ide6693123c741a39d37164a1a39841be1bd84862
2024-05-10 21:32:23 +00:00
Tomasz Wasilczyk
cd8dc70806 Merge "Skip cmake_snapshot_test(s)" into main 2024-05-10 15:00:34 +00:00
Tomasz Wasilczyk
ea2fbd6787 Skip cmake_snapshot_test(s)
These tests fail on sdk-sdk_mac-trunk_staging because this feature is
not intended to run outside of Linux. Let's skip these tests for now
until we figure out how to disable snapshot feature properly.

Bug: 339782737
Test: go test
Change-Id: Ibe70a0e3dc92262c78ce9e3a8af58f2da3bfeda2
2024-05-10 14:20:15 +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
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
dd056e087e Merge "Create EXTRA_INSTALL_ZIPS variable" into main 2024-05-10 00:11:16 +00:00
Tomasz Wasilczyk
ae0d23fc18 Merge "Implement cc_cmake_snapshot" into main 2024-05-09 23:53:02 +00:00
Treehugger Robot
0820b61d8c Merge "sort _all_release_configs variable before we write it" into main 2024-05-09 23:38:41 +00:00
Treehugger Robot
ef14cae605 Merge "Rename release_variable to release_flag in selects" into main 2024-05-09 23:27:58 +00:00
LaMont Jones
80ef5ce7bc sort _all_release_configs variable before we write it
Bug: 339707888
Test: manual, TH
Change-Id: Icbf9a8f84a62b60469ed636f69818c9179d2ddf6
2024-05-09 15:33:13 -07:00
LaMont Jones
7b48992a1a Merge "crunch_flags: handle non-string ACONFIG_VALUE_SETS" into main 2024-05-09 22:25:54 +00:00
Hao Chen
1c8ea5b6e1 Implement cc_cmake_snapshot
Bug: 302718225
Test: cd build/soong/cc && go test
Test: https://r.android.com/2803466
Change-Id: Ie7df635233ed68c40d917ea1f83f9fd4b5bfe729
2024-05-09 15:25:27 -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
efdbfe1ede Merge "Revert "Convert overrides to a TransitionMutator"" into main 2024-05-09 21:35:12 +00:00
Cole Faust
99bec75197 Create EXTRA_INSTALL_ZIPS variable
Make needs to know about the "extra" zip files that are extracted
to the staging directories so that it can track all the installed files
correctly.

Also add a utility tool for listing the contents of relevant zips.

Bug: 337869220
Test: m droid and checked the contents of file_list.txt when adding an android_app_set locally
Change-Id: Idc5dd785b03c05f7972c66620d4e6359892b3863
2024-05-09 14:20:11 -07: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
Colin Cross
d7b2a45d47 Revert "Convert overrides to a TransitionMutator"
This reverts commit 49be24b833.

Reason for revert: b/338643193
Bug: 319288033
Bug: 338643193

Change-Id: I7106e779e52ffc943bdcf7ee3b7c7b65fe34122e
2024-05-09 20:18:49 +00:00
Pedro Loureiro
57b1b6802f Add RELEASE_APEX_CONTRIBUTIONS_PRIMARY_LIBS build flag
Bug: 339132327

Test: m out/soong/prebuilt_info.json
Test: manually inspect that json file
Change-Id: Ib20164c82316fe02fe04a52461e344f1dfb03b90
2024-05-09 16:11:05 +00:00
Sam Chiu
4ba7b435e4 Merge "Revert "Enable -Wfortify-source"" into main 2024-05-09 13:27:54 +00:00
Treehugger Robot
cfac8c1bc8 Merge "relax the restriction on .proto files in data" into main 2024-05-09 07:54:07 +00:00
Sam Chiu
9b7e07c7aa Revert "Enable -Wfortify-source"
This reverts commit a6e022c835.

Reason for revert: To verify the broken build b/339553761

Change-Id: Ib5546879effc283464a9ef66a20378960f9a56bf
2024-05-09 06:52:15 +00:00
Aditya Kumar
29e3483546 Merge "Enable -Wfortify-source" into main 2024-05-09 04:10:54 +00:00
Cole Faust
dd4f5537b8 Merge "Remove embedded_launcher: true usages" into main 2024-05-09 01:09:13 +00:00
LaMont Jones
6f3ca9eea1 crunch_flags: handle non-string ACONFIG_VALUE_SETS
If the default value for RELEASE_ACONFIG_VALUE_SETS is not a string,
the resulting value is the empty string.

Bug: 328495189
Test: manual
Change-Id: Ie8f262d6408b1564ec7a3918f8654ccfa9bc5940
2024-05-08 17:26:47 -07:00
Treehugger Robot
7eaf503cfd Merge "Revert^2 "Remove compilation actions from java sdk library"" into main 2024-05-08 22:28:05 +00:00
Jiyong Park
2aff024c18 Merge "Don't install sdk variants, not platform variants" into main 2024-05-08 22:26:33 +00:00
Cole Faust
dfcb5c515b Remove embedded_launcher: true usages
The default value for embedded_launcher has been changed to true.

Bug: 174041232
Test: Presubmits
Change-Id: I2fb4b920828307e60c0fae6864ba720c7c31e1f2
2024-05-08 12:13:38 -07: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
Raphael Blistein
5985846f29 relax the restriction on .proto files in data
Context: yaqs/7447701439926763520#a1

Bug: b/339454115
Test: go test
Change-Id: If3ed81334a192993d32404301b55ca7b4f5780ae
2024-05-08 17:28:19 +00:00
AdityaK
a6e022c835 Enable -Wfortify-source
Fixes: 315245071
Change-Id: Ic8ca6a1c0dafea62f2bca3d20f5c86b3e3225ea0
2024-05-08 16:35:51 +00:00
LaMont Jones
992011ea77 Always write makefile for ${TARGET_RELEASE}
When writing all makefiles, we also need to write the makefile for
${TARGET_RELEASE}.  We can skip writing it a second time if it is not
an alias.

Bug: 328495189
Test: manual, TH
Change-Id: Ia5d1955f419312c76eb9c8a33b1c8a6bcc5efe0b
2024-05-08 09:16:44 -07: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
acd5f590af Don't install sdk variants, not platform variants
Background: if a lib has `sdk_version` set, it is mutated into two
variants: platform and sdk. The latter is for the inclusion into
unbundled APKs which can be installed on older platforms. The former is
what is installed to the platform.

So far, for unbundled app builds, (1) the platform variant was marked as
uninstallable, (2) while the sdk variant was left installable. (1) is
causing a problem (b/339262059) when an APEX containing a filesystem
module is built as unbundled. The filesystem skips installing the
platform variant. (2) is not causing a problem, but is unnecessary
because the sdk variant is not something to be installed (on the
platform). It is built into the APK via the jni_libs property. It's not
considered an installation.

This change fixes (1) and (2). For (1), the platform variant is always
marked installable even for unbundled build. For (2), the sdk variant is
always marked non-installable.. because, again, it's not designed to be
installed to the platform.

Bug: 339262059
Test: banchan com.android.virt aosp_arm64
UNBUNDLED_BUILD_SDKS_FROM_SOURCE=true m apps_only dist
check libc++.so, libcrypto.so are in the microdroid image in the APEX.

Change-Id: I8999b724926cd9ab6d56796133e218fefcc1910b
2024-05-08 11:29:11 +09: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
Jiyong Park
54fa3bbef5 Merge "Run two microdroid test case as postsubmit" into main 2024-05-07 23:10:42 +00:00
Treehugger Robot
780ad1edf7 Merge "build_flag: improve default flag value directory" into main 2024-05-07 22:04:22 +00:00
LaMont Jones
d6406171ae build_flag: improve default flag value directory
The default directory for flag values is the last of:
 - Where the flag is declared,
 - Where the release config is first declared,
 - Where the flag value is currently being set for this release config.

Bug: 328495189
Test: manual
Change-Id: Ida1f906b75704f658e7fa1de703e0c789dce06a6
2024-05-07 13:59:28 -07:00
Tomasz Wasilczyk
e3eb59db9f Merge "BaseCompilerProperties: add AidlInterface struct for aidl_interface info" into main 2024-05-07 19:09:50 +00:00
Cole Faust
3f01580c04 Merge "Make the enabled property configurable" into main 2024-05-07 17:49:10 +00:00
Kiyoung Kim
0d4a9ca792 Fix build error from llndk.libraries.txt
llndk.libraries.txt build fails from clang tools build, as there is no
valid target path for llndk.libraries.txt from the build. This change
skips llndk.libraries.txt build if target output path is empty.

Bug: 330100430
Test: prebuilts/clang-tools/build-prebuilts.sh passed
Change-Id: I867dc90dbf98e3d8c24b191a744686286740b230
2024-05-07 16:11:41 +09:00
Treehugger Robot
bf30241e75 Merge "rustc-1.77.1.p1 Build 11801116" into main 2024-05-07 02:39:45 +00:00
Hsin-Yi Chen
a27230aaf6 Merge "Disable header ABI checker for NDK" into main 2024-05-07 02:28:04 +00:00
Jooyung Han
197b56f58b Merge ".capex is a container" into main 2024-05-07 01:36:41 +00:00