Commit Graph

46175 Commits

Author SHA1 Message Date
Paul Duffin
3866b89d15 Make RuleBuilder fail fast when passed a nil Path
Previously, the RuleBuilder would add all supplied Paths directly to
one of its lists of Paths without checking to make sure it was not nil
only to panic somewhere in its Build() method when it attempted to
convert it to a string. Deferring the failure made it harder to debug.
This change fails fast by checking every Path when it is passed to the
RuleBuilder.

Test: m nothing
Change-Id: I06b35da02101f6dfab80d2daaf3d8e44ded8b6be
2021-10-04 12:56:10 +01:00
Paul Duffin
4af54d88fa Remove unnecessary additionalCheckedModules field am: 0b58fdb058 am: 6c68db45d3
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1842815

Change-Id: Ic0b41ae1d3af825d685e8f5df3b9404499f98092
2021-10-04 11:24:18 +00:00
Paul Duffin
6c68db45d3 Remove unnecessary additionalCheckedModules field am: 0b58fdb058
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1842815

Change-Id: Ic6e55395138cfed7257529b2c5165bb4907460e1
2021-10-04 11:11:47 +00:00
Paul Duffin
0b58fdb058 Remove unnecessary additionalCheckedModules field
This change removes the field and the code that uses it which is
effectively dead code as it only does something when the list is not
empty and a previous change removed the only code that added a Path to
this list.

Bug: 201753898
Test: m nothing
Change-Id: I67c74ad2a3b115fd3b20b3b416f45b92c749749c
2021-10-04 10:42:56 +01:00
Paul Duffin
39abf8f387 Retry: Support generating sdk snapshot for specific build release
This was reverted unnecessarily along with the change that actually
broke the build.

Previously, the sdk snapshot was assumed to be generated for the
current build system. This change adds support for the
SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE environment variable which can
be used to select the target build release in which the generated
snapshot will be used.

At the moment this will only affect the properties that are output but
if/when it becomes necessary it can also be used to control more
aspects of the snapshots such as supported member types or even
members.

This change does not modify any properties that are build release
specific. That will come in following changes. However, it does add a
test that targets build release S which defines a baseline for
properties that will be affected in following changes. That baseline
makes it easier to see the effect of those follow up changes.

Bug: 197842263
Test: m nothing
Change-Id: If4b452237f105382550d2842c8010249afbc7432
2021-10-04 10:28:31 +01:00
Salmax Chang
9386534350 Merge changes from topic "bb_201948713" am: 8bb9c6a1d9 am: 12d6b80da2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1844137

Change-Id: Ied3bf607361fda73fa511373ce600bdd26d49c6f
2021-10-04 08:28:23 +00:00
Salmax Chang
12d6b80da2 Merge changes from topic "bb_201948713" am: 8bb9c6a1d9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1844137

Change-Id: Ia042b5b24141be4ebfa17ab15adf34c3af632635
2021-10-04 08:13:19 +00:00
Salmax Chang
8bb9c6a1d9 Merge changes from topic "bb_201948713"
* changes:
  Revert "Support generating sdk snapshot for specific build release"
  Revert "Separate hidden API flags needed in sdk snapshots for S and T"
2021-10-04 07:53:19 +00:00
Salmax Chang
203ec0139b Revert "Support generating sdk snapshot for specific build release"
This reverts commit ef2df587be.

Reason for revert: suspect to cause build break in b/201948713

Change-Id: If46219746913bec87ca2030ba51a6094246a0211
2021-10-04 05:41:37 +00:00
Salmax Chang
8194d61ae0 Revert "Separate hidden API flags needed in sdk snapshots for S and T"
This reverts commit ba68c93630.

Reason for revert: suspect to cause build break in b/201948713

Change-Id: Ide3693ac1f8e24bd2f7c12857361885cb6b787ef
2021-10-04 05:28:58 +00:00
Paul Duffin
0385ea00cb Merge "Separate hidden API flags needed in sdk snapshots for S and T" am: 6b383e9ef2 am: afe55d6598
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1835222

Change-Id: I3f4688a053f75da003086e65203ae651b44330a0
2021-10-02 11:49:50 +00:00
Paul Duffin
2270e68ac4 Merge "Support generating sdk snapshot for specific build release" am: b9031281c5 am: 159d072511
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1835221

Change-Id: Ibcfc224ddde76043ee0bf81c3bf6425d61b9a650
2021-10-02 11:49:46 +00:00
Paul Duffin
b6da79aae4 Merge "Support pruning properties by build release" am: 74b370a04e am: 41d22c612e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1835220

Change-Id: I5321ada38e9db0d3979ae4ed9f59fbe91c2c1057
2021-10-02 11:49:41 +00:00
Paul Duffin
249c378ec4 Merge "Support handling build releases in sdk snapshot" am: 0a9054e55d am: de2b0584d5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1835219

Change-Id: Ie8aef311bdde4cc344a913c569e124492cdd253c
2021-10-02 11:49:36 +00:00
Paul Duffin
0c89f5fb04 Merge "Always perform permitted package check when building a library" am: f7db6ebaa1 am: 7f04fb7dbc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1842459

Change-Id: I6e6f0cb3938671550d3d38fb0901bd09fc9e7ff6
2021-10-02 11:49:30 +00:00
Paul Duffin
afe55d6598 Merge "Separate hidden API flags needed in sdk snapshots for S and T" am: 6b383e9ef2
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1835222

Change-Id: I092500dc977cc482a6c662ae9fcd4e71fea32810
2021-10-02 11:34:00 +00:00
Paul Duffin
159d072511 Merge "Support generating sdk snapshot for specific build release" am: b9031281c5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1835221

Change-Id: Ie25946bd06a69d4171fe7069a285b9904f567b06
2021-10-02 11:33:53 +00:00
Paul Duffin
41d22c612e Merge "Support pruning properties by build release" am: 74b370a04e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1835220

Change-Id: I0fa680307de14d3ed74cb85c19a8d46d021e0a36
2021-10-02 11:33:46 +00:00
Paul Duffin
de2b0584d5 Merge "Support handling build releases in sdk snapshot" am: 0a9054e55d
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1835219

Change-Id: Ia6f47f39c2efd0aae19a646eafbf90f620995547
2021-10-02 11:33:40 +00:00
Paul Duffin
7f04fb7dbc Merge "Always perform permitted package check when building a library" am: f7db6ebaa1
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1842459

Change-Id: I8be5f7deb33b67b5307cb3a4551f659414a3aee9
2021-10-02 11:33:32 +00:00
Paul Duffin
6b383e9ef2 Merge "Separate hidden API flags needed in sdk snapshots for S and T" 2021-10-02 11:27:45 +00:00
Paul Duffin
b9031281c5 Merge "Support generating sdk snapshot for specific build release" 2021-10-02 11:25:41 +00:00
Paul Duffin
74b370a04e Merge "Support pruning properties by build release" 2021-10-02 11:23:21 +00:00
Paul Duffin
0a9054e55d Merge "Support handling build releases in sdk snapshot" 2021-10-02 11:21:47 +00:00
Paul Duffin
f7db6ebaa1 Merge "Always perform permitted package check when building a library" 2021-10-02 11:18:48 +00:00
Treehugger Robot
3c4cfc88ad Merge "Preopt APEX system server jars for java_import." am: 6f0c1a1e0c am: 3b54c2b055
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1840056

Change-Id: I20f3fb10681a6135d24690ae7d2eeefd4902a76a
2021-10-02 04:02:45 +00:00
Treehugger Robot
3b54c2b055 Merge "Preopt APEX system server jars for java_import." am: 6f0c1a1e0c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1840056

Change-Id: Ifc6895e47d0e7e6ed7d593a9d5d767f6cd2cf566
2021-10-02 03:48:25 +00:00
Treehugger Robot
6f0c1a1e0c Merge "Preopt APEX system server jars for java_import." 2021-10-02 03:33:22 +00:00
Christopher Parsons
22fadd81f2 Merge "bp2build: Handle target.linux" am: d6558d15bc am: 86a0c43017
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1843713

Change-Id: I73808b4e0ed102c4345a4ef31a2488942f7e3c9b
2021-10-01 22:21:33 +00:00
Christopher Parsons
86a0c43017 Merge "bp2build: Handle target.linux" am: d6558d15bc
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1843713

Change-Id: I89c7a1211cd22141b42333ad2c55e24b5caa6584
2021-10-01 22:08:28 +00:00
Chris Parsons
c39f63358b Remove out-of-date items from bp2build denylist
Test: mixed_droid CI
Change-Id: Ic51cf7ed193641882dbe0018818d8e3bcab53507
2021-10-01 18:01:11 -04:00
Christopher Parsons
d6558d15bc Merge "bp2build: Handle target.linux" 2021-10-01 21:54:16 +00:00
Treehugger Robot
3f13df71a7 Merge "Have python_*{,_host} handle arch-variants" am: e9f157a07c am: aca7d9ebc9
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1830633

Change-Id: I57ae109549064472bf84b5ee0b325582287eed56
2021-10-01 21:06:53 +00:00
Treehugger Robot
aca7d9ebc9 Merge "Have python_*{,_host} handle arch-variants" am: e9f157a07c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1830633

Change-Id: Ic31cfbbdc11cc22f2cae9617c4342f4764c0b0c5
2021-10-01 20:51:31 +00:00
Treehugger Robot
e9f157a07c Merge "Have python_*{,_host} handle arch-variants" 2021-10-01 20:36:53 +00:00
Alex Márquez Pérez Muñíz Díaz Púras Thaureaux
19d399d4c5 Have python_*{,_host} handle arch-variants
Bug: 196081778
Test: TestPython*{,Host}ArchVariance
Test: go test
Test: mixed_{libc,droid}.sh
Change-Id: I89304e58f5bacd61534732bade4ad6bb5f2671c0
2021-10-01 19:51:02 +00:00
Chris Parsons
2dde0cb3de bp2build: Handle target.linux
Also refactor target.bionic to be handled not as its own configuration
axis, but instead to be grouped into os selects handling.

This allows us to remove libbase and its dependencies from the bp2build
denylist.

Test: mixed_droid.sh CI
Change-Id: I92f30074d286306207653fe37589835ae3db16c4
2021-10-01 14:56:39 -04:00
Colin Cross
6625d51343 Merge changes from topics "bp-bionic-cts-tests", "cts-per-testcase-directory" am: 2df9ebf9ca am: 10ef62ea67
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1838375

Change-Id: I814d7f044a7db960e62e7b686eaf6682fe546582
2021-10-01 17:03:23 +00:00
Colin Cross
10ef62ea67 Merge changes from topics "bp-bionic-cts-tests", "cts-per-testcase-directory" am: 2df9ebf9ca
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1838375

Change-Id: I9fd93be8154f2f1372ccde1eb9a37690738692b7
2021-10-01 16:46:26 +00:00
Paul Duffin
ba68c93630 Separate hidden API flags needed in sdk snapshots for S and T
Previously, the behavior of the stub_flags and all_flags properties
was different between S and T. In S they contained paths for the
complete set of stub flags and all the encoded flags. However, in T
they contained filtered sets of flags which if used in S would prevent
build checks from detecting possible inconsistencies. Also, a new
signature_patterns property was added in T that is not supported in S.

This change creates separate properties/files for T and reverts the
behavior of the properties/files that were added in S back to how they
behaved in S. The new properties are called filtered_stub_flags and
filtered_flags.

The S and T properties are tagged with the appropriate
supported_build_releases tag to ensure that they are only output when
specifically targeted.

Bug: 197842263
Test: m nothing
Change-Id: Iec8b9c539796c507245b69c0aed980fde6d8694f
2021-10-01 17:28:13 +01:00
Colin Cross
2df9ebf9ca Merge changes from topics "bp-bionic-cts-tests", "cts-per-testcase-directory"
* changes:
  Add data_bins property
  Support per-testcase directories in all test suites
  Add environment variables to cc_genrule commands
2021-10-01 16:27:55 +00:00
Paul Duffin
ef2df587be Support generating sdk snapshot for specific build release
Previously, the sdk snapshot was assumed to be generated for the
current build system. This change adds support for the
SOONG_SDK_SNAPSHOT_TARGET_BUILD_RELEASE environment variable which can
be used to select the target build release in which the generated
snapshot will be used.

At the moment this will only affect the properties that are output but
if/when it becomes necessary it can also be used to control more
aspects of the snapshots such as supported member types or even
members.

This change does not modify any properties that are build release
specific. That will come in following changes. However, it does add a
test that targets build release S which defines a baseline for
properties that will be affected in following changes. That baseline
makes it easier to see the effect of those follow up changes.

Bug: 197842263
Test: m nothing
Change-Id: I5cfde5e9e86af522b0d5030d301e116b0233fd62
2021-10-01 17:27:03 +01:00
Paul Duffin
0c3acbfd72 Support pruning properties by build release
Adds a general mechanism for pruning selected sdk member properties
(i.e. setting their fields to their zero value) and uses that to prune
any properties that do not support a specified target build release.

Follow up changes will use that to allow building an sdk snapshot that
is compatible with previous release S.

Bug: 197842263
Test: m nothing
Change-Id: Ib949a9cfe85fff30f86228eeb15d3a45c073b037
2021-10-01 17:17:40 +01:00
Paul Duffin
1812294f32 Support handling build releases in sdk snapshot
Adds the following:
1. A buildRelease type to represent a single build release.
2. A buildReleaseSet type to represent a set of build releases.
3. Methods to create parse and use the previous new types.
4. Tests for the above.

Bug: 197842263
Test: m nothing
Change-Id: Ib0dd4fc32851a4fffde3fa02ea22c8369f8c2995
2021-10-01 17:17:34 +01:00
Liz Kammer
b5f64253fd Correct path for removing old bazel artifacts am: d7d5b72e4e am: 55f82b0f02
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1842591

Change-Id: Ia08675a6a565a0dfb9ed9afaa151e4e05791f31a
2021-10-01 15:51:47 +00:00
Liz Kammer
55f82b0f02 Correct path for removing old bazel artifacts am: d7d5b72e4e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1842591

Change-Id: I62f4c92912921fd0c372d8ce3eb5520561eec77e
2021-10-01 15:36:37 +00:00
Liz Kammer
d7d5b72e4e Correct path for removing old bazel artifacts
Test: mixed_libc.sh
Bug: 201767767
Change-Id: Ie34ac3a583dbefb6c4b79ea0756acef623116af7
2021-10-01 10:33:12 -04:00
Paul Duffin
08a18bf74a Always perform permitted package check when building a library
Previously, the permitted package check was designed to only be run
when building checkbuild. Although, that appears to now be broken.

This change uses a Validation dependency to ensure that the package
check is performed whenever the output file of a java_library is built
as part of the build. The package check runs in parallel with any other
rules that depend on the file.

Bug: 201753898
Test: - change the permitted_packages property in
        frameworks/base/test-mock so that the package check will fail.
      m out/soong/.intermediates/frameworks/base/test-mock/android.test.mock/android_common/package-check.stamp
      - as expected the package check failed.
      m droid
      - as expected the package check did not fail.
      # Made these changes then:
      m droid
      - as expected the package check now failed.
Change-Id: Id38fe280c79e5505ee4555b845c6da2ae6747bc4
2021-10-01 14:37:04 +01:00
Ulyana Trafimovich
9620d3392d Merge "Remove unused variable SKIP_BOOT_JARS_CHECK." am: 1b5262bd69 am: ab70bc55c5
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1841576

Change-Id: I6c1297fdf6df51c65edf14c8fb64b19a8e496268
2021-10-01 07:48:41 +00:00
Ulyana Trafimovich
ab70bc55c5 Merge "Remove unused variable SKIP_BOOT_JARS_CHECK." am: 1b5262bd69
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1841576

Change-Id: Ice0247fa07797d12f2c1911bee3569cffed5dee1
2021-10-01 07:34:21 +00:00