Commit Graph

43189 Commits

Author SHA1 Message Date
Chang Li 66d3cb727f Allowlist external/libtextclassifier for sdk_variant_only.
Bug: 166040889
Change-Id: If8a9d916dada116f52fd84194fa42e9179526b2c
2021-07-22 09:42:33 +00:00
Android Build Coastguard Worker 18dce2125d Snap for 7552724 from 1a8bb48592 to sc-d2-release
Change-Id: If61ae53e22232cc1daa593de407125ba48a6eb20
2021-07-16 01:00:47 +00:00
Paul Duffin 1a8bb48592 Propagate permitted packages to sdk snapshot am: 7b3e10a1c2
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15300390

Change-Id: Ib2b7f65b363962e9190e135f319ba884deca4997
2021-07-15 16:32:41 +00:00
Paul Duffin 7b3e10a1c2 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.
Merged-In: I4560987f746f78c0ae706058195b6db4bea438aa
Change-Id: I4560987f746f78c0ae706058195b6db4bea438aa
(cherry picked from commit 869de147abdb2c86a91cced4fda7d27746c52af4)
2021-07-15 16:00:11 +01:00
Ulya Trafimovich cb416397a4 Drop "prebuilt_" prefix when adding libraries to class loader context. am: fa20b187dc
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15296451

Change-Id: I49b10389dac5cb085d6e5ed16643be3526f24d4f
2021-07-15 11:15:52 +00:00
Ulya Trafimovich fa20b187dc Drop "prebuilt_" prefix when adding libraries to class loader context.
This is needed when some source libraries get replaced with prebuilt
variants: CLC should contain one entry for a library (the prebuilt one
or the source one, whichever of them is preferred). Because the prebuilt
module name starts with "prebuilt_" prefix, previously Soong considered
such libraries as two different ones libraries and added both to CLC.

Bug: 193425964

Test: mark "prebuilt_android.net.ipsec.ike" as preferred and `m nothing`
      (before this CL it would fail the build, now it builds fine).

Test: $ lunch aosp_cf_x86_64_phone-userdebug && m && launch_cvd
      $ adb wait-for-device && \
        adb root && \
        adb logcat | \
        grep -E 'ClassLoaderContext [a-z ]+ mismatch' -C 1
      # empty output, no errors
Change-Id: Icc42533d9915060d7fffda12aa93b9d18dc4f83d
Merged-In: Icc42533d9915060d7fffda12aa93b9d18dc4f83d
(cherry picked from commit 69c1aa94ac88bcb07f32c2ae4217776e82903068)
2021-07-15 11:17:24 +01:00
Android Build Coastguard Worker e4c9721dae Snap for 7542869 from 663d5a74d0 to sc-d2-release
Change-Id: I6ffaaa70db410043b53ac96526e41ef9fa16d2aa
2021-07-13 01:00:55 +00:00
Martin Stjernholm 663d5a74d0 Merge "Do not allow duplicate deapexer dependencies." into sc-dev am: 8410eb1551
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15156931

Change-Id: Ifa13bc41cf84eca11214d374925eac03b8c453db
2021-07-12 09:15:17 +00:00
Martin Stjernholm 8410eb1551 Merge "Do not allow duplicate deapexer dependencies." into sc-dev 2021-07-12 09:01:43 +00:00
Android Build Coastguard Worker aeee7b5e2c Snap for 7529132 from d0687fd6a4 to sc-d2-release
Change-Id: I81520e3b8b9a32ac70eb0e83607fe81d33aa9feb
2021-07-08 01:01:53 +00:00
Paul Duffin d0687fd6a4 Merge "Generate boot images for host from prebuilts" into sc-dev am: d507060257
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15216505

Change-Id: I100fec6a236b48b15bae16ad3e6c5cccb42ffbce
2021-07-07 09:17:43 +00:00
Paul Duffin 103c8a760c Merge "Switch boot image generation to use GetGlobalSoongConfig(ctx)" into sc-dev am: 4ca4800023
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15217814

Change-Id: If3ac410611a6043feab3809706145a96af156ca7
2021-07-07 09:17:31 +00:00
Paul Duffin d507060257 Merge "Generate boot images for host from prebuilts" into sc-dev 2021-07-07 09:02:20 +00:00
Paul Duffin 4ca4800023 Merge "Switch boot image generation to use GetGlobalSoongConfig(ctx)" into sc-dev 2021-07-07 09:02:13 +00:00
TreeHugger Robot 17a8e769af Merge changes from topic "revert-15071196-init_first_stage_soong-GBJXQRPEKC" into sc-dev am: 0618d4e9ec
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15167733

Change-Id: I3a16693b3da64bba6ba5938969bc0200b0ff6dac
2021-07-07 03:24:16 +00:00
Inseob Kim 4d716ddbfd Revert "Add ramdisk_available to sysprop_library" am: 2594e41a07
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15167732

Change-Id: I71b64e3da089799a0627645ef39d75b3b2688d23
2021-07-07 03:24:08 +00:00
Inseob Kim af2bfec7ec Revert "Fix ndk and aml arch order" am: f64377ca2f
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15167731

Change-Id: Ia3fc37e9c594ba4d7611f5ca181bc0d25f69e0ab
2021-07-07 03:24:02 +00:00
TreeHugger Robot 0618d4e9ec Merge changes from topic "revert-15071196-init_first_stage_soong-GBJXQRPEKC" into sc-dev
* changes:
  Revert "Add install_in_root to cc_binary"
  Revert "Add ramdisk_available to sysprop_library"
  Revert "Fix ndk and aml arch order"
2021-07-07 03:02:00 +00:00
Android Build Coastguard Worker 8bb6b2d303 Snap for 7526832 from b2e0dfd8e0 to sc-d2-release
Change-Id: I077ed80712fc37ebb65be7be29c600f503ceaec2
2021-07-07 01:00:53 +00:00
Paul Duffin 6e89b54780 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
Merged-In: I6af00f19bb71aa18dd462f5eac6aa38e3e721023
Change-Id: I6af00f19bb71aa18dd462f5eac6aa38e3e721023
(cherry picked from commit a56be7d7815ad164cdd854f8fc6b1cbc3bbf1918)
2021-07-06 22:20:24 +01:00
Paul Duffin d564c32818 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
Merged-In: I34b7b1526d072d8b09fda7caa96e381695888e16
Change-Id: I34b7b1526d072d8b09fda7caa96e381695888e16
(cherry picked from commit 8fc51a8eb6ca20dbb4b65822123201568bb297f1)
2021-07-06 22:20:24 +01:00
Paul Duffin b2e0dfd8e0 Generate boot zip file from prebuilt_bootclasspath_fragment am: bb2e205603
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15215491

Change-Id: I3ee3004f9cce95094823158acb5ca2470620fe60
2021-07-06 19:05:29 +00:00
Paul Duffin 141e562e6a Use both module name and stem name to filter updatable boot jars am: aba5275676
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15215490

Change-Id: I81d777d596e10565f68ea220a533ce7d27c71d38
2021-07-06 17:40:57 +00:00
Paul Duffin bb2e205603 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.
Merged-In: Ie7dd5e2ca4a865d06fd9ebf87320cf68c4d05bc3
Change-Id: Ie7dd5e2ca4a865d06fd9ebf87320cf68c4d05bc3
(cherry picked from commit 56afb27fb099cb79c1537c661628db1776f1fcc3)
2021-07-06 13:34:26 +01:00
Paul Duffin aba5275676 Use both module name and stem name to filter updatable boot jars
Sometimes the stem property is set to change both the installed file
name and the name use to filter the configured module list, e.g. when
adding a test library to replace the standard library, e.g. test_foo
instead of foo.

Sometimes it is used just to change the installed file name.

This change uses both to filter the updatable boot jars and not just
the stem.

Bug: 180105615
Test: m nothing
Merged-In: I6c459fc3597b1e4f062bc9a4e52843305b538c5f
Change-Id: I6c459fc3597b1e4f062bc9a4e52843305b538c5f
(cherry picked from commit 56c93e899a355311463d41e988c9ba511af14278)
2021-07-06 13:34:25 +01:00
Android Build Coastguard Worker 827aef7a14 Snap for 7524653 from 7686fbcad4 to sc-d2-release
Change-Id: Ib9fdac5c5d2b5c5ffb6741e74890775c6e2f2150
2021-07-06 01:00:43 +00:00
Pedro Loureiro 7686fbcad4 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: I6b772234a148f63ffecef7e0cdd8f971cfc4735f
2021-07-05 16:51:50 +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
Android Build Coastguard Worker 52c593803b Snap for 7518237 from 270a9a4c21 to sc-d2-release
Change-Id: I99e258036797768c032a0c8b5ca57da0fa09bd89
2021-07-03 01:00:29 +00:00
Paul Duffin 270a9a4c21 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: Id5e7ec44f9ad884b46384157544824cdd9beaa7a
2021-07-02 09:00:11 +00:00
Paul Duffin 240460954b Defer error reporting of missing prebuilt dex jar files am: 886060a688
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15175111

Change-Id: I4a1fa524ee8ab75d72443a5cb7c437af4e9d744f
2021-07-02 09:00:06 +00:00
Android Build Coastguard Worker e24e43a35d Snap for 7513903 from 8d45d5cf0d to sc-d2-release
Change-Id: Iffcc901a4a349c0fd0b9804b3c0698843275e0fd
2021-07-02 01:01:13 +00:00
Martin Stjernholm 95994067b1 Do not allow duplicate deapexer dependencies.
Without these errors, the last encountered deapexer would silently be
used, and we wouldn't know if it was taken from the prebuilt APEX that
actually get installed in the system image.

With this error check there may be only one enabled prebuilt_apex or
apex_set for each apex_name (which defaults to the module name). E.g.
if there are both prebuilt com.android.foo and com.google.android.foo,
it is necessary to disable one of them in the .bp file.

Merged-In is set from https://r.android.com/1745454, a change that has
gone into AOSP and internal master, as well as sc-dev-plus-aosp, but
specifically not sc-dev. This change cannot merge into sc-dev-plus-aosp
and others, because they may or may not have the com.google.android.art
prebuilt APEX present depending on manifest, and with this check
exactly one of com.android.art and com.google.android.art prebuilts has
to be present and enabled. It'll be cherry-picked to AOSP along with a
full fix for b/192006406, when it can be safely enabled everywhere.

Test: m nothing SOONG_CONFIG_art_module_source_build=false
Test: m nothing SOONG_CONFIG_art_module_source_build=true
Test: m nothing
  with enabled:true for the com.android.art prebuilt APEX - check that
  it fails with an "ambiguous duplicate deapexer" error
Bug: 192006406
Bug: 192542393
Change-Id: I44566fd26b12f82a8a67fe4a69e56303460756d0
Merged-In: Id2410b4e38a78ec2146a42298840954381a7c472
2021-07-02 00:31:01 +01: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 ef083c9556c53738e5d7a3ab791c49ef00501f73)
2021-07-01 17:20:53 +01:00
Orion Hodson 8d45d5cf0d Merge "Support using java_sdk_library components in stub_libs" into sc-dev am: e6e499b3eb
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15162578

Change-Id: If34738c5f1329579a0d5a42fec79de07c3a8ad5c
2021-07-01 16:04:21 +00:00
Paul Duffin 2bd8e86bea 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: Ia34bd11954e1a870899db1231e0c4feb5a9f53df
2021-07-01 16:03:57 +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 537f6920d5 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: Id42ff381478213de96c4790a05df40dc93e9a797
2021-07-01 14:37:48 +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 7233eb8d8b Merge ""module_current" and "system_server_current" should contain ART's @SystemApi(MODULE_LIBRARIES)" into sc-dev am: a8ea2833a2
Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/15171636

Change-Id: I6c6ff8bc0cce449d67d13ffa63772af4767afd5a
2021-07-01 14:07:31 +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 09c4763874 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: I91724dc3df7629ec66866f6c4dc3ad03db2887a9
2021-07-01 13:28:35 +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 3f0290ef7940c70a491dcbd4b57cabd8b2e753ef)

Bug: 192446466
Test: m nothing
Merged-In: I9de96337f64f26e24cff040d4bbed9eecc67b1ed
Change-Id: I9e1cb82bea96022faaec98edc0c9ea7eac6204b0
2021-07-01 14:27:42 +01: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
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 b54f5aa3599196cfed8c32d3e52e1c35b51b8473)

Bug: 183097033
Test: m droid
Merged-In: I274e2710d1ff34e896aa620bfafb4481180c53b5
Change-Id: I374bc4899ef8f60344e37a94ad3cb8492f47fb4d
2021-07-01 10:57:26 +01:00
Inseob Kim 2594e41a07 Revert "Add ramdisk_available to sysprop_library"
Revert "Add ramdisk_available to init_first_stage's deps"

Revert submission 15071196-init_first_stage_soong

Reason for revert: fixes b/192248690
Reverted Changes:
I23cf4f975:Add ramdisk_available to init_first_stage's deps
Icd98c7e24:Add ramdisk_available to init_first_stage's deps
If9da9ba16:Add ramdisk_available to init_first_stage's deps
Ibc8668029:Add ramdisk_available to init_first_stage's deps
I3b4b8c475:Add ramdisk_available to init_first_stage's deps
I59cd149e0:Completely migrate init first stage to Soong
I36d789578:Add ramdisk_available to init_first_stage's deps
I2a0daa612:Add BUILD_USES_RECOVERY_AS_BOOT to soong config
Ic76c325ce:Directly create ramdisk dirs in ramdisk image rule...
I4c5374deb:Add BOARD_BUILD_SYSTEM_ROOT_IMAGE to config vars
I8aab5faf3:Add ramdisk_available to init_first_stage's deps
I9d5a10661:Add ramdisk_available to init_first_stage's deps
Iaa2edeb4a:Add ramdisk_available to init_first_stage's deps
I7cb582ca0:Update init_first_stage
I06091d15e:Add ramdisk_available to init_first_stage's deps
I8bdb8dda3:Add ramdisk_available to init_first_stage's deps
I7436b8dd1:Add ramdisk_available to init_first_stage's deps
I39693fd86:Add ramdisk_available to init_first_stage's deps
I0a9ba90f0:Add ramdisk_available to init_first_stage's deps
Ib66b4c4ea:Add ramdisk_available to init_first_stage's deps
I31ce63d23:Add ramdisk_available to init_first_stage's deps
Icb580f97c:Add ramdisk_available to init_first_stage's deps
I044a075b7:Add ramdisk_available to init_first_stage's deps
I33164a7e7:Fix ndk and aml arch order
Ib8d92904a:Add ramdisk_available to sysprop_library
Ibc3516453:Add install_in_root to cc_binary

Change-Id: I9ac333972fcd016059ea73f48b295d7140414a50
2021-07-01 06:50:40 +00:00