Commit graph

6788 commits

Author SHA1 Message Date
Jihoon Kang
346a117921 Create bp2build converter for platform_compat_config module type
This change adds bp2build converter for platform_compat_config module
type and its corresponding test case.

Bug: 269202028
Test: bp2build unit tests
Change-Id: I17d560c8f0e725efe69e151685d003c3dcb11f2f
2023-06-06 19:35:36 +00:00
Jihoon Kang
4190764669 Merge changes from topic "android_stubs_current_refactor"
* changes:
  Cleanup android.JavaApiLibraryName references
  Redefine core and core platform API surface java_library
  Introduce product variable Build_from_text_stub
  Introduce "Exclude_static_libs" property for Java modules
2023-06-06 19:16:25 +00:00
Anton Hansson
efd18370b0 Merge "Allow Bluetooth to use privapp_allowlist" 2023-06-06 18:29:07 +00:00
Spandan Das
91a8820688 Merge changes from topics "xsd_config_bp2build_cc_rdeps", "xsd_config_bp2build_java_rdeps"
* changes:
  bp2build for cc libraries that use xsd_config as gen srcs
  bp2build for java libraries using xsd_config srcs
2023-06-05 22:23:37 +00:00
Jihoon Kang
91c839566e Cleanup android.JavaApiLibraryName references
This change cleans up references to android.JavaApiLibraryName() so that
rdeps link against "android_*_stubs_current" instead of
"android_*_stubs_current.from-text".

Bug: 284995489
Test: m
Change-Id: Ibdf33b15981317c43e468dbc1657229d54bbd226
2023-06-05 21:45:01 +00:00
Jihoon Kang
67b6443258 Redefine core and core platform API surface java_library
Redefined core and core platform API surface java_library using the
product variable build_from_text_stub so that the correct static libs
are linked based on build configuration

Test: m --build-from-text-stub and verify no ninja path between "core.current.stubs" and "core.current.stubs.from-source"
Bug: 285410821
Change-Id: I26febc65697be6278624a504ffbb61be0953d798
2023-06-05 21:44:33 +00:00
Jihoon Kang
381c2fa27c Introduce "Exclude_static_libs" property for Java modules
Exclude_static_libs property can be used to specify static libs that
should not be used to build the module. The list acts as filter for
static_libs.

Bug: 285410821
Test: go test ./java
Change-Id: Iee7f160ba88b5f64bdd265c30d47c9f51feb0f5e
2023-06-05 21:42:48 +00:00
Mark Teffeteller
3bc9c57dc4 Merge "Add use_platform_libs to fuzz config" 2023-06-05 14:41:51 +00:00
Anton Hansson
e3f31cfd1e Allow Bluetooth to use privapp_allowlist
Apparently there's some special case-code in package manager that
scans apps as privileged regardless of their location. BT is one
such app -- so allow it to specify a privapp allowlist even though
it isn't in priv-app.

Bug: 284500052
Test: use privapp_allowlist in Bluetooth and its overriddes
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:a91268a690e2aa98a0fa7b376a948a48f41b1265)
Merged-In: Ib9ac86ebc45087a176100fe8df07db7bf81a85a7
Change-Id: Ib9ac86ebc45087a176100fe8df07db7bf81a85a7
2023-06-03 08:53:47 +00:00
Jiakai Zhang
48203e3dee Add an allowlist for modules that have broken optional_uses_libs.
Bug: 282877248
Test: m nothing
Change-Id: I1afe9d523af0633f0428d4c15e1417db1dae4e93
2023-06-02 23:42:53 +01:00
Jiakai Zhang
f508c252bb Merge "Drop INTERNAL_PLATFORM_MISSING_USES_LIBRARIES." 2023-06-02 14:59:10 +00:00
Mark
f736b924db Add use_platform_libs to fuzz config
BUG: b/279082026
TEST: mma <java_fuzz>
Change-Id: Ia3dba44f66ec18d1076f1b13cc654a35b31c02d4
WANT_LGTM=ccross
2023-06-02 14:46:53 +00:00
Treehugger Robot
b25cbb3449 Merge "Support test runnner option in auto generated test configs" 2023-06-02 11:20:23 +00:00
Anton Hansson
672c1467d5 Merge "Change install name of privapp allowlists" 2023-06-02 08:19:21 +00:00
Anton Hansson
0e486a4198 Change install name of privapp allowlists
Use the APK's filename as the on-device filename for the allowlist.
Previously the filename of the source xml file was used, which leads to
a problem when the same source file is used for different apps (even
if only one of those modules ends up being installed).

Bug: 284500052
Test: app_test.go & presubmit boot tests
Change-Id: I0b43a35e3a310464d79d7f37e0900d639f4a479c
2023-06-02 08:18:42 +00:00
Zi Wang
4af4ff33f0 Merge "Add simple bp2build converter for java_test_host" 2023-06-01 22:37:28 +00:00
Paul Duffin
f6b1e23448 Merge "Explicitly specify --api-overloaded-method-order source for metalava" 2023-06-01 22:10:24 +00:00
Spandan Das
370f13c3bd bp2build for java libraries using xsd_config srcs
In Soong, java libraries can use src files generated from xsd_config. In
Bazel, instead of providing srcs, java_xsd_config_library will provide a
jar. Update bp2build so that all src references to xsd_config modules in
srcs get routed to deps and exports attributes

This CL creates an interface in build/soong/android to get around a
circular dependency issue. The bp2build logic needs to exist in
soong-java, but soong-java does have soong-xsdc in its package path. Use
the interface and type assertions to special case xsd_config references

Bug: 211678537
Test: bp2build test in sibling CL in system/tools/xsdc
Change-Id: Ida924bb20b1fd7eb8beeef950b070d37a9c6f3b5
2023-06-01 19:12:12 +00:00
Treehugger Robot
f618c60df6 Merge "Only pass "-Xgc:CMC" when building for Android." 2023-06-01 17:59:45 +00:00
Paul Duffin
7202ffebf9 Explicitly specify --api-overloaded-method-order source for metalava
Previously, `--api-overloaded-method-order source` was the default if
that option was not specified but the other change in this topic is
switching it to `--api-overloaded-method-order signature` to match the
behavior in AndroidX. This change explicitly specifies the option
needed by Soong's use of metalava.

Bug: 285140653
Test: m checkapi
Change-Id: I00e049e0d991e650ab9940a3d495ed2b6e7480f8
2023-06-01 18:45:51 +01:00
Zi Wang
65b36729c3 Add simple bp2build converter for java_test_host
Bug:281551424

Test: java_test_host_conversion_test.go and presubmits
Change-Id: I43ed26df0bacd63ef402de4d9733d19604005c35
2023-06-01 10:37:09 -07:00
Paul Duffin
5b7035f850 Explicitly specify --api-class-resolution api for metalava
Previously, `--api-class-resolution api` was the default if that option
was not specified but the other change in this topic is switching it to
`--api-class-resolution api:classpath` to match the behavior in
AndroidX. This change explicitly specifies the option needed by Soong's
use of metalava.

Bug: 285140653
Test: m checkapi
Change-Id: Ief3c7f9dfdfa946f21cb048a579ec90309fb350f
2023-06-01 15:26:40 +01:00
Jiakai Zhang
4f65a03d30 Drop INTERNAL_PLATFORM_MISSING_USES_LIBRARIES.
Bug: 282877248
Test: Presubmit build tests.
Change-Id: Idd69433f308f5f47973ff0d5340a2399a27cb32c
2023-06-01 15:21:42 +01:00
Jiakai Zhang
225c4767ac Only pass "-Xgc:CMC" when building for Android.
The runtime always uses CC on host unless CMC is explicitly asked
(http://cs/android-internal/art/runtime/gc/collector/mark_compact.cc;l=212-214;rcl=50fe05b4f4650bc0888d2c218a1bfa476f811ea0).
This CL matches the build system behavior with the runtime.

Bug: 285228269
Test: m test-art-host-gtest-art_dex2oat_tests
Change-Id: I652ad6f754ab8c51283e5fb0e9e1ba644629fa11
2023-06-01 13:27:25 +00:00
Jiakai Zhang
5324cc84ad Merge "Move CLC construction to Ninja phase." 2023-05-30 14:58:15 +00:00
Jiakai Zhang
a449678996 Move CLC construction to Ninja phase.
Before this change, dexpreopt was often broken with optional libraries.
This was because the CLC construction was done in Soong at an early
stage, where we don't have sufficient information to determine whether
an optional library is installed or not.

For example, the "Settings" package uses an optional library called
"androidx.window.extensions". On some devices, the library is installed,
but on some other devices, it's not. Soong always adds the library to
the CLC, meaning the CLC is wrong for devices which don't have the
library. This change fixes the problem. See the tests below.

After this change, the CLC construction is done by a Python script
invoked at a very late stage. It uses product_packages.txt, which is
generated by Make, to determine whether an optional library is
installed or not, and filter out libraries that are not installed.

Note that optional libraries are still added as dependencies by Soong.
This is because dependencies have to be added at an early stage. This
means what dex2oat eventually uses will be a subset of the dependencies,
which is fine.

Bug: 282877248
Test: m
Test: atest construct_context_test
Test: -
  1. lunch aosp_cf_x86_64_phone-userdebug && m
  2. Check the .invocation file of the "Settings" package (defined in
     .bp file)
  3. See androidx.window.extensions
Test: -
  1. lunch aosp_redfin-userdebug && m
  2. Check the .invocation file of the "Settings" package (defined in
     .bp file)
  3. Don't see androidx.window.extensions
Test: Check the .invocation file of the "Dialer" package (defined in
  .mk file)
Test: -
  1. Build a Pixel 5 system image and flash it to a Pixel 5 device.
  2. adb shell pm art dump
  3. See "reason=prebuilt" instead of "reason=vdex".
     (https://diff.googleplex.com/#key=fB6Ls9q2QGSN, before: left,
     after: right)

Change-Id: Ia112bd7c2328373e68db6bffb74bf34030f683d8
2023-05-30 15:46:38 +01:00
Dan Shi
ec7314336a Support test runnner option in auto generated test configs
Bug: 284179405
Bug: 236980335
Test: unittest
Change-Id: Ifae3d556ff79153ca6c3067347fc259b665fb2e1
2023-05-26 21:34:22 +00:00
Alix Espino
e5641c51b9 Merge "bp2build java_resources that only contain a filegroup" 2023-05-26 13:59:42 +00:00
Anton Hansson
0c6ae56eea Merge "ensure that privapp_allowlist is installed before android_app" 2023-05-26 07:17:37 +00:00
Cory Barker
70b2292646 Merge "Add both classes jar and dexed jar to java_fuzz module packaged output for dist as we move towards instrumentation at runtime" 2023-05-25 23:26:28 +00:00
Jihoon Kang
de68c07ce5 Merge "Modify error emit condition for checking api files in java_api_library" 2023-05-25 21:09:40 +00:00
Sam Delmerico
b1daccdc97 ensure that privapp_allowlist is installed before android_app
AndroidMk assumes that the app is the last file installed, and it uses
this assumption to populate the LOCAL_SOONG_INSTALLED_MODULE entry. This
CL moves the privapp_allowlist installation to before the app
installation to respect this assumption.

Bug: 242509786
Test: go test
Test: OUT_DIR=out.ref m nothing &&
  cp aosp/2562351 && OUT_DIR=out.change m nothing &&
  GOWORK=$PWD/build/bazel/mkcompare/go.work \
  go run android/bazel/mkcompare/cmd -json \
  <(sed -e "s/out\.ref/out/g" out.ref/soong/Android-aosp_cheetah.mk) \
  <(sed -e "s/out\.change/out/g" out.change/soong/Android-aosp_cheetah.mk)
  && verify manually that the only diffs are related to the removal of
  the prebuilt_etc module.
Change-Id: I95ec27070f575e79fb976de68493a219717ed89a
2023-05-25 18:54:06 +00:00
Jihoon Kang
160634ca3d Modify error emit condition for checking api files in java_api_library
java_api_library currently emits error based when the
java_api_contribution module has an empty api file or when the module
does not have any api files. This may be problematic in partial
manifests where allow missing dependency is set, thus add this condition
for error emission.

Test: go test ./java
Bug: 284212875
Change-Id: I10b4baa5723e7a53d931823b3029ea20ac731911
2023-05-25 05:28:29 +00:00
Cory Barker
c29c37a2c0 Add both classes jar and dexed jar to java_fuzz module packaged output for dist as we move towards instrumentation at runtime
Test: Built locally and tested pipeline
Bug: 283993246
Change-Id: I69eb98d2b7966d77ac8819348f7b99a7b18f40b6
2023-05-24 22:53:41 +00:00
Treehugger Robot
1a608b0b0a Merge "don't require package_name for non-override android_apps" 2023-05-24 18:47:33 +00:00
Alix
b29a3cd2aa bp2build java_resources that only contain a filegroup
supports filegroup that specifies path property

Bug: 280860624
Test: built libauto_value_plugin
Change-Id: I9ed0b13e055beb92ba8090f6b5e88b9873c9ce61
2023-05-24 18:21:15 +00:00
Sam Delmerico
15809f8101 don't require package_name for non-override android_apps
For a non-override android_app, we can assume that the privapp_allowlist
already contains the correct package_name, and so we don't need to
overwrite it in this case.

Bug: 242509786
Test: go test
Merged-In: I0f137e34cae3478dc8b9178d138121ff1d936f07
Change-Id: I0f137e34cae3478dc8b9178d138121ff1d936f07
2023-05-24 11:09:31 -04:00
Kun Niu
50533df497 Merge "data_native_bins is only available in java_test_host, add java_test_host properties to java_defaults to make it's available in java_defaults as well." 2023-05-23 22:35:40 +00:00
Treehugger Robot
8d3df9beeb Merge "Increase R8 max heap size to 4GB" 2023-05-23 21:21:53 +00:00
Kun Niu
bd0fd20bdc data_native_bins is only available in java_test_host, add java_test_host properties to java_defaults to make it's available in java_defaults as well.
Test: local build
Bug: 279622634
Change-Id: Iceaf960d587544ae934424a773a6ae3b17fb443e
2023-05-23 17:54:16 +00:00
Jared Duke
3e65f2a53c Increase R8 max heap size to 4GB
The size was increased for D8 in an earlier change, but is more
critical for R8. Match the D8 configuration.

Bug: 241220562,283888124
Test: m
Change-Id: I3b98bf6098f2196c87a97f6c8f7308d9299170d8
2023-05-23 17:32:30 +00:00
Jihoon Kang
4aed3703dd Merge changes Idc77d018,I7dff0094
* changes:
  Enable java_api_library modules in TxtStubLibraries.bp
  Add missing dependency in create_mock_soong
2023-05-23 11:26:53 +00:00
Jihoon Kang
b34bb06780 Enable java_api_library modules in TxtStubLibraries.bp
Since the stubs generation from text file feature has been merged,
enable the java_api_library modules in TxtStubLibraries.bp file.

Test: m --build-from-text-stub
Change-Id: Idc77d01882f136c4e255fb4284f9dc058fafe44d
2023-05-23 07:32:04 +00:00
Treehugger Robot
47514686b9 Merge changes from topic "parallel-singletons"
* changes:
  Parallelize singleton execution
  android: Allow running some singletons in parallel.
2023-05-22 16:40:16 +00:00
Jihoon Kang
7e9e20e389 Fix bootclasspath_fragment build failure during from-text stub build
This change enables bootclasspath_fragment module to be correctly built
during from-text stub build by android-non-updatable module to be
interpreted as its java_api_library equivalent.

Test: go test ./java
Bug: 279460171
Change-Id: Ia6b60edcb60782977cc59855f1cf5d3a46e9f682
2023-05-22 07:13:25 +00:00
Jihoon Kang
d0f9520414 Add additional java_api_library testing modules
This change adds android-non-updatable.stub.* java_api_library
modules to java testing.

Test: none
Change-Id: I10110a21cc61905995803dfc1d27484358019807
2023-05-22 07:13:07 +00:00
Jihoon Kang
d056a91b82 Merge "Generate java_api_library from java_sdk_library" 2023-05-20 05:10:11 +00:00
Treehugger Robot
7fecde9041 Merge "Enable referencing of aapt-generated proguard flags" 2023-05-20 04:13:57 +00:00
Treehugger Robot
36f3ed1191 Merge "Support missing instrumented_for dependency when ALLOW_MISSING_DEPENDENCIES=true" 2023-05-19 21:12:27 +00:00
LaMont Jones
0c10e4dcc0 Parallelize singleton execution
Bug: 281536768
Test: manual, presubmits
Change-Id: I57fdc76ba6b277e88e196b506af87127a530fd37
2023-05-19 20:31:32 +00:00