Commit graph

37801 commits

Author SHA1 Message Date
Paul Duffin
e63e0cc94e Merge "Avoid passing around []hiddenAPIModule" am: 881baf5573
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1736224

Change-Id: Ia794359e5a581d6b8b705d213eb17fae51454504
2021-06-14 22:19:04 +00:00
Paul Duffin
881baf5573 Merge "Avoid passing around []hiddenAPIModule" 2021-06-14 22:02:42 +00:00
Nikita Ioffe
571a72a46b Merge "Rename test_only_no_hashtree to generate_hashtree" am: 5868ba016d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1734152

Change-Id: I475c6159f198a84cd6b31b888b99567a7c32ec8a
2021-06-14 20:22:42 +00:00
Paul Duffin
d0a7be3222 Improve error reporting when a rule cannot be found am: 4dbf6cfbae
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1736223

Change-Id: Ida5552db4748838406f41d66f101aff1a7b3443c
2021-06-14 20:20:22 +00:00
Nikita Ioffe
5868ba016d Merge "Rename test_only_no_hashtree to generate_hashtree" 2021-06-14 20:16:21 +00:00
Martin Stjernholm
6fe860b47f Clean up statsd-module-sdk-for-art.
No longer needed.

Test: build/soong/scripts/build-mainline-modules.sh
Bug: 188761143
Bug: 180769414
Change-Id: I3524095d0399710e5f474fcc322eba008abfb797
2021-06-14 19:50:58 +01:00
Pirama Arumuga Nainar
09661c5a93 Switch to clang-r416183d
Bug: http://b/189328402

This contains a fix to AArch64 __clear_cache.

Test: TH + Manual verification by emulator team.
Change-Id: If11e59638f47a5c9532d84d19c7a76e6e8718af8
2021-06-14 09:56:03 -07:00
Paul Duffin
dd5993f6d4 Avoid passing around []hiddenAPIModule
Previously, an []android.Module was converted to an []hiddenAPIModule
that was then used to retrieve boot dex jars. That was ok when
obtaining the dex jar files from source modules for
bootclasspath_fragment but does not work well for other use cases as
it would require doing that conversion in multiple places.

This change pushes the use of hiddenAPIModule down to the methods that
retrieve information from it which makes the methods more flexible and
easier to reuse.

Bug: 177892522
Test: m nothing
Change-Id: Ib84aaf03d8f5a63b48232036fe4589646fc23352
2021-06-14 17:23:52 +01:00
Paul Duffin
4dbf6cfbae Improve error reporting when a rule cannot be found
Outputs the list of available rules on separate lines.

Test: m nothing
Change-Id: I845064e032f0a47d00883ff775c4f7b4fee7631e
2021-06-14 17:23:52 +01:00
Paul Duffin
174d9c7eec Merge "Make copyBootJarsToPredefinedLocations simpler and less fragile" am: cc1bd8364a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1731414

Change-Id: If96e0287db7e2ef86fb12f14f278dc669bf9682d
2021-06-14 08:24:53 +00:00
Paul Duffin
cc1bd8364a Merge "Make copyBootJarsToPredefinedLocations simpler and less fragile" 2021-06-14 08:20:50 +00:00
Paul Duffin
87cbe1b100 Merge "Ensure primary boot image files are created before they are used" am: a11b8707f1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1731413

Change-Id: I4d5c86d67488e8892ccf0c7237177040448703ef
2021-06-14 08:19:18 +00:00
Paul Duffin
a11b8707f1 Merge "Ensure primary boot image files are created before they are used" 2021-06-14 08:01:27 +00:00
Colin Cross
9cfe6119fe Use a linker script for host bionic embedded linker sections
Use an implicit linker script instead of flags in a file to specify
the locations of the host bionic embedded linker and to prevent it
from being stripped.

Test: build and run host bionic binary
Change-Id: I64e12118d33c67bab5e657cbc3ea8cde8f0fd7e6
2021-06-11 18:02:22 -07:00
Colin Cross
cef792e467 Support genrules as CrtBegin and CrtEnd
Host bionic will use a genrule output as a linker script in CrtBegin,
support genrules as Crt* dependencies.

Test: go test ./build/soong/cc/...
Change-Id: Ie384089d26459797d0b4b5fef84846507fc508ad
2021-06-11 18:01:26 -07:00
Colin Cross
c465efd5d4 Support multiple CrtBegin and CrtEnd files
Host bionic will use multiple files for CrtBegin, make CrtBegin and
CrtEnd Paths instead of OptionalPath.

Test: go test ./build/soong/cc/...
Change-Id: Ie2e954cd87808a903617696da443009f6173e312
2021-06-11 18:00:04 -07:00
Colin Cross
009f3df380 Give extracted linker sections pretty names
Replace .linker.sect0, etc. with .linker, .linker.text, .linker.data
and .linker.data.rel.ro by extracting the name of the first section
in each program header.

Test: build and run host bionic binary
Change-Id: I25107547536a3a3963fdeb311c45a7ee53c0bc45
2021-06-11 17:57:09 -07:00
Colin Cross
f04eb99acc Stop injecting symbols into host bionic binaries
The host bionic bootstrapping no longer needs an injected symbol.
Replace host_bionic_inject with host_bionic_verify that validates
the resulting binary, and add it as a validation dependency of the
binary.

Test: build and run host bionic binary
Change-Id: I3e303d2a164b6eef851bdc8075e6ee456c05b0a8
2021-06-11 15:22:41 -07:00
Liz Kammer
e684a554ca Merge "Append _alwayslink to prebuilt whole static deps" am: 5f16b3d03e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1734255

Change-Id: I59610a5c0a4df44f2f736bc5267c8e8b191d07fa
2021-06-11 19:59:09 +00:00
Liz Kammer
5f16b3d03e Merge "Append _alwayslink to prebuilt whole static deps" 2021-06-11 19:47:12 +00:00
Liz Kammer
2d7bbe3883 Append _alwayslink to prebuilt whole static deps
This allows us to support prebuilt archives that are part of whole
static deps.

Test: build/bazel/ci/bp2build.sh
Bug: 190716727

Change-Id: I913dbd8f85a1974fbd53c0cbaa49211db18ea45f
2021-06-11 08:10:50 -04:00
Paul Duffin
c279ca845c Merge "Make bootclasspath_fragment_sdk_test.go tests more realistic" am: 4ebad6aa89
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1731419

Change-Id: Idef290f1cfafc8fea10760dc1da87c1e9658b8ad
2021-06-11 04:50:45 +00:00
Paul Duffin
e599574c92 Merge "Make TestPlatformBootclasspath_Fragments more realistic" am: baa8e55dec
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1731417

Change-Id: Ie932deddef1bd9bf181c26278a4fd8482a750514
2021-06-11 04:50:38 +00:00
Paul Duffin
0d2a3ad17d Merge "Move TestPlatformBootclasspath_Fragments to apex package" am: 2eddb50fd5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1731416

Change-Id: Ia1f9004d5f214aff94012f95dcaaa840a4babac9
2021-06-11 04:50:29 +00:00
Paul Duffin
a6752bb7ed Merge "Export hidden api related types and fields" am: 5e1073b7cd
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1731415

Change-Id: I3a24d55d95460bbebb7378411d8b5d449ffce628
2021-06-11 04:49:38 +00:00
Paul Duffin
4ebad6aa89 Merge "Make bootclasspath_fragment_sdk_test.go tests more realistic" 2021-06-11 04:41:28 +00:00
Paul Duffin
baa8e55dec Merge "Make TestPlatformBootclasspath_Fragments more realistic" 2021-06-11 04:40:46 +00:00
Paul Duffin
2eddb50fd5 Merge "Move TestPlatformBootclasspath_Fragments to apex package" 2021-06-11 04:40:04 +00:00
Paul Duffin
5e1073b7cd Merge "Export hidden api related types and fields" 2021-06-11 04:39:05 +00:00
Dan Albert
56f52de8bd Add systemapi as an APEX synonym for stub maps.
The apex tag is currently used for platform-to-APEX, APEX-to-APEX, and
APEX-to-platform, and it's difficult to tell when reviewing the map
files. Add a synonym so authors can be explicit about platform-to-APEX
since those have different stability rules.

Test: pytest
Test: mypy
Test: pylint
Test: treehugger
Bug: None
Change-Id: I0aee679a05b1b2d3749307434c19486bf4c7fe52
2021-06-10 16:38:19 -07:00
Dan Albert
ead21552ee Refactor tag handling code in stub generator.
Test: pytest
Test: pylint
Test: mypy
Test: treehugger
Bug: None
Change-Id: I7fb380a3d879b4abcdadfe4aafff0ca4098d2e07
2021-06-10 16:38:19 -07:00
Colin Cross
20a0efc544 Merge "Always propagate some environment variables to RBE" am: 7b4bda29fc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1732493

Change-Id: I378f28c316327166becefd16ca7d3c10a2438f0c
2021-06-10 16:15:39 +00:00
Yuntao Xu
bdafba2af6 Merge "Support LOCAL_CERTIFICATE_LINEAGE for androidmk" am: 7a93bffd76
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1729631

Change-Id: I1f678ccdb63ebb02bfb8acff8ef43d404f4e61d5
2021-06-10 16:13:57 +00:00
Colin Cross
7b4bda29fc Merge "Always propagate some environment variables to RBE" 2021-06-10 15:57:22 +00:00
Yuntao Xu
7a93bffd76 Merge "Support LOCAL_CERTIFICATE_LINEAGE for androidmk" 2021-06-10 15:57:17 +00:00
Nikita Ioffe
9d9960f240 Rename test_only_no_hashtree to generate_hashtree
In order not to introduce any changes in the system image default value
of generate_hashtree is currently set to false. Once all the APEXes that
shouldn't have hashtree enable (i.e. non-updatable ones) explicitly set
`generate_hashtree: false` default value will be switched to true.

Test: checked that are no diffs between ${OUT}/system/apex without this
  change and with this change.
Test: m
Bug: 190621617
Change-Id: I5a3144f8f6ea7dee25678af43e2b07a8c85daa9e
Merged-In: I5a3144f8f6ea7dee25678af43e2b07a8c85daa9e
(cherry picked from commit da6dc31389)
2021-06-10 16:54:53 +01:00
Jingwen Chen
a0bc3f955e Merge "bp2build: support strip properties." am: 62d8b1ed43
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1730118

Change-Id: I78615ca55f489feaeb648557e684904c808aaa88
2021-06-10 13:50:22 +00:00
Liz Kammer
7bd07b7193 Merge "Handle simple symlinks in mixed builds" am: 6ae5658387
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1729716

Change-Id: I362915f928012498f9d215590a54c2f2cca5021e
2021-06-10 13:49:22 +00:00
Jingwen Chen
62d8b1ed43 Merge "bp2build: support strip properties." 2021-06-10 13:36:13 +00:00
Liz Kammer
6ae5658387 Merge "Handle simple symlinks in mixed builds" 2021-06-10 13:35:13 +00:00
Paul Duffin
5f148ca7cf Make copyBootJarsToPredefinedLocations simpler and less fragile
Previously, copyBootJarsToPredefinedLocations relied on all its
parameters having the same length and the same order. That made it
quite fragile as changes to one of the parameters without corresponding
changes to the other would cause failures. It also combined the
retrieval of the boot dex jars from the modules, handling of missing
boot dex jar files and the generation of the rules to copy the files.

This change separates the retrieval of boot dex jars and handling of
missing files from the copying of those files while at the same time
making the function less fragile by replacing the three ordered
parameters with two maps that shared common keys.

Bug: 179354495
Test: m nothing
Change-Id: Idbcd24a7e8af89f7895a20aeddc58502dcbaad03
2021-06-10 14:28:10 +01:00
Paul Duffin
bff50e2b80 Ensure primary boot image files are created before they are used
Previously, when building a framework boot image variant it added an
implicit dependency onto the first file in the primary boot image
variant to ensure that the primary boot image variant files that the
dex2oat command needs have been created. That works when generating
from source as in that case all the files for a boot image variant are
created by a single command. However, it does not work for prebuilts as
each prebuilt file will be copied into the required location by
separate copy commands.

This change adds all the files that the dex2oat command uses implicitly
when building an extension boot image as implicit dependencies.

Bug: 177892522
Test: m SOONG_CONFIG_art_module_source_build=false droid
      - the previous command only works in combination with a number of
        other build changes.
Change-Id: I183748fd17f8f3003890675b8c6bb9fcab331443
2021-06-10 13:40:33 +01:00
Paul Duffin
95d8ad47f0 Maintain header order in merge_csv am: 84c1cdf31f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1731412

Change-Id: I593e0e23c166a1752c5419637579718b6a894232
2021-06-10 11:51:33 +00:00
Paul Duffin
7c47515c7f Make bootclasspath_fragment_sdk_test.go tests more realistic
In the input test fixture this makes sure that every
bootclasspath_fragment is part of an apex and every content module for
the fragment is listed in the appropriate boot jars config property. It
also adds a platform_bootclasspath fragment that references the
fragment.

In the snapshot test fixtures this adds a prebuilt_apex that exports
the fragment so that the platform_bootclasspath has access to the dex
implementation files.

Bug: 177892522
Test: m nothing
Change-Id: I6c73651a359052858232b06229b4433799dd94db
2021-06-10 12:36:44 +01:00
Paul Duffin
dc3f9566a2 Make TestPlatformBootclasspath_Fragments more realistic
Move the bootclasspath_fragment to be part of an apex to match how they
are expected to be used. Also adds the bar library to the boot jars
config as every module in a bootclasspath_fragment that is referenced
from a platform_bootclasspath module is expected to be in the config.

Bug: 179354495
Test: m nothing
Change-Id: I6f826dce9c006d630ee31d4171fe6fb458cc9442
2021-06-10 12:36:43 +01:00
Paul Duffin
ffa8375f07 Move TestPlatformBootclasspath_Fragments to apex package
This test checks that fragments which are referenced from a
platform_bootclasspath module contribute their hidden API flags to those
used by platform_bootclasspath module. Previously, it was unrealistic
because the bootclasspath_fragment does not belong in an APEX.

This change moves the test from the java package to the apex package to
allow it to be modified to make the bootclasspath_fragment part of an
apex.

Bug: 179354495
Test: m nothing
Change-Id: Icb57f2e1eaea4b14aab5f47f3af7d05ea0555816
2021-06-10 12:36:43 +01:00
Paul Duffin
524c82c01a Export hidden api related types and fields
This will export some hidden api related types and fields so they can
be used from outside the java package. This is needed to allow a follow
up change to move the TestPlatformBootclasspath_Fragments from the java
to the apex package.

Bug: 179354495
Test: m nothing
Change-Id: Ib69eea9d79cc83b8e3fc29919a29f071e1ec17b5
2021-06-10 12:36:43 +01:00
Jingwen Chen
3d383bbeb9 bp2build: support strip properties.
This CL adds support to bp2build for generating all strip-related
properties into a strip dictionary as a parameter in the cc_library
macro.

With the dictionary, it's easy to organize related attributes and
directly expand into a stripped_shared_library's attributes.

Test: //build/bazel/tests/bionic:compare_libc_stripping
Test: TH
Fixes: b/187928597
Change-Id: Ifea68d48fe295e71a43b12876cb168c475a62187
2021-06-10 05:22:50 +00:00
Colin Cross
95fad7a56e Always propagate some environment variables to RBE
Always propagate LANG, LC_MESSAGES and PYTHONDONTWRITEBYTECODE
to RBE to get more consistent behavior between local actions and
RBE.

Bug: 182415460
Bug: 190593001
Test: treehugger
Change-Id: I726e6f02fd3ef77e158baf6fde77ffb7247a1375
2021-06-09 15:05:40 -07:00
Liz Kammer
c49e682f37 Handle simple symlinks in mixed builds
Bug: 180945121
Test: build/bazel/ci/mixed_libc.sh
Change-Id: I49fba569a41dcb8cd4c2e58560817443697f58f1
2021-06-09 10:40:32 -04:00