Commit graph

81959 commits

Author SHA1 Message Date
Tomasz Wasilczyk
1e831bfa87 cc_cmake_snapshot: improve support for AIDL
- link correct libbinder for AIDL modules
- fix building AIDL interfaces with non-empty AidlRoot
- don't silently drop non-existent dependencies

Bug: 302718225
Test: aosp/3081709
      atest binder_sdk_docker_test_clang
Change-Id: I181ef5a994f728f8af19134a6697b065a9aee261
2024-05-14 13:45:34 -07: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
d044bb40da Revert "Revert^2 "Always embed jni libs and store uncompressed""
This reverts commit 20df11ef2b.

Change-Id: I5645ddb9e0d2c0873916a9192aa3cfbc967fc2cc
2024-05-15 03:32:26 +09:00
Jiyong Park
75ce275025 Revert "Revert "Revert "Collect transitve deps of jni libs only for bund...""
This reverts commit ef5511ff77.

Change-Id: Ib3d50f156c48578743644e99722b70368dd1e26b
2024-05-15 03:32:25 +09: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
cd9dca20a0 Revert "Install transitive deps of jni libs, but not the jni libs themselves"
This reverts commit e716807083.

Change-Id: If3b63706114cb534af359fdac2d80d8a5d02ea6d
2024-05-15 03:32:22 +09:00
LaMont Jones
8e2a6b1fe9 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
Change-Id: I671d4b5f57c9bdd252d98e048f16aa9c7b3b2ffa
2024-05-14 09:21:10 -07: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
635e1218bd Merge "Fix: required deps from native module to phony module is respected" into main 2024-05-14 05:04:27 +00:00
Rico Wind
c3e6594a0d Merge "Don't run resource shrinking for eng builds" into main 2024-05-14 04:04:17 +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
Colin Cross
783fa37807 Merge "Add $ORIGIN to rpath for cc_test modules" into main 2024-05-13 20:59:01 +00:00
Treehugger Robot
77583741b6 Merge "Fix a check for the ninja_log" into main 2024-05-13 20:20:04 +00:00
Cole Faust
6bb2832c15 Fix a check for the ninja_log
soong_build uses / as it's cwd, so we need to specify the top directory
when checkign for files.

Test: add a printf in the if statement; touch out/soong/Android.bp && m nothing; ensure printf doesn't fire
Change-Id: Iba9773765547b22a03dbca33aa6b8c75359cb5ff
2024-05-13 11:57:16 -07: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
Rico Wind
936754c599 Don't run resource shrinking for eng builds
Since we will not shrink the resources anyway this is a waste of time

Bug: 338429777
Test: m SystemUI
Change-Id: I388f045294131a304920756607792091627921bc
2024-05-13 12:32:33 +02:00
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
Hsin-Yi Chen
d75bc49454 Merge "Ensure opt-in platform ABI dumps are configured with ref_dump_dirs" into main 2024-05-13 03:01:44 +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
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
Colin Cross
b881e324d2 Add $ORIGIN to rpath for cc_test modules
cc_test modules can use data_libs to put shared libraries alongside
the test.  Add $ORIGIN to rpath so they can load them as DT_NEEDED
libraries or with dlopen.

Test: treehugger
Change-Id: I4227d16ff80e70dfecb481a2de6dd15af66348bc
2024-05-10 20:27:32 +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
Cole Faust
b81dc0efd0 Add tests for unhandled select condition errors
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: Ic36545c2730216c514c1530ded35829966e974f0
2024-05-09 15:51:52 -07: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
Hsin-Yi Chen
3d5c6791bc Ensure opt-in platform ABI dumps are configured with ref_dump_dirs
Test: make
Bug: 323447559
Change-Id: I8eaa38970c81c71b7473bdb9e77dfe9b49a93c92
2024-05-09 18:24:06 +08: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