Commit Graph

37644 Commits

Author SHA1 Message Date
Xin Li
007875cd10 DO NOT MERGE - Merge ab/7272582
Bug: 190855093
Merged-In: I0f5da13644fd2ec7b0472fe82918e3c6a72d953c
Change-Id: I33b074204ffba5aa2bf83bbbe350d744ee9d8c57
2021-06-17 21:41:17 +00:00
Treehugger Robot
e7e443b820 Merge "Add a build flag to always enable errorprone per-target" am: 768692bc69
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1735975

Change-Id: I7fc8b462d0a8b504e3aa4066c9e27fb158483851
2021-06-15 00:50:29 +00:00
Treehugger Robot
768692bc69 Merge "Add a build flag to always enable errorprone per-target" 2021-06-15 00:32:41 +00:00
Cole Faust
75fffb14b8 Add a build flag to always enable errorprone per-target
Currently, errorprone is only run if the RUN_ERROR_PRONE
enviornment variable is true. Add a flag that individual
modules can use to always enable errorprone.

In a followup cl, I plan to add another flag that will
force all errorprone checks to be errors, so that modules
can be confident that they're not ignoring any errorprone
checks.

Bug: 190944875
Test: New unit test and manually
Change-Id: Iab0c81642ed22a736add054147829e91a891d179
2021-06-14 15:31:32 -07:00
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
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
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
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
Paul Duffin
84c1cdf31f Maintain header order in merge_csv
Previously, if the --header property was not specified then merge_csv
would use a header constructed by sorting all the fields in the input
files. That required that any use of merge_csv which did not already
have headers in the required order would have to explicitly specify the
headers. That made it harder to use merge_csv as a generic tool as each
invocation needed to be aware of what headers were exported in the
output.

This change causes merge_csv to simply use the headers in the order in
which they are encountered in the input files. That removes the need to
specify the --header option when generating the index files.

Bug: 179354495
Test: m out/soong/hiddenapi/hiddenapi-index.csv out/soong/hiddenapi/hiddenapi-unsupported.csv
      - make sure that they are not changed by this change.
Change-Id: I420b7d07aea85af6372cd7580a8be5e2cc82a513
2021-06-09 14:02:03 +01:00
Jingwen Chen
1d6904e37d Merge "bp2build: build libc.so." am: a4d9b86c8b
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1726611

Change-Id: Ibc1397d23f3b033507caf6540b4b38db817b951b
2021-06-09 08:21:14 +00:00
Jingwen Chen
a4d9b86c8b Merge "bp2build: build libc.so." 2021-06-09 08:05:20 +00:00
Treehugger Robot
f026cd57df Merge "Only store what's used in SharedLibraryInfo" am: 75851d2fb6
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1730553

Change-Id: I9ef1100bc430cffaa4d44f8a906ee7f41ec4c16b
2021-06-09 06:06:23 +00:00
Treehugger Robot
75851d2fb6 Merge "Only store what's used in SharedLibraryInfo" 2021-06-09 05:49:15 +00:00