Commit graph

82053 commits

Author SHA1 Message Date
Cole Faust
749eeaa94c Update select tests for optionals
Bug: 323382414
Test: m nothing --no-skip-soong-tests
Change-Id: I314719c9e287638acbc1ef82651d14fee6e1a55a
2024-05-21 14:19:05 -07:00
Spandan Das
5f1f9405b5 Restrict validateApexClasspathFragments to active apex prebuilts
This is a followup to https://r.android.com/3073624 that moved
validation of bcp jars to the top-level prebuilt apex. It is possible
that there can be multiple prebuilt variants of a mainline module and
each prebuilt might have a skew in bcp jars. This CL limits the check to
only the selected apex prebuilt.

Test: go test ./apex
Bug: 328578801
Change-Id: If225a1af6004b6584b86ec442f99672f0d1f8314
2024-05-21 18:59:23 +00:00
Cole Faust
bc82eaf0f6 Remove printf in tests
This causes unnecessary spam when running
m nothing --no-skip-soong-tests.

Test: m nothing --no-skip-soong-tests
Change-Id: I4d893b3da47a9f79774c67274a84ff77be9c4811
2024-05-21 11:22:29 -07:00
Cole Faust
b9519094d9 Add test for selects with variables
I thought this might need extra parsing code to handle, but it appears
to work fine.

Bug: 323382414
Test: Presubmits
Change-Id: I4e8bf44a222427c34b2709a41aa5497984154d9d
2024-05-21 11:20:15 -07:00
LaMont Jones
e0d5ea1d7c Merge "Add Factory methods, WriteFormattedMessage" into main 2024-05-21 17:30:21 +00:00
Yu Liu
928cb6d557 Merge "Write ninja file in parallel." into main 2024-05-21 17:22:01 +00:00
Jeongik Cha
aaa6dcdabb implement InstallDepNeeded for sdkLibraryComponentTag
To include a sdk library impl and a permission xml for that.

Bug: 340365498
Test: m aosp_cf_system_x86_64 && check if there is a sdk lib impl and
permission xml

Change-Id: I10190fb9d398b6249efd6fe50b204e328250f23f
2024-05-22 00:43:20 +09:00
Treehugger Robot
1c07aaac6a Merge "Add clang_verify property for cc." into main 2024-05-21 08:00:45 +00:00
Hsin-Yi Chen
cf90c1596a Merge "Add --release and --lib-variant to the instructions to update ABI dumps" into main 2024-05-21 04:56:19 +00:00
kellyhung
d62ea30647 Add clang_verify property for cc.
This property is to support cflags "-Xclang -verify" build pass in Soong. The behaviors of clang_verify:
- append cflags "-Xclang -verify"
- append "&& touch $out" to the clang command line

Bug: 311284462
Test: go test -run TestClangVerify

Change-Id: Ic5825e2d649da4c3c5ed6da916e9804d7e3c03da
2024-05-21 11:31:48 +08:00
Jiyong Park
46469d6a03 Merge "Add multilib.prefer32.deps to packaging base" into main 2024-05-21 01:00:58 +00:00
Treehugger Robot
652824c8d6 Merge changes from topic "revert-3094658-revert-3088867-QEHDREAABY-IOPVAUIKWL" into main
* changes:
  Revert^2 "Refactor how jni_libs dependencies are added"
  Revert^2 "Add make java.dependencyTag installable or not"
  Revert "Revert "APK-in-APEX should set use_embedded_native_libs:..."
  Revert^2 "Install jni symlinks in Soong"
2024-05-20 23:00:05 +00:00
Treehugger Robot
39b3b1f71d Merge "Make refreshmod a script instead of a shell function" into main 2024-05-20 22:38:12 +00:00
Treehugger Robot
4deefa4c99 Merge "Convert envsetup.sh shell functions to scripts." into main 2024-05-20 22:38:09 +00:00
Treehugger Robot
766a156fac Merge "Create empty monolithic hiddenapi flags files for non java devices." into main 2024-05-20 22:21:29 +00:00
Treehugger Robot
58dace8454 Merge "Do not instrument the implementation library of sdk_library" into main 2024-05-20 21:45:27 +00:00
Jiyong Park
92d8404bc5 Revert^2 "Refactor how jni_libs dependencies are added"
562d9054e5

Change-Id: Ib9e6efc736bd0ba20637afb0a8d05b9b0266586f
2024-05-21 06:41:37 +09:00
Jiyong Park
c1e5b1848a Revert^2 "Add make java.dependencyTag installable or not"
f14b5ba863

Change-Id: I0638d4997cb8e5178f869ea0f469a1a5c141611e
2024-05-21 06:41:36 +09:00
Jiyong Park
970c524ab5 Revert "Revert "APK-in-APEX should set use_embedded_native_libs:..."
Revert submission 3094658-revert-3088867-QEHDREAABY

Reason for revert: not a regression
Reverted changes: /q/submissionid:3094658-revert-3088867-QEHDREAABY

Change-Id: Ie1e4a196f181643a3e64e573b132d52d7455461b
2024-05-21 06:41:36 +09:00
Jiyong Park
25b9222a43 Revert^2 "Install jni symlinks in Soong"
b7646e4d4f

This is a relanding of I0930cb1ebb8ca8a6efd64b1ce2cdfd1c47fe19ef plus
some forward fix described below:

Export non-embedded JNI lib names via LOCAL_REQUIRED_MODULES

The non-embedded JNI libs are installed as the dependencies of the APK.
However, that dependency is not revealed to the Make world and as a
result, the JNI libs are dropped from the file_list.txt file which Make
uses to filter files to include in the image file.

Adding the lib names to LOCAL_REQUIRED_MODULES fixes it.

Bug: 341335305
Bug: 330276359
Test: m out/target/product/vsoc_x86_64_only/obj/PACKAGING/system_intermediates/file_list.txt
and check if libcarservicejni.so is there
Test: go test ./... under soong/java

Change-Id: If915a05909129c92fab7a6cbbd0c4c55f5ced598
2024-05-21 06:40:14 +09:00
优秀
d75e99859b Fix the problem of resource integration confusion caused by not adding regional configuration tailoring.
An android app is automatically creating a corresponding "product
characteristics" RRO. The app's resources are filtered by the aapt
product config, but the rro resources are not. This cl makes the RRO
resources also filtered.

When building the CN version, it was expected that only the resources
corresponding to the CN version would be retained, but the actual result
was that other unexpected areas appeared on the region setting interface
in boot interface. After investigation, it was found that the
framework-res__nosdcard__auto_generated_characteristics_rro.apk apk
integrated resources other than the CN version that caused this problem,
and the integration of this apk was not filtered by aaptconfig.
The purpose of this modification is to add aaptconfig filtering, and it
has been verified that this problem can be fixed.

Change-Id: I85d5d07397bd2b0759d35b9f3a07f015346af4e9
Signed-off-by: wybxyx <wybxyx@gmail.com>
2024-05-20 21:35:12 +00:00
LaMont Jones
e3de5ac6d0 Add Factory methods, WriteFormattedMessage
Adds:
 - FlagArtifactFactory()
 - FlagArtifactsFactory()
 - WriteFormattedMessage()

Bug: 328495189
Test: manual
Change-Id: I8b3c1e1e7ea3e52e9e7e8b1f8162fedd3e83dd33
2024-05-20 13:43:20 -07:00
Yu Liu
1b2ddc8093 Write ninja file in parallel.
Bug: 335718784
Test: CI
Change-Id: Ie36d78478a60359b704767689846e76b1c2ba76d
2024-05-20 20:28:44 +00:00
Jihoon Kang
34155e3363 Do not instrument the implementation library of sdk_library
Currently, the implementation library of the java_sdk_library is always
being instrumented due to the issue described in b/159241638.

With https://r.android.com/3079425, all compilation actions of the
java_sdk_library is delegated to the implementation library.
Consequently, this has caused all java_sdk_library to be instrumented,
leading to coverage builds failing due to double instrumentation (i.e.
instrumenting an already instrumented class file). In order to prevent
such error, this change modifies the property of the implementation
library to not instrument during coverage builds.

This change also copies some additional java library properties from
that of the implementation library to the top level sdk library, in
order to ensure that all non-null androidmk entries are correctly
reflected in that of the sdk library.

Test: lunch husky-trunk_staging-userdebug && EMMA_INSTRUMENT=true EMMA_INSTRUMENT_FRAMEWORK=true m droid dist
Bug: 340174053
Bug: 341170242
Change-Id: I9d8f1c190205fa7a827649961ba5222293a945ad
2024-05-20 19:08:49 +00:00
Spandan Das
a90db96bb9 Create empty monolithic hiddenapi flags files for non java devices.
This is a followup https://r.android.com/3089366 that disabled the
creation of out/soong/hiddenapi/hiddenapi* files for non java device
builds. This works fine for `m`, but `m dist` runs issues since
`f/b/boot/Android.bp` dists these files. For non java devices, the
previous implementation would report missing files during ninja
excecution (https://b.corp.google.com/issues/338363444#comment5)

This CL creates empty files for these so that the dist tags can always
be resolved.

Bug: 338363444
Test: lunch aosp_cf_x86_64_minidroid-trunk_staging-userdebug && m dist
Change-Id: Ice2d970a164246753da89a6a06dfd28a627a272d
2024-05-20 18:56:28 +00:00
Treehugger Robot
a6ecdd39c8 Merge "Dump the required modules into module-info.json" into main 2024-05-20 17:55:15 +00:00
Treehugger Robot
8298134503 Merge changes Ifbe123d1,Ie2e738a6 into main
* changes:
  Support min_sdk_version overrides in apexes
  Support min_sdk_version overrides in apps
2024-05-20 17:38:11 +00:00
Hugo Drumond Jacob
44616ccdce Dump the required modules into module-info.json
Certain applications, like tracking the dependency chain of modules,
knowing the "required" dependencies is required.

In this context, "required" here means the `required` field in
Android.bp files.

Bug: 339193439
Test: Inspect module-info.json for the `required` field
Change-Id: I420c781d410e715ef86823278f99e4ffe51f8022
2024-05-20 18:40:09 +02:00
Spandan Das
50801e20a3 Support min_sdk_version overrides in apexes
The use case for this are go apexes which are only installed in T and
above, even though the base AOSP apexes might be installable on < T
devices.

If provided, the overridden min_sdk_version will be
1. Used as the `min_sdk_version` in the manifest file of the
   top-level override apex binary
2. Used to build the transitive closure of its dependency with that
   min_sdk_version, i.e. with a different apex variant.

(2) requires some special handling. At ToT, the outgoing transition
value is the base apex name (e.g. com.android.foo). Since
min_sdk_version of the overridding apex can be different than the
overridden apex, the base apex name is no longer sufficient. Instead,
transition to the name of the overriding apex com.mycompany.android.foo.
If deduping is possible, transitive deps will get deduped to
`apex_<min_sdk_version>` later.

Test: added a unit test
Test: in internal, modified min_sdk_version of com.google.android.go.art
locally, built BA and Go apexes, and used `aapt2 dump badging` to verify
that BA has minSdkVersion of 31 and Go has minSdkVersion of 33

Bug: 295311875

Change-Id: Ifbe123d1517fccbc0c058042b8a6eeb3609b6787
2024-05-20 16:24:52 +00:00
Jiyong Park
e604378aed Add multilib.prefer32.deps to packaging base
The property is used to prefer the 32-bit variant of a dep over the
64-bit variant. If 64-bit variant is the only available one, it is
depended on.

This will be used to include 32-bit preferred modules like drmserver and
mediaserver in filesystem modules.

Bug: N/A
Test: go test ./... under soong/android

Change-Id: Ic7185eb2044c9987f8d1e9b6cf7f0dbd235cf04c
2024-05-20 16:47:44 +09:00
Yi Kong
9b9d29b845 Turn off relaxed-template-template-args as a workaround
ToT switched on "relaxed-template-template-args" by default. This does
not work with our outdated libc++. Turn it off until we have the new
libc++.

Test: build with Kokoro ToT Clang (build 2417)
Bug: 341084395
Bug: 332594828
Change-Id: I994c476c1f7b4abd81e5ae0bde4e1f9afd1aa920
2024-05-20 02:48:42 +09:00
Joe Onorato
5bcd43ed50 Make refreshmod a script instead of a shell function
Bug: 340648588
Test: refreshmod
Change-Id: I757fc442fb8161d99ddbcbc9ecb4d3d501c6a727
2024-05-18 07:57:01 -07:00
Joe Onorato
9a0a2fcb11 Convert envsetup.sh shell functions to scripts.
Bug: 340648588
Test: Run them
Change-Id: I19303ac08bd98619f0a8ee4ee5efb6d735538578
2024-05-18 07:56:54 -07:00
Treehugger Robot
bd6b1fcab4 Merge "deps in the packaging modules supports select" into main 2024-05-18 03:47:33 +00:00
Jiyong Park
105e11ca12 deps in the packaging modules supports select
deps: ["foo"] + select(product_variable("debuggable") {
    true: ["bar"],
    default: [],
}),

returns ["foo", "bar"] on debuggable builds, and ["foo"] on user builds.

Bug: N/A
Test: go test ./...
Change-Id: I31ca22e69e3316e4007a36ae13c04c7e5c445907
2024-05-18 08:44:58 +09:00
Jiyong Park
93a7a6dfe4 Merge "Select supports product_variable("debuggable")" into main 2024-05-17 23:40:14 +00:00
Yu Shan
4978080b1d Merge changes from topic "revert-3088867-QEHDREAABY" into main
* changes:
  Revert "Install jni symlinks in Soong"
  Revert "APK-in-APEX should set use_embedded_native_libs: true"
  Revert "Add make java.dependencyTag installable or not"
  Revert "Refactor how jni_libs dependencies are added"
2024-05-17 22:55:51 +00:00
Spandan Das
b9c58350ca Support min_sdk_version overrides in apps
This replaces the global override of min_sdk_version (via
`APEX_GLOBAL_MIN_SDK_VERSION_OVERRIDE`) with an min_sdk_version override
that can be set by each individual soong override_app.

The use case for this are go apps which are only installed in T and
above, even though the base AOSP apexes might be installable on < T
devices.

Test: added a unit test

Bug: 295311875
Change-Id: Ie2e738a6786bb24417c675617f7c78358017c96c
2024-05-17 21:15:04 +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
Yu Shan
b7646e4d4f Revert "Install jni symlinks in Soong"
Revert submission 3088867

Reason for revert: On cf_auto build, we are seeing a symlink of jni lib pointing to lib64/libcarservicejni.so, which does not exist on the device.

Reverted changes: /q/submissionid:3088867
Bug: b/341335305

Change-Id: Ie4ff26fe47e1a0ab5e97b185c61cb94473cc5fb8
2024-05-17 13:37:37 -07:00
Yu Shan
d5e435d749 Revert "APK-in-APEX should set use_embedded_native_libs: true"
Revert submission 3088867

Reason for revert: On cf_auto build, we are seeing a symlink of jni lib pointing to lib64/libcarservicejni.so, which does not exist on the device.

Reverted changes: /q/submissionid:3088867
Bug: b/341335305

Change-Id: I3064caef0cb55d1594951835a1173c667f58e607
2024-05-17 13:37:30 -07:00
Yu Shan
f14b5ba863 Revert "Add make java.dependencyTag installable or not"
Revert submission 3088867

Reason for revert: On cf_auto build, we are seeing a symlink of jni lib pointing to lib64/libcarservicejni.so, which does not exist on the device.

Reverted changes: /q/submissionid:3088867
Bug: b/341335305

Change-Id: I60052dbb004df58fdfaf93be6089769ab2a670fc
2024-05-17 13:37:20 -07:00
Yu Shan
562d9054e5 Revert "Refactor how jni_libs dependencies are added"
Revert submission 3088867

Reason for revert: On cf_auto build, we are seeing a symlink of jni lib pointing to lib64/libcarservicejni.so, which does not exist on the device.

Reverted changes: /q/submissionid:3088867
Bug: b/341335305

Change-Id: Ibda68b268e74ffca1840faae01a2f3fe2e00be30
2024-05-17 13:37:07 -07: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
6c9f524953 Merge "Enable -Wfortify-source" into main 2024-05-17 18:58:08 +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
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
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