Commit Graph

35483 Commits

Author SHA1 Message Date
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
Lukács T. Berki c860588763 Merge "Reorganize and cull cc_library_static denylist." 2021-04-27 14:42:00 +00:00
Treehugger Robot 6de44e74c8 Merge "bp2build: fix exclude_srcs in subpackages." 2021-04-27 13:48:46 +00:00
Lukacs T. Berki b5ac5af618 Reorganize and cull cc_library_static denylist.
Take two: this time, put libasync_safe on the mixed build denylist
because it seems to break things.

Test: Presubmits + testing the offending action using a Ninja
invocation. "m droid dist" also running.

Change-Id: I7912b6670980776d981d874dab157b0268693ab2
2021-04-27 15:00:45 +02:00
Jingwen Chen e32e9e07d7 bp2build: arch-specific exclude_srcs and srcs.
OS-specific exclude_srcs and srcs will be done in a follow-up, due to
complexities from merging multiple select statements together.

Test: TH
Bug: 186153868
Change-Id: I01b881e9a5a7cd41b4a507f8be7e9e65eab37bdc
2021-04-27 11:02:07 +00:00
Jingwen Chen 4ecc67d3c5 bp2build: fix exclude_srcs in subpackages.
In a non-top level Android.bp file, exclude_srcs was not working at all
due to a bug in expandSrcsForBazel. GlobFiles was expanding a glob
relative to root, but the expandedExcludes list was relative to the
module dir, causing the glob function to not consider the
expandedExcludes list at all.

Add tests to demonstrate that this is working now.

Test: TH
Bug: 186388919
Change-Id: Ice8254231d085b39126e91b823a09ec328ee0ae0
2021-04-27 09:51:08 +00:00
Jingwen Chen 882bcc1c1c bp2build: remove header globs in generated srcs.
Not needed anymore for bp2build-incremental since https://android-review.googlesource.com/q/topic:no-include-check.

Not needed for mixed builds either, since cc compile actions aren't sandboxed.

Fixes: 186488830
Test: treehugger and go tests

Change-Id: Ib5d4908dcce6bf910a653c457bb251d726e717d4
2021-04-27 06:26:40 +00:00
Colin Cross c30d7beb8f Merge "Fix and test vendor public libraries for product modules" 2021-04-27 03:40:27 +00:00
Colin Cross e3f2869573 Merge "Move TestVendorPublicLibraries into vendor_public_library_test.go" 2021-04-27 03:39:21 +00:00
Steven Moreland 8fc8dbf70c start eating include_dirs from both ends
Further restrictions on a restricting build configuration. Before, we
restricted certain paths from being included. Now, we restrict certain
paths from including.

This adds system/libfmq for now, but I'm planning to add more in the
future, as they are cleaned up.

Bug: 35624006
Test: m nothing
Change-Id: I913f190f93ab63059ee0372d342daa8f5584806b
2021-04-27 02:56:03 +00:00
Treehugger Robot bdae1e5765 Merge "Drop DexPreoptImages field in dexpreopt config" 2021-04-27 01:53:45 +00:00
Colin Cross 203b421043 Remove obsolete llndk_library
Remove llndk_library in favor of cc_library with llndk.symbol_file.

Bug: 170784825
Test: m checkbuild
Test: TestLlndkLibrary
Change-Id: I43580976589a7a2a176d7442be53fa043c0c8324
2021-04-26 18:41:00 -07:00
Colin Cross 627280f091 Remove llndk_headers
Replace llndk_headers with cc_library_headers with
llndk.llndk_headers: true.

Bug: 170784825
Test: m checkbuild
Test: compare out/soong/build.ninja
Test: TestLlndkHeaders
Change-Id: I33b411cd4d474318796c2073375176b82dd8c216
2021-04-26 18:40:53 -07:00
Colin Cross 1f3f130e29 Add support for cc_library_headers to replace llndk_headers
Set llndk.llndk_headers: true to allow a cc_library_headers
module to be used by a cc_library module with llndk.symbol_file set.

Bug: 170784825
Test: TestLlndkHeaders
Change-Id: Ib65a4b70717dc9a54ae30f2991485bb1bb9b8409
2021-04-26 18:37:44 -07:00
Colin Cross be763f7b16 Skip default dependencies for header libraries
Header libraries don't compile anything, so they don't need the
default stl and libclang_rt dependencies.  Trimming the dependencies
simplifies using header libraries for LLNDK libraries, which need
extra variants that don't exist for the default dependencies.

Test: m checkbuild
Change-Id: Ib9864c3cc7048b2cc52acf304830777b65a51877
2021-04-26 18:23:45 -07:00
Colin Cross b719c0194e Fix and test vendor public libraries for product modules
Vendor public libraries are checked for product modules, but never
reached because the VNDK check occurs first, and wouldn't work anyways
because vendor_public_library did not have the product_available
property.  Reorder the rewrite checks and add VendorProperties, and
add a test.

Bug: 178231622
Test: vendor_public_library_test.go
Change-Id: Idbd2802fbd134d22c30600762cb0465633703506
2021-04-26 18:23:45 -07:00
Colin Cross f12db530d0 Move TestVendorPublicLibraries into vendor_public_library_test.go
Bug: 178231622
Test: TestVendorPublicLibraries
Change-Id: Ic57202a7e4e186483506ceca3125f3d6a855f3ff
2021-04-26 17:43:32 -07:00
Treehugger Robot 1f8a7f06d9 Merge "Revert "Reorganize and cull cc_library_static denylist."" 2021-04-26 23:46:42 +00:00
Liz Kammer cc86ac88a8 Revert "Reorganize and cull cc_library_static denylist."
This reverts commit cba7b0c43c.

Reason for revert: mixed_droid failing: libbacktrace fails due to libasync_safe, linkerconfig (and others) due to duplicate symbols

Change-Id: Ib6dd6bbb6f76048a7abd0970d457cf75921beae6
2021-04-26 22:17:48 +00:00
Paul Duffin aef7fcfa7e Merge "bootclasspath_fragment: Always output contents property in snapshot" 2021-04-26 22:05:59 +00:00
Paul Duffin 56d3ea4998 Merge "Automatically add bootclasspath_fragment contents to sdk" 2021-04-26 22:04:14 +00:00
Paul Duffin 3d14889c5b Merge "Allow contents and image_name to be specified together" 2021-04-26 22:03:51 +00:00
Matthew Maurer 5fa13b8457 Merge "Enable overflow checks in Rust" 2021-04-26 20:46:21 +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 ef289f8853 Merge "Add coverage specific properties to bootclasspath_fragment" 2021-04-26 20:20:26 +00:00
Peter Collingbourne 19947656df Merge "Don't print RBE stats if ANDROID_QUIET_BUILD is set." 2021-04-26 19:47:58 +00:00
Lukács T. Berki 2567d80414 Merge "Reorganize and cull cc_library_static denylist." 2021-04-26 19:08:04 +00:00
Lukacs T. Berki cba7b0c43c Reorganize and cull cc_library_static denylist.
Test: Presubmits.
Change-Id: Ia82d5b6975fe53888798db0378635ec36b43603e
2021-04-26 18:54:28 +02: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 9768678344 Merge "Extract bootclasspathFragment related code into separate functions" 2021-04-26 16:12:33 +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
Rupert Shuttleworth 375451edfe Add support for per-target exported includes.
Test: Added unit test
Change-Id: I8ab58ddc73c15d5ec0f515e43407542bd4e8081a
2021-04-26 07:49:08 -04: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 cc33ec8838 Extract bootclasspathFragment related code into separate functions
The apexBundle.GenerateAndroidBuildActions is 400+ lines long which
makes it difficult to understand what is happening.

Bug: 177892522
Test: m com.android.art
      - verify that this change does not change its contents
Change-Id: I07cb31d246377869771bdb18fdc6291365adf399
2021-04-26 11:09:02 +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 cd06467124 Generate snapshot member list properties from dependencies
Previously, the snapshot member list properties were simply copied from
the sdk variants. That worked because the snapshot member list
properties must include all exported (i.e. visible outside the sdk
snaphot) members and only members explicitly specified in the sdk
member list properties were exported. However, a preceding change
allowed members that were transitively added (and so not explicitly
specified on the sdk) to be exported.

This change ensures that those exported members are added to the
snapshot member properties which means that they will now work properly
with the sdk version mutators.

This does not add tests for this because no existing SdkMemberType
exports its transitive dependencies and there is currently no way to
register an SdkMemberType for testing only. A following change will
exercise this functionality.

Bug: 186290299
Test: m nothing
Change-Id: Iadbdd86f6dcdd183fa99f647222a43d412271501
2021-04-24 22:33:04 +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 2d1bb89fe3 Extract the os specific snapshot module properties handling
Previously, the code was inlined in the addSnapshotModule() method
which made it difficult to follow, did not have clear separation
between the different pieces and duplicated functionality. This
change combines the dynamic and static properties together and then
separates the processing into collation, optimization and property
set updating methods.

Bug: 186290299
Test: m nothing
Change-Id: I311eebca2337cb67634e63d71da12305f4370c07
2021-04-24 22:30:18 +01:00
Paul Duffin fbe470e7d3 Dedup snapshot module property set initialization
Previously, the code to add the compile_multilib property was
duplicated. This change moves the logic into the existing
addMemberPropertiesToPropertySet method, renames it to reflect new
behavior and renames and promotes the variantProperties struct from the
addSnapshotModule() method to the package level scope.

Bug: 186290299
Test: m nothing
Change-Id: I832a7fd89a3cf95467a1ff0807902c9be34c50b9
2021-04-24 16:50:47 +01:00
Paul Duffin 7b0259ff62 Make order of properties in snapshot module consistent
Previously the compile_multilib property was added after the member
list properties at the top level but before them in the target.os
level. This change makes it always be added before them.

Bug: 186290299
Test: m nothing
Change-Id: I01fe272933fd11f7f730cc379f60fb2ce70f2114
2021-04-24 16:50:47 +01:00
Paul Duffin cc3132e496 Clarify behavior around handling of sdk members
Renames some types and adds some documentation to try and clarify how
the sdk handles the members.

Bug: 186290299
Test: m nothing
Change-Id: I4038276f5f4c473a96fe06aedc43050c90416877
2021-04-24 16:49:26 +01:00