Commit Graph

5250 Commits

Author SHA1 Message Date
Paul Duffin
cc7fc33e20 Merge "Build updatable-bcp-packages.txt from prebuilts in sdk snapshot" am: d2a23518b4 am: 3caa3a02ee
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1768127

Change-Id: I0f1bd5d1a6d53d12f9af41b46af3453af24c0591
2021-07-15 15:23:27 +00:00
Paul Duffin
2be643b605 Merge "Propagate permitted packages to sdk snapshot" am: 81d56dcd3f am: fcbeaa37a8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1768128

Change-Id: I71487b6536f93a0dbbf121ff45f5737858f3d373
2021-07-15 15:23:17 +00:00
Paul Duffin
d2a23518b4 Merge "Build updatable-bcp-packages.txt from prebuilts in sdk snapshot" 2021-07-15 14:58:12 +00:00
Paul Duffin
81d56dcd3f Merge "Propagate permitted packages to sdk snapshot" 2021-07-15 14:58:03 +00:00
satayev
4619a2bdd5 Merge "Update a comment about PRODUCT_UPDATABLE_BOOT_JARS." am: 1180b1fc4a am: 8ed574e839
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1768126

Change-Id: I3b36e57d068a35902c256bf84b3150f435031103
2021-07-15 14:33:25 +00:00
Paul Duffin
630b11e9d4 Build updatable-bcp-packages.txt from prebuilts in sdk snapshot
Previously, the java_import and java_sdk_library_import modules did not
make their permitted_packages available to the rule that generates the
updatable-bcp-packages.txt file. This change corrects that.

Bug: 193763688
Test: m nothing
      - Added unit tests, which all failed and then fixed the tests.
Change-Id: If0706e4551a331b48d383123088e63924dded48b
2021-07-15 14:16:44 +01:00
Paul Duffin
869de147ab Propagate permitted packages to sdk snapshot
Previously, permitted_packages were not copied to the sdk snapshot.
This change corrects that.

Bug: 193763688
Test: m nothing
      - Added unit tests, which all failed and then fixed the tests.
Change-Id: I4560987f746f78c0ae706058195b6db4bea438aa
2021-07-15 14:15:58 +01:00
satayev
f208a5766e Update a comment about PRODUCT_UPDATABLE_BOOT_JARS.
Bug: 191127295
Test: n/a
Change-Id: I3d8e8689a79be79714b01cfd8abac34e7d963aee
2021-07-15 13:22:31 +01:00
Ulyana Trafimovich
732d7c431a Merge "Drop strings.HasPrefix when guarding strings.TrimPrefix." am: 7beb099546 am: cdaf15d04f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1765983

Change-Id: Ie6342e568e443a13eb840afb218dbb5a3931467d
2021-07-15 10:50:16 +00:00
Ulyana Trafimovich
7beb099546 Merge "Drop strings.HasPrefix when guarding strings.TrimPrefix." 2021-07-15 10:15:26 +00:00
Treehugger Robot
a5d5782e39 Merge "dexpreopt.config should be created even though unbundled image is built" am: 75d719fdd7 am: 1bc89a7af1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1730112

Change-Id: I4e91d1b293e84c69f032e148931357e2a050e10f
2021-07-15 09:28:40 +00:00
Ulya Trafimovich
497a09310b Drop strings.HasPrefix when guarding strings.TrimPrefix.
There is no need to check as `TrimPrefix` does nothing if the prefix
doesn't match (see https://pkg.go.dev/strings#TrimPrefix).

Bug: 193425964
Test: m nothing
Change-Id: Ieb82e72a471800e29eb6bb54308041a9ab4173e5
2021-07-15 08:30:27 +01:00
Jeongik Cha
4b073cd083 dexpreopt.config should be created even though unbundled image is built
Bug: 188179858
Test: compare dexpreopt_config.zip files from
 1. TARGET_BUILD_UNBUNDLED_IMAGE=true m dexpreopt_config_zip
 2. m dexpreopt_config_zip
(note that m clean should run between steps)

Change-Id: I36a6e8b10b9922cc5522accaf90af1aa05049a86
2021-07-15 09:57:49 +09:00
Treehugger Robot
4c72f68962 Merge "SdkLibraryImport's DexJarInstallPath uses installPath from source module" am: 257608f993 am: 64614bbcff
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1758354

Change-Id: Ibd345e6d76706c54d5cfb0799d80f5d107332f78
2021-07-14 01:21:18 +00:00
Jeongik Cha
d5fe8782e0 SdkLibraryImport's DexJarInstallPath uses installPath from source module
Even though actual installed module path is the same as source module,
it uses impl's one.

Bug: 188179858
Bug: 193082464
Test: compare dexpreopt_config.zip files from
  1. TARGET_BUILD_UNBUNDLED_IMAGE=true m dexpreopt_config_zip
  2. m dexpreopt_config_zip
  (note that m clean should run between steps)
Test: build aosp_cf_x86_64_phone,  launch_cvd, and then
  adb wait-for-device \
      && adb root \
      && adb logcat \
      | grep -E 'ClassLoaderContext [a-z ]+ mismatch' -C 1
      and then check if there is no message.

Change-Id: I34ffd9a2d214a6614c2befc35b2beec003cfcd25
2021-07-13 13:54:03 +00:00
Pedro Loureiro
49e0e81155 Merge "make system server modules use filtered lint database" 2021-07-13 08:55:13 +00:00
Paul Duffin
cb049b6791 Move modules containing ART, conscrypt and i18n from libcore am: bb360c32b6 am: 9e36fa0eda
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1762226

Change-Id: I1c4579886602978ebc718a9a1ba36ad161d98697
2021-07-12 12:30:11 +00:00
Paul Duffin
bb360c32b6 Move modules containing ART, conscrypt and i18n from libcore
This change moves the definitions of the following libraries which
directly include ART, conscrypt and i18n stubs, and their associated
java_system_modules from libcore to build/soong/java/core-libraries.
* core.current.stubs
* core-current-stubs-system-modules
* core.module_lib.stubs
* core-module-lib-stubs-system-modules
* legacy.core.platform.api.stubs
* legacy-core-platform-api-stubs-system-modules
* stable.core.platform.api.stubs
* stable-core-platform-api-stubs-system-modules

Bug: 193311122
Test: m droid
Change-Id: I42c4a0b5322897d40ecf41de088152dbdc526c96
2021-07-12 10:10:42 +01:00
Paul Duffin
b68c4c0b49 Generate boot images for host from prebuilts am: a56be7d781 am: 9dfd930cf7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1757170

Change-Id: I2d343d227edb0b5138537f1fc3d36c4806340d51
2021-07-06 15:28:37 +00:00
Paul Duffin
688efcdbde Switch boot image generation to use GetGlobalSoongConfig(ctx) am: 8fc51a8eb6 am: 371276f582
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1757169

Change-Id: Ia5c95bfaf3a77614e15c1c5221826ed4c3d8abd8
2021-07-06 15:09:01 +00:00
Paul Duffin
a56be7d781 Generate boot images for host from prebuilts
Previously, when building from prebuilts boot no rules were created to
produce the boot image files for the host, i.e. the OS on which the
build was running. That caused problems with checkbuilds. No rules were
produced as there was no host variant of a prebuilt apex to provide
them.

This change restructures the code to allow the prebuilt bootclasspath
fragment to build the host variants of the files from the dex files
provided by the prebuilt APEX. The generated files will not be the same
as they would be if built from source as there is no boot image profile
to use but it should be sufficient to satisfy the checkbuild target and
allow for host side testing.

Bug: 192575099
Test: m SOONG_CONFIG_art_module_source_build=false droid dist checkbuild
Change-Id: I6af00f19bb71aa18dd462f5eac6aa38e3e721023
2021-07-06 13:45:46 +01:00
Paul Duffin
8fc51a8eb6 Switch boot image generation to use GetGlobalSoongConfig(ctx)
Previously, boot image generation used GetCachedGlobalSoongConfig(ctx)
in order to get access to the GlobalSoongConfig. That required that
some other part of the code had called GetGlobalSoongConfig(ctx) to
initialize the cached value. That was left over from when the boot
image generation was done in a singleton which could not call
GetGlobalSoongConfig(ctx) directly. That is no longer true.

This change switches the uses of GetCachedGlobalSoongConfig(ctx) to
GetGlobalSoongConfig(ctx) and removes the now unnecessary call to
GetGlobalSoongConfig(ctx) from outside the functions.

Bug: 192575099
Test: m nothing
Change-Id: I34b7b1526d072d8b09fda7caa96e381695888e16
2021-07-06 12:51:04 +01:00
Pedro Loureiro
ffb643fc18 make system server modules use filtered lint database
Bug: 188851704
Test: m
Change-Id: Ie8f63286aeeb4cdbec5b9320c2ba41c8e37c7345
Merged-In: Ie8f63286aeeb4cdbec5b9320c2ba41c8e37c7345
2021-07-05 16:57:34 +00:00
Pedro Loureiro
2f58789d65 make system server modules use filtered lint database am: 7609182dda
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15208490

Change-Id: I4c93b1a85206124c7fd282e35904d5c55b7d0d59
2021-07-05 16:50:55 +00:00
Pedro Loureiro
7609182dda make system server modules use filtered lint database
Bug: 188851704
Test: m
Change-Id: Ie8f63286aeeb4cdbec5b9320c2ba41c8e37c7345
2021-07-05 14:01:49 +00:00
Paul Duffin
7ecb331fd3 Merge "Generate boot zip file from prebuilt_bootclasspath_fragment" am: 452decbd88 am: 019e278025
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1753271

Change-Id: I969dde3851899374bd466c9a0e5263f0fe6d12c8
2021-07-05 12:27:08 +00:00
Paul Duffin
452decbd88 Merge "Generate boot zip file from prebuilt_bootclasspath_fragment" 2021-07-05 12:01:46 +00:00
Paul Duffin
59480e327e Merge "Use both module name and stem name to filter updatable boot jars" am: 276fd424ad am: 31620af91d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1748051

Change-Id: Ib0f336f1ee599d2cb8ed03af3caec2fb953a4878
2021-07-02 21:17:38 +00:00
Paul Duffin
276fd424ad Merge "Use both module name and stem name to filter updatable boot jars" 2021-07-02 20:41:07 +00:00
Paul Duffin
791604ff6c Retry: Make bootclasspath_fragments always perform hidden API processing am: dad8880399
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15175112

Change-Id: I73d61880403062eaec056e003a9b4f3b2495b73f
2021-07-02 08:59:15 +00:00
Paul Duffin
56afb27fb0 Generate boot zip file from prebuilt_bootclasspath_fragment
Previously, the boot zip file, containing all the boot image files for
all the supported architectures, was only created from source. It was
not created when building from a prebuilt_bootclasspath_fragment. That
lead to build failures when building from ART prebuilts.

This change pulls the boot zip file creation out so that it can be done
for both source and prebuilt bootclasspath_fragment modules as well as
for the platform_bootclasspath module.

Bug: 192575099
Test: m out/target/product/generic_arm64/boot.zip
      m SOONG_CONFIG_art_module_source_build=false out/target/product/generic_arm64/boot.zip
      - Compare the output of the first command from before the change
        with the output from them both after and confirm that when the
        ART prebuilts are up to date with the source that there are no
        differences.
Change-Id: Ie7dd5e2ca4a865d06fd9ebf87320cf68c4d05bc3
2021-07-01 22:17:49 +01:00
satayev
4efc42d57f Merge "Use system stubs for framework-doc-system-stubs." am: 8e3356f610 am: 015ca2f4b9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1745338

Change-Id: Ieca85003da032ab1fc0ebac10e2fd59bdb8cd0f9
2021-07-01 17:49:54 +00:00
satayev
8e3356f610 Merge "Use system stubs for framework-doc-system-stubs." 2021-07-01 17:21:36 +00:00
Paul Duffin
dad8880399 Retry: Make bootclasspath_fragments always perform hidden API processing
Previously, bootclasspath_fragment modules would only perform hidden
API processing if they provided some stub libraries and fragments. That
was needed because the bootclasspath_fragment modules were added before
Soong supported hidden API processing on all the different modules and
before they all provided the necessary information that hidden API
processing required.

This change stops hidden API being conditional as it is no longer
required as it has been enabled on all existing bootclasspath_fragment
modules.

Bug: 179354495
Test: m nothing
Change-Id: Ibf81a7de63b888a3ebf445528326fa6101fdb1ba
2021-07-01 17:22:50 +01:00
Paul Duffin
886060a688 Defer error reporting of missing prebuilt dex jar files
Unless the prebuilt dex jar files are explicitly required to build
system images or dex preopting defer reporting of any missing dex boot
jars from Soong to Ninja.

This will prevent builds that contain prebuilt sdks, containing prebuilt
bootclasspath_fragment modules but without a corresponding apex_set or
prebuilt_apex module from failing even when it is not building against
the prebuilt sdk.

Bug: 179354495
Test: m nothing
Merged-In: Ibde3bf840a7413785cd32bd6cea1c322f90c59af
Change-Id: Ibde3bf840a7413785cd32bd6cea1c322f90c59af
(cherry picked from commit ef083c9556)
2021-07-01 17:20:53 +01:00
Paul Duffin
cc82eab6bb Merge "Revert "Make bootclasspath_fragments always perform hidden API processing"" into sc-dev am: fb5229b3bc
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15175110

Change-Id: I5ac37d22100a88c205d068daecaacc2829280119
2021-07-01 16:03:02 +00:00
Orion Hodson
e6e499b3eb Merge "Support using java_sdk_library components in stub_libs" into sc-dev 2021-07-01 15:54:10 +00:00
Paul Duffin
fb5229b3bc Merge "Revert "Make bootclasspath_fragments always perform hidden API processing"" into sc-dev 2021-07-01 15:47:24 +00:00
Paul Duffin
71e98fa303 Revert "Make bootclasspath_fragments always perform hidden API processing"
This reverts commit 2b255d7f6b.

Reason for revert: build breakage http://b/192554546

Bug: 179354495
Change-Id: Id758af3f59bc83b02d8af4b1b83b3f279a208595
2021-07-01 15:27:27 +00:00
Paul Duffin
9f2a02741b Merge "Make bootclasspath_fragments always perform hidden API processing" into sc-dev am: f4a65fee98
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15171637

Change-Id: I9aedbf6f53cdff3ef80692b65e8e22f4884b09b8
2021-07-01 14:36:53 +00:00
Paul Duffin
f4a65fee98 Merge "Make bootclasspath_fragments always perform hidden API processing" into sc-dev 2021-07-01 14:20:41 +00:00
Orion Hodson
a8ea2833a2 Merge ""module_current" and "system_server_current" should contain ART's @SystemApi(MODULE_LIBRARIES)" into sc-dev 2021-07-01 13:48:57 +00:00
Paul Duffin
b5e4a38f2f Ensure that systemserverclasspath_fragment does not depend on prebuilts am: ba96f7c5b6
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15171640

Change-Id: Ia35d288312380dab42988db13f87a11fdfd16f5d
2021-07-01 13:27:44 +00:00
Paul Duffin
5842387832 Support using java_sdk_library components in stub_libs
Previously, if a bootclasspath_fragment had both a java_sdk_library
module and one of its components in stub_libs properties they would be
treated as separate modules instead of simply different APIs from the
same module. That would result in them both providing stub dex jars to
"hiddenapi list" which would fail because it found duplicate
definitions of the same class.

e.g. Specifying something like this:
    api: {
        stub_libs: [
            "art.module.public.api",
        ],
    },
    core_platform_api: {
        stub_libs: [
            "art.module.public.api.stubs.module_lib",
        ],
    },

would cause "hiddenapi list" to fail because it would have been passed
paths to two dex jars (actually the same dex jar but that does not
matter) each of which defined the same class, e.g. java.lang.Object.

This change treats the "art.module.public.api.stubs.module_lib" and
"art.module.public.api" modules as being the same for the purposes of
hidden API processing.

(cherry picked from commit 3f0290ef79)

Bug: 192446466
Test: m nothing
Merged-In: I9de96337f64f26e24cff040d4bbed9eecc67b1ed
Change-Id: I9e1cb82bea96022faaec98edc0c9ea7eac6204b0
2021-07-01 14:27:42 +01:00
Paul Duffin
746ce447c5 Merge "Defer error reporting of missing prebuilt dex jar files" am: 4b51e27046 am: 032a126e75
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1751341

Change-Id: I1b864cce2c30e682808834aec53448a0b6cd484f
2021-07-01 11:24:19 +00:00
Paul Duffin
ba96f7c5b6 Ensure that systemserverclasspath_fragment does not depend on prebuilts
Bug: 190037398
Test: m nothing
Change-Id: I85671613c70bbfe8adde1d24d7f59ed7b53a8120
2021-07-01 12:24:12 +01:00
Paul Duffin
2b255d7f6b Make bootclasspath_fragments always perform hidden API processing
Previously, bootclasspath_fragment modules would only perform hidden
API processing if they provided some stub libraries and fragments. That
was needed because the bootclasspath_fragment modules were added before
Soong supported hidden API processing on all the different modules and
before they all provided the necessary information that hidden API
processing required.

This change stops hidden API being conditional as it is no longer
required as it has been enabled on all existing bootclasspath_fragment
modules.

Bug: 179354495
Test: m nothing
Change-Id: I0cbf11986adff1f2f967b96f86e6bfe0e9b8b1ef
2021-07-01 11:56:41 +01:00
Paul Duffin
4b51e27046 Merge "Defer error reporting of missing prebuilt dex jar files" 2021-07-01 10:55:16 +00:00
Orion Hodson
7be1ef9502 Merge ""module_current" and "system_server_current" should contain ART's @SystemApi(MODULE_LIBRARIES)" am: 39924233e0 am: 472603d46f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1748050

Change-Id: I7c699d6a1b6f7a4f093ca953dab5f161b377093d
2021-07-01 10:08:12 +00:00
Victor Chang
2d457e1cc8 "module_current" and "system_server_current" should contain ART's @SystemApi(MODULE_LIBRARIES)
Before this fix, compiling a java_library against sdk_version:
"module_current" can't use the @SystemApi(MODULE_LIBRARIES) provided
by the ART module because the system module "core-current-stubs-system-modules"
contains only the public APIs.

Use the new system module with module lib APIs.

(cherry picked from commit b54f5aa359)

Bug: 183097033
Test: m droid
Merged-In: I274e2710d1ff34e896aa620bfafb4481180c53b5
Change-Id: I374bc4899ef8f60344e37a94ad3cb8492f47fb4d
2021-07-01 10:57:26 +01:00