Commit Graph

4783 Commits

Author SHA1 Message Date
Paul Duffin
c663ddce59 Merge "Move bootFrameworkProfileRule to platform_bootclasspath" am: 9abfff5229 am: eec196310d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686150

Change-Id: I9f240c97a1fbee88e51b127822791b0b7bf10f9e
2021-04-28 12:28:08 +00:00
Paul Duffin
466563d5c9 Merge "Automatically export bootclasspath_fragment stubs from sdk" am: 59dc69c2c7 am: 510e829ea5 am: 92659f37b3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1689068

Change-Id: Ie02075fd7521b5f1d4c10440157c0b79fa7d11f1
2021-04-28 08:07:45 +00:00
Paul Duffin
8cc2b616c1 Merge "Pass module to SdkMemberTypeDependencyTag.SdkMemberType" am: 6a77e77cf9 am: a4e28eb6ef am: ef45d2ce43
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1689067

Change-Id: If9d5acbb4aadab4d1b63693a919f1fdce754413b
2021-04-28 08:07:37 +00:00
Paul Duffin
44d1594081 Extract generateUpdatableBcpPackagesRule from updatableBcpPackagesRule
This simplifies the process of moving the updatableBcpPackagesRule to
the platform_bootclasspath by separating the gathering of the list of
updatable modules (which differs between the singleton and the
platform_bootclasspath module) from the gathering of the permitted
packages list and generation of the rule which are generally common.

Bug: 177892522
Test: lunch art_module_arm64
      m out/soong/module_arm64/dex_bootjars/updatable-bcp-packages.txt
      - make sure it is not affected by this change
Change-Id: I3cb64310f618059758a32cfe00d3745d52388e49
2021-04-28 09:03:46 +01:00
Paul Duffin
2ac45f019b Remove special handling of frameworks/base/config/boot-profile.txt
Previously, the method was run in repo manifests that did not include
the frameworks/base repository so it had to handle the file being
missing. However, now that this is being called from
platform_bootclasspath which is only defined in frameworks/base that
is no longer required.

Bug: 177892522
Test: m droid
Change-Id: I77fa5a204d1426a6be24a6f0b48e18f48f3dd908
2021-04-28 09:03:46 +01:00
Paul Duffin
ad19d3858e Move bootFrameworkProfileRule to platform_bootclasspath
Changes bootFrameworkProfileRule to use ModuleContext instead of
SingletonContext and moves the call from dexpreoptBootJar's
GenerateSingletonBuildActions method to platform_bootclasspath's
GenerateAndroidBuildActions.

Changing the context also allows the code to switch from
bootFrameworkProfileRule to GetGlobalSoongConfig.

Also extracts the shouldBuildBootImages function so it can be used by
platform_bootclasspath to preserve the existing behavior.

Bug: 177892522
Test: m droid
Change-Id: I30d3ca10be7f84348ad3aa9cc984dd15b8f6f4e9
2021-04-28 09:03:46 +01:00
Paul Duffin
92659f37b3 Merge "Automatically export bootclasspath_fragment stubs from sdk" am: 59dc69c2c7 am: 510e829ea5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1689068

Change-Id: Id0d7393cc95b38579e11769d4c9fc61036603827
2021-04-28 07:34:58 +00:00
Paul Duffin
ef45d2ce43 Merge "Pass module to SdkMemberTypeDependencyTag.SdkMemberType" am: 6a77e77cf9 am: a4e28eb6ef
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1689067

Change-Id: Ie49d51cba706e0d5c568b5e3ef3fa8f5febc2061
2021-04-28 07:34:48 +00:00
Paul Duffin
0c2e08312c Extract IsModuleInVersionedSdk
Bug: 177892522
Test: m nothing
Change-Id: I348d380a0d29abdd6a84420be52cc1b674f2a7ab
2021-04-28 00:39:52 +01:00
Paul Duffin
976b0e5bbb Automatically export bootclasspath_fragment stubs from sdk
This change makes the tag that is used to add dependencies onto stubs
from the bootclaspath_fragment module cause the dependency to be
automatically exported from the sdk. If the dependency is a
java_sdk_library then it will be as if it was added to the
java_sdk_libs property, otherwise it will be as if it was added to the
java_header_libs property instead.

Bug: 177892522
Test: m nothing
Change-Id: I97010c4342dd39415dba81a4395db7831410436e
2021-04-27 23:27:34 +01:00
Paul Duffin
eee466e439 Pass module to SdkMemberTypeDependencyTag.SdkMemberType
This change allows an SdkMemberTypeDependencyTag to select the
SdkMemberType to use to add a dependency based on the module.

Bug: 177892522
Test: m nothing
Change-Id: I2d6e51b615636dc7cd41da65808ef851dd8ae6ac
2021-04-27 23:23:20 +01:00
Paul Duffin
7fbc5842cd Merge "Extract default image specific logic from buildBootImage" am: 6d4de43833 am: 29b18b8c17 am: 8db612ebab
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686149

Change-Id: Ic8a3591508399db477da9a72f21ee9619373cebc
2021-04-27 17:43:17 +00:00
Paul Duffin
6aa72dca5e Merge "Simplify missing deps handling in buildBootImage" am: c42a738bc4 am: c7cf6ac1e7 am: 3d87058cf8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686148

Change-Id: I9a4ec33c1b70563b23791588f132444cc384d7f7
2021-04-27 17:43:11 +00:00
Paul Duffin
67cb5fb7f3 Merge "Remove panics from reportMissingVariationDependency" am: a75af16878 am: b49dae2874 am: 539a24e1d0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686147

Change-Id: I8e184836ffec1c13cbefc802db9761999a0f0dfd
2021-04-27 17:43:02 +00:00
Paul Duffin
8db612ebab Merge "Extract default image specific logic from buildBootImage" am: 6d4de43833 am: 29b18b8c17
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686149

Change-Id: Ifd9767dc1b40ac4a5346c7528329fb314aadfddc
2021-04-27 17:42:25 +00:00
Paul Duffin
3d87058cf8 Merge "Simplify missing deps handling in buildBootImage" am: c42a738bc4 am: c7cf6ac1e7
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686148

Change-Id: I9d5ef5fce5a283d55e7128fd41869e6dd8db5ff0
2021-04-27 17:42:16 +00:00
Paul Duffin
539a24e1d0 Merge "Remove panics from reportMissingVariationDependency" am: a75af16878 am: b49dae2874
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686147

Change-Id: Ie70916fa9d33bf32e9e6bd41506e07d7a721e391
2021-04-27 17:41:55 +00:00
Paul Duffin
5861242a78 Extract default image specific logic from buildBootImage
Previously, buildBootImage had to be called for the default boot image
config before the art boot image config as it created some rules which
were specific to default boot image. The creation of these rules was
encapsulated in Config().Once(..) to ensure that they were only ever
created once.

This change extracts that functionality out of buildBootImage to the
calling method which means that they are only called once and so no
longer need protecting against being called again.

Bug: 177892522
Test: m droid
Change-Id: I464477de1a08df15e577873a9accf7db2bc088d1
2021-04-27 15:56:47 +01:00
Paul Duffin
57e2e7d199 Simplify missing deps handling in buildBootImage
Previously, the buildBootImage function maintained a list of
missingDeps that was returned from findAndCopyBootJars and was passed
to various other methods that created ninja rules that depended on the
files created by findAndCopyBootJars. The purpose of that list was
basically to record that findAndCopyBootJars could not find some files
so that the subsequent ninja rules could be marked as being in error.

This changes avoids having to explicitly propagate the missing deps to
each rule by instead having findAndCopyBootJars generate an error rule
instead of a Cp rule for any missing file. That means that any attempt
to build any rule that depends on the missing file will fail when the
missing file is created.

Bug: 177892522
Test: Add an unknown module to PRODUCT_BOOT_JARS
      lunch art_module_arm64
      - Run each of the following targets and made sure it failed with a
        message indicating that the unknown module was missing.
      m SOONG_ALLOW_MISSING_DEPENDENCIES=true out/soong/module_arm64/dex_bootjars/boot.prof
      m SOONG_ALLOW_MISSING_DEPENDENCIES=true out/soong/generic_arm64/dex_bootjars/boot.bprof
      m SOONG_ALLOW_MISSING_DEPENDENCIES=true out/soong/generic_arm64/dex_bootjars/updatable-bcp-packages.txt
Change-Id: Ib7196c128419fbffdfeb61c1c5d47a3b08d1e132
2021-04-27 15:56:47 +01:00
Paul Duffin
81667c8c11 Remove panics from reportMissingVariationDependency
The code that has been removed triggers in many cases when it should
not, e.g. an unknown module on the bootclasspath. The code was
originally added to try and ensure that if the attempt to add useful
error messages failed it would help debug the issue. However, it ended
up just creating more failures.

If this does become an issue then this will be revisited.

Bug: 177892522
Test: Add an unknown module to PRODUCT_BOOT_JARS
      m SOONG_ALLOW_MISSING_DEPENDENCIES=true
Change-Id: I08dbd4b29d301f3f1f78a0fb396687062b47deb8
2021-04-27 15:56:47 +01:00
Treehugger Robot
f7e6ab6eab Merge "Drop DexPreoptImages field in dexpreopt config" am: bdae1e5765 am: 73ec83be2c am: 51801ac108
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686011

Change-Id: I36a7c371baadf9c19bb7c03efcaebefee6b4b336
2021-04-27 03:23:10 +00:00
Treehugger Robot
51801ac108 Merge "Drop DexPreoptImages field in dexpreopt config" am: bdae1e5765 am: 73ec83be2c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686011

Change-Id: I32468596016b597a7717eaf1e6a618b12f1a5a97
2021-04-27 02:57:14 +00:00
Treehugger Robot
bdae1e5765 Merge "Drop DexPreoptImages field in dexpreopt config" 2021-04-27 01:53:45 +00:00
Paul Duffin
04c7a35a60 Merge "bootclasspath_fragment: Always output contents property in snapshot" am: aef7fcfa7e am: 817d462f97 am: b9e926f26a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686127

Change-Id: Ie02e884b4271c39c4a101e326c85eb2207434c76
2021-04-26 23:38:51 +00:00
Paul Duffin
940a777464 Merge "Automatically add bootclasspath_fragment contents to sdk" am: 56d3ea4998 am: 7d43ff1fd8 am: b157de0c84
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686126

Change-Id: I809cb2e96f550dc718886e8a78e20e7795883bd2
2021-04-26 23:37:45 +00:00
Paul Duffin
d9668be58b Merge "Allow contents and image_name to be specified together" am: 3d14889c5b am: 1081c7d85e am: 143eb249d6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686066

Change-Id: I0a6cce08f1c1b48aa2e9a1832212bf7aa2d8fdec
2021-04-26 23:36:31 +00:00
Paul Duffin
b9e926f26a Merge "bootclasspath_fragment: Always output contents property in snapshot" am: aef7fcfa7e am: 817d462f97
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686127

Change-Id: I1963c51ffd3b4370d7fdac41d90a13a059edab55
2021-04-26 23:12:39 +00:00
Paul Duffin
b157de0c84 Merge "Automatically add bootclasspath_fragment contents to sdk" am: 56d3ea4998 am: 7d43ff1fd8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686126

Change-Id: I2adc481b5f3716bba1410120643e77cd91ad5c9b
2021-04-26 23:12:05 +00:00
Paul Duffin
143eb249d6 Merge "Allow contents and image_name to be specified together" am: 3d14889c5b am: 1081c7d85e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686066

Change-Id: I783a73cca2c05596477f46c9b38bf9bc3ba4b68e
2021-04-26 23:10:58 +00:00
Paul Duffin
94cc88a03c Extract java SdkMemberType instances as vars am: 2da0424b19 am: 233f0ac8eb am: 25c77484ae
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686125

Change-Id: Id7829a5d0f4e45085b597453d42d0d69ebfdfd1b
2021-04-26 21:00:49 +00:00
Paul Duffin
702254af25 Merge "Add coverage specific properties to bootclasspath_fragment" am: ef289f8853 am: ceeb8949f9 am: 5c11c01785
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686065

Change-Id: I342e755de9614c20eaf09f33488d58f1242db312
2021-04-26 21:00:44 +00:00
Paul Duffin
25c77484ae Extract java SdkMemberType instances as vars am: 2da0424b19 am: 233f0ac8eb
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686125

Change-Id: Ife206868863091d56765e9c8d85f3a6643633baf
2021-04-26 20:37:19 +00:00
Paul Duffin
5c11c01785 Merge "Add coverage specific properties to bootclasspath_fragment" am: ef289f8853 am: ceeb8949f9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686065

Change-Id: Id1b8730e45818608e7727d04e01b29567cc13591
2021-04-26 20:37:13 +00:00
Paul Duffin
2dc665bb48 bootclasspath_fragment: Always output contents property in snapshot
Bug: 177892522
Test: m art-module-sdk
      - check generated snapshot contains contents property
Change-Id: I122dedba6600a199bfd83b01988da36ddfd09d63
2021-04-26 21:21:58 +01:00
Paul Duffin
e95b53a55d Automatically add bootclasspath_fragment contents to sdk
Previously, both a bootclasspath_fragment and its contents had to be
explicitly added to the sdk. This change means that adding a
bootclasspath_fragment to and sdk will automatically add its contents
as if they were added using java_boot_libs.

Bug: 177892522
Test: m nothing
Change-Id: I8f7e70649f272c9a109d4606571a2d12c44b7904
2021-04-26 21:21:58 +01:00
Paul Duffin
ba6afd0dba Allow contents and image_name to be specified together
Previously, only one of the contents or image_name properties could be
specified at once which meant that there was no way to create a
prebuilt which lists its fixed contents while at the same time allowing
it to check that that the contents matched what the build configuration
required.

e.g. a prebuilt_bootclasspath_fragment that had image_name: "art",
could not list its contents and also check that those contents matched
the ART_APEX_JARS which the build configuration required.

This change allows contents and image_name to be specified together and
adds a check to make sure that the contents are consistent with the
configuration appropriate to the image_name. The check is only
performed for modules that are active so that a
prebuilt_bootclasspath_fragment which was created without coverage
enabled (the default) would not cause a build failure in a coverage
build unless it was preferred.

Bug: 177892522
Test: m nothing
Change-Id: Ie601f29f707b3f6030fa7d252afa2c4826cc9f8e
2021-04-26 21:21:58 +01:00
Paul Duffin
2da0424b19 Extract java SdkMemberType instances as vars
This will allow them to be used from elsewhere in a follow up change.

Bug: 177892522
Test: m nothing
Change-Id: I60e94e148af5b1810aea7f724cba090b49ae758e
2021-04-26 21:21:58 +01:00
Paul Duffin
3f81c1c71c Merge "Delegate retrieval of dex boot jar for apex to the bootclasspath_fragment" am: 46e4a9e6b1 am: 8745a28532 am: d905f6818a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686218

Change-Id: Ifea7de140ee9c69cd6afe85bbc1dfab24e446160
2021-04-26 17:04:45 +00:00
Paul Duffin
3a351c3dbe Merge "Rename BootImageInfo to BootclasspathFragmentApexContentInfo" am: 71c84696f9 am: 8067ee44b3 am: 9e55ae0bd8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686216

Change-Id: I2a559dbb5dc14cfcf52407e371a0e628ac693634
2021-04-26 17:04:27 +00:00
Paul Duffin
9d3ea7018d Merge "Remove unused setting of BootImageInfo for platform_bootclasspath" am: 00b47c4a6e am: 5fd9799be6 am: 587c558a1a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686215

Change-Id: Ie77a71113bb40ad6474b1f189f6751fc9ef7c8d9
2021-04-26 17:03:44 +00:00
Paul Duffin
d905f6818a Merge "Delegate retrieval of dex boot jar for apex to the bootclasspath_fragment" am: 46e4a9e6b1 am: 8745a28532
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686218

Change-Id: Idbad33644ef2e49fe38e3317d119dfe871404200
2021-04-26 16:37:43 +00:00
Paul Duffin
9e55ae0bd8 Merge "Rename BootImageInfo to BootclasspathFragmentApexContentInfo" am: 71c84696f9 am: 8067ee44b3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686216

Change-Id: I5d86b467f47dcf281a99dc157421176aa2220570
2021-04-26 16:37:33 +00:00
Paul Duffin
587c558a1a Merge "Remove unused setting of BootImageInfo for platform_bootclasspath" am: 00b47c4a6e am: 5fd9799be6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1686215

Change-Id: I075f02fdbdeed17726654508e49256402619fe53
2021-04-26 16:37:25 +00:00
Paul Duffin
c7d1644b0b Add coverage specific properties to bootclasspath_fragment
This allows a bootclasspath_fragment (specifically the
art-bootclasspath-fragment) to specify additional contents to be
appended when coverage is enabled.

The art-bootclasspath-fragment will use this to add jacocoagent to its
contents to ensure that it is always consistent with the configuration.

Bug: 177892522
Test: m nothing
Change-Id: I50d05fe5e0e9b8c14bdf3dfd63bba0ac97e31d48
2021-04-26 17:22:28 +01:00
Paul Duffin
46e4a9e6b1 Merge "Delegate retrieval of dex boot jar for apex to the bootclasspath_fragment" 2021-04-26 16:12:45 +00:00
Paul Duffin
71c84696f9 Merge "Rename BootImageInfo to BootclasspathFragmentApexContentInfo" 2021-04-26 16:12:16 +00:00
Paul Duffin
00b47c4a6e Merge "Remove unused setting of BootImageInfo for platform_bootclasspath" 2021-04-26 15:42:29 +00:00
Jeongik Cha
b19b58a015 Drop DexPreoptImages field in dexpreopt config
The field isn't used anymore.
And DexPreoptImagesDeps will have the slice of which size is the same as
Archs to avoid an error.

Bug: 158843648
Test: m
Change-Id: I520063ff7376811febbc82e1a0a43785feb5bbb2
2021-04-26 23:41:40 +09:00
Paul Duffin
190fdef294 Delegate retrieval of dex boot jar for apex to the bootclasspath_fragment
The dex boot jar for the apex must have had hidden API flags encoded
into it. Currently, the hidden API processing is done within the java
modules themselves so the apex gets the dex boot jar from them.

However, as part of the hidden API modularization work the hidden API
encoding will be performed by the bootclasspath_fragment so this change
prepares for that by delegating the retrieval of the dex boot jars to
the bootclasspath_fragment, via BootclasspathFragmentApexContentInfo.

For the moment that simply delegates straight back to the java module
so this change does not change the build. It will however make it
easier to switch hidden API encoding to the bootclasspath_fragment in
future.

Bug: 179354495
Test: m com.android.art
      - verify that this change does not change its contents
Change-Id: I12eba333749be976bcc72661bb9d6be6cc3c56e3
2021-04-26 11:09:25 +01:00
Paul Duffin
e946b327f4 Rename BootImageInfo to BootclasspathFragmentApexContentInfo
Currently, it only contains ART boot image related information, i.e.
.art, .oat and .vdex files. However, follow up changes will extend that
to include other information from bootclasspath_fragment.

Bug: 177892522
Test: m nothing
Change-Id: I2b226131c0eccff0c739a18f265f90caa10a91d9
2021-04-26 10:05:27 +01:00