Commit graph

3827 commits

Author SHA1 Message Date
Treehugger Robot
1468cc4a10 Merge "Revert "Fix build failure when building unbundled apps"" 2021-04-30 01:52:57 +00:00
Vishnu Nair
0dbd02a3ac Revert "Fix build failure when building unbundled apps"
This reverts commit c027119e73.

Reason for revert: b/186797512
Test: vendor/google/build/build_mainline_modules.sh -j80

Change-Id: I2bb062cce09ac6717702c4f6b110acbb2887adec
2021-04-30 00:24:07 +00:00
Paul Duffin
5983d856c1 Merge "Fix build failure when building unbundled apps" 2021-04-29 20:19:54 +00:00
Paul Duffin
c027119e73 Fix build failure when building unbundled apps
Bug: 186695448
Bug: 185828824
Test: tapas Calendar
      m -j60
Change-Id: I1c5365f6d2afb2f2d159e6f6ed004647ec6d2427
2021-04-29 19:50:40 +01:00
Paul Duffin
12d29b7786 Move generation of hidden API make vars to platform_bootclasspath
Bug: 179354495
Test: rm out/soong/make_vars*
      m nothing
      grep INTERNAL_PLATFORM_HIDDENAPI_FLAGS out/soong/make_vars*
      - make sure it is still out/soong/hiddenapi/hiddenapi-flags.csv
Change-Id: I86e56512a9a2091f446bad25294d41ea1f4341ee
2021-04-29 15:11:35 +01:00
Paul Duffin
e3ecce67c1 Make platform_bootclasspath a singleton module
This is needed in order to allow it to implement MakeVars so it can
create make variables just like the dexpreopt_bootjars and hiddenapi
singletons currently do.

Bug: 177892522
Bug: 179354495
Test: m nothing
Change-Id: Ida5bf8abeecde531e1f6430151650065445804ac
2021-04-29 13:37:16 +01:00
Paul Duffin
f7a5592d38 Move dumpOatRules to platform_bootclasspath
Bug: 177892522
Test: m oat-dump-boot
      - test output to make sure that this change does not change the
        generated files, at least no more than no changes do as the
	output from this rule is not deterministic. See b/186459873.

Change-Id: Ib2b4203d9bb1fd0ee9443aee4e58b54b38b491cf
2021-04-29 11:50:48 +01:00
Paul Duffin
4c094428a7 Move generateUpdatableBcpPackagesRule to platform_bootclasspath
Changes generateUpdatableBcpPackagesRule to use ModuleContext instead
of SingletonContext and moves the call from dexpreoptBootJar's
GenerateSingletonBuildActions method to platform_bootclasspath's
GenerateAndroidBuildActions.

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: I9741ae1eb9573cafe12dd7a17dc1d8449b224dc8
2021-04-29 11:50:48 +01:00
Paul Duffin
01b463bc06 Differentiate between art, non-updatable and updatable modules
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: I3d35f1664cbbaba5df3f5809859dd9815a26d05d
2021-04-29 11:50:42 +01:00
Paul Duffin
9bacf56564 Extract logic to gather deps added for <apex>:<module> pairs
Trades having to traverse a module's direct dependencies multiple times
for reusable code. While at the minute the amount of duplicated code is
small (checking a tag and appending to a list) follow up changes will
modify the gatherApexModulePairDepsWithTag module to improve error
reporting greatly increasing the benefit of deduping.

The cost of traversing a module's direct dependencies is very small as
there will be only a very few dependencies.

Bug: 177892522
Test: m nothing
Change-Id: I16389102abd8038e1bfa52b63f4153bdf92ff553
2021-04-29 11:34:59 +01:00
Paul Duffin
110b0add9e Treat "apex" system_ext the same as platform
Change https://r.android.com/1672245 added support to treat
system_ext:foo in the boot jars configuration the same as platform:foo,
at least for dexpreopt_bootjars.go's getBootJar.

This change replicates that mechanism in platform_bootclasspath and as
that now handles hidden API processing also made a similar change in
the isModuleInConfiguredList function.

Bug: 177892522
Bug: 154976937
Test: m nothing
Change-Id: I105f4fbaa3b0355b013b7c5618d218d888faefb6
2021-04-29 10:35:10 +01:00
Paul Duffin
895c7140a9 Add stub_libs properties to bootclasspath_fragment snapshot
Bug: 177892522
Test: m nothing
Change-Id: I7644122c4abed8e8bc2cc7b58f408bee3bdc91f6
2021-04-28 22:02:00 +01:00
Paul Duffin
1093158faf Add support for specifying api provided by bootclasspath_fragment
The hidden API processing needs access to dex stub jars for the API
scopes provided by the bootclasspath_fragment so that it can mark the
corresponding dex members as being part of that API. This change adds
the ability to specify the modules that provide those jars, resolve the
modules to dex jar stubs and make them available for other modules and
tests to use.

While the stubs are only needed for hidden API at the moment these were
not added to the hidden_api properties section as there are other parts
of the build that may need to access the stubs in future, e.g. api
fingerprint and aidl generation.

The stubs properties can be affected by coverage as when coverage is
enabled the jacoco-stubs needs adding to the list, just like how
jacocoagent is added to the contents.

Bug: 177892522
Test: m nothing
Change-Id: I31097d1ca45c84adeba4cbb38f693698cb289e99
2021-04-28 21:59:46 +01:00
Andrei-Valentin Onea
b75031e918 Merge "Replace source based system server stubs" 2021-04-28 15:06:22 +00:00
Paul Duffin
8d817b70e6 Merge "Extract IsModuleInVersionedSdk" 2021-04-28 12:58:43 +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
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
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
bdae1e5765 Merge "Drop DexPreoptImages field in dexpreopt config" 2021-04-27 01:53:45 +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
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
Vladimir Marko
fa64af9961 Merge "profman: Clean up output profile type options." 2021-04-26 07:34:21 +00:00
Paul Duffin
f13e07eee2 Remove unused setting of BootImageInfo for platform_bootclasspath
The BootImageInfo is used to populate an apex. A platform_bootclasspath
module cannot be part of an apex so does not need to provide one.

Bug: 177892522
Test: m nothing
Change-Id: I1e1c4962d9d8106a12af80107c4c35828f54ff81
2021-04-25 21:38:14 +01:00
Paul Duffin
a720811c38 Allow exporting of sdk members to be done per tag
Previously, every module added to an sdk directly through one of the
SdkMemberType specific properties, e.g. java_libs, was exported and
every module added automatically via a transitive dependencies was not
exported. This change allows that behavior to be customized per tag.

Bug: 186290299
Test: m art-module-sdk
      - verify that this change does not affect its contents.
Change-Id: I563b5bcd823e61c23cdb706cfcbb13337963d550
2021-04-24 22:30:26 +01:00
Paul Duffin
df160eb463 Remove unused boot_image module type, prebuilt and sdk member type
Bug: 177892522
Test: m nothing
Change-Id: I5763b55992e4113506ae5ccdaf9865ee27d8b041
2021-04-23 17:00:26 +01:00
Paul Duffin
7771eba88e Rename BootImageModule to BootclasspathFragmentModule
Also renames files, tests, module types in a similar fashion.

There are still some references to image and boot image. They are kept
for the following reasons:
* image_name - this is the name of an ART boot image, i.e. the
  collection of .art/.oat/.vdex files.
* BootImageInfo - again this is related to the ART boot image.
* .../art_boot_images/... paths - ditto.

Bug: 177892522
Test: m nothing
Change-Id: Ie1f4738061d131fee75de48bc26a7601481bad4d
2021-04-23 16:59:26 +01:00
Paul Duffin
d5f8421afd Merge changes Ic32f02a6,Ibe358542
* changes:
  Export classesJars initialized in hiddenAPIExtractInformation
  Generalize the platformBootclasspathDepsMutator
2021-04-23 15:57:46 +00:00
Jaewoong Jung
8811dcbb22 Merge "Fix minor issues in updatability lint CLs." 2021-04-23 15:31:41 +00:00
Paul Duffin
fbe3a73d48 Merge "Extract general bootclasspath related code into java/bootclasspath.go" 2021-04-23 15:04:10 +00:00
Treehugger Robot
784ad87dd6 Merge "Don't plumb PRODUCT_*_CLASSPATH vars to make." 2021-04-23 14:32:33 +00:00
Vladimir Marko
230bd421a8 profman: Clean up output profile type options.
Test: m  # Check output boot profiles with hexdump.
Bug: 148067697
Change-Id: Ic20f415ad4eee1fd6396f320b757420884764d2c
2021-04-23 15:19:16 +01:00
Paul Duffin
023dba0a3f Add exported_bootclasspath_fragments to prebuilt_apex/apex_set
This is needed to allow a prebuilt_bootclasspath_fragment to be used
interchangeably with a bootclasspath_fragment in the
platform_bootclasspath module.

The platform_bootclasspath module depends on APEX specific variants of
bootclasspath_fragment modules. That works because the
bootclasspath_fragment modules are part of an apex and so have an APEX
specific variant which the platform_bootclasspath can specify.

Using a prebuilt_bootclasspath_fragment in place of a
bootclasspath_fragment requires that the prebuilt also has an APEX
specific variant.

Specifying exported_bootclasspath_fragments on a prebuilt_apex/apex_set
will cause it to create an APEX variant for the named module whcih will
allow it to be selected by the platform_bootclasspath module.

Bug: 186034565
Bug: 177892522
Test: m nothing
Change-Id: I7ddacc6498ec3a4a9f26c5f78b7f9a033e494d78
2021-04-23 12:12:37 +01:00
Paul Duffin
36187b2cf3 Export classesJars initialized in hiddenAPIExtractInformation
This exports classesJars constructed in hiddenAPIExtractInformation
through the hiddenAPIIntf interface for use by the
bootclasspath_fragment module type.

Bug: 179354495
Test: verified that the monolithic out/soong/hiddenapi/... files are
      unchanged by this change
Change-Id: Ic32f02a69229d9518772fe6b2a329501dd8cd849
2021-04-23 09:32:14 +01:00
Paul Duffin
b67d878b80 Extract general bootclasspath related code into java/bootclasspath.go
The platform_bootclasspath and bootclasspath_fragment modules provide
different capabilities but are related and so have some common
functionality. This change moves some platform_bootclasspath code that
will be of use for bootclasspath_fragment in future into a separate
file.

Bug: 177892522
Test: m nothing
Change-Id: I827b85e33d16155fcc920d553100c9e99267dc4e
2021-04-23 09:32:14 +01:00
Paul Duffin
4994d26bfa Generalize the platformBootclasspathDepsMutator
Adds a BootclasspathDepsMutator that is currently only implemented by
the platform_bootclasspath but which can be implemented by
bootclasspath_fragment too.

Bug: 177892522
Test: m nothing
Change-Id: Ibe35854281004d6e40bf1f797144fb582e8c08b9
2021-04-23 09:32:14 +01:00