Commit graph

55319 commits

Author SHA1 Message Date
TreeHugger Robot
7e86fba978 Merge changes from topic "presubmit-am-1923eb98b7704419b4dc8bbce821ca98"
* changes:
  [automerged blank] Only output annotations properties in snapshots for T+ 2p: 7a57bb1063
  Only output annotations properties in snapshots for T+
2022-02-10 22:04:36 +00:00
TreeHugger Robot
ca4db42026 Merge changes from topic "presubmit-am-863381df2eaa41a6ae03e6b1dbaf11f6"
* changes:
  [automerged blank] Allow pruning of unsupported fields in structs in maps 2p: 56f266d22c
  Allow pruning of unsupported fields in structs in maps
2022-02-10 22:04:36 +00:00
TreeHugger Robot
69e86d10be Merge changes from topics "presubmit-am-e60ba8f5e98340bfbfe191d98cf5b6d1", "presubmit-am-e86fb84e9c4842e795f5aeaf8dca734c"
* changes:
  [automerged blank] Refactor build_release and test code 2p: 2f94ca5475
  Refactor build_release and test code
  Support generating sdk snapshot for specific build release
2022-02-10 22:04:36 +00:00
Liz Kammer
f610a74f4c Add error message for unsupported x86 arch variant
Previously this would result in a Ninja variable lookup, instead, let's
error sooner in Soong.

Test: CI
Change-Id: Ib3e15dce84364e6f7a83b82cb5f0e8694ffc9d2a
2022-02-10 16:58:08 -05:00
TreeHugger Robot
6d89fe25a2 Merge changes from topic "presubmit-am-ea5f67cf943f4b34bcc3b8115fdab07e"
* changes:
  [automerged blank] Support pruning properties by build release 2p: 3ea9205285
  Support pruning properties by build release
2022-02-10 21:49:46 +00:00
TreeHugger Robot
3a700d3802 Merge "[automerged blank] Insert imageVariantSpecificInfo between arch and link info 2p: 3e7d3ca127" 2022-02-10 20:27:07 +00:00
TreeHugger Robot
02b7c1ac12 Merge "[automerged blank] Move setting of link type properties to linkPropertyInfo 2p: c566255300" 2022-02-10 20:27:07 +00:00
TreeHugger Robot
f9229dd4a8 Merge changes from topics "presubmit-am-3cd213450fbe4903859831794e2eda95", "presubmit-am-3d79652bde1242039c76f8ae2d2e85a3", "presubmit-am-ce683adfa04348eb8c23eb866757a54d"
* changes:
  [automerged blank] Support handling build releases in sdk snapshot 2p: 49171a4a70
  Support handling build releases in sdk snapshot
  Insert imageVariantSpecificInfo between arch and link info
  Move setting of link type properties to linkPropertyInfo
2022-02-10 20:27:07 +00:00
Treehugger Robot
01db042476 Merge "Update cqueries for bazel rules dir rename" am: c2cdd8ab73 am: ac8b11b22e am: 0d91173db8 am: 00877dde2c
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1979746

Change-Id: I44f81daa63ca95f71f628d7cc4d1ebd09ea01c16
2022-02-10 20:15:27 +00:00
Colin Cross
06c80eb851 Add builtins and minimal runtime as dependencies instead of flags
Use dependencies instead of libflags to link libclang_rt.builtins
and libclang_rt.ubsan_minimal.

Test: m checkbuild
Change-Id: I403cee0fb8cc21c347b42d8f8a3c20d6f43337a4
2022-02-10 11:50:31 -08:00
Colin Cross
72ee67659d Fix musl clang triple
Use x86_64-linux-musl and i686-linux-musl as the clang triple when
targeting musl.

Bug: 190084016
Test: m USE_HOST_MUSL=true host-native
Change-Id: Ibd19d9a5fbf4b67950745480d1e0ed8e02eeeba1
2022-02-10 11:50:31 -08:00
Treehugger Robot
00877dde2c Merge "Update cqueries for bazel rules dir rename" am: c2cdd8ab73 am: ac8b11b22e am: 0d91173db8
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1979746

Change-Id: I102f377f12ddd09a8cb15960db1807989bb0b88f
2022-02-10 19:38:40 +00:00
Colin Cross
1aa45b083e Add musl_<arch> and glibc_<arch> properties
Add musl_<arch> and glibc_<arch> properties similar to bionic_<arch>.

Bug: 215802826
Test: m checkbuild
Change-Id: Icfc42ad7b54ee1052f84a46b7c0acffb0a27b236
2022-02-10 11:36:31 -08:00
Colin Cross
9b698b68c9 Add libc_musl as a dependency of RuleBuilderCommand.BuiltTool
Assume calls to RuleBuilderCommand.BuiltTool may refer to a tool
that was built against musl libc, and add it as a dependency
so that it is copied into the sandbox.  This emulates the
behavior of compiling against glibc, which is available from the
host sysroot when running in the sandbox.

Bug: 190084016
Test: m USE_HOST_MUSL=true sdk-repo-build-tools
Change-Id: Ieafdcceb818f9c31595487aab3ffbafba1412b3a
2022-02-10 11:36:31 -08:00
Treehugger Robot
0d91173db8 Merge "Update cqueries for bazel rules dir rename" am: c2cdd8ab73 am: ac8b11b22e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1979746

Change-Id: Ie301a42bd1346e3a69c4dfc301b32306c1633557
2022-02-10 19:22:51 +00:00
Gurpreet Singh
aa858d405c Merge "Manifest Fixer Params code refactor" am: 7761de5d4e am: bdf5b8030e am: 5f93fb0f44 am: e692318fe0
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1979469

Change-Id: I2cd15fc63d2e9f96b081732236c1f8aed6bb30e3
2022-02-10 19:11:08 +00:00
Treehugger Robot
b2a4bb83a0 Merge "Update rustfmt.toml to 2021 edition" am: 187d283312 am: 1ceb58457f am: 1e8401a799 am: 87f153c71a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1977994

Change-Id: I15fcd0ff3b0f40cfc14e922807a536181f0e38d0
2022-02-10 19:10:12 +00:00
Treehugger Robot
ac8b11b22e Merge "Update cqueries for bazel rules dir rename" am: c2cdd8ab73
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1979746

Change-Id: I5a58c99e89a2c6c5d45aa244b63d28ad3a57e3c5
2022-02-10 19:04:54 +00:00
Gurpreet Singh
e692318fe0 Merge "Manifest Fixer Params code refactor" am: 7761de5d4e am: bdf5b8030e am: 5f93fb0f44
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1979469

Change-Id: I9434ed1d120c63c85425926b2951ab07a926174a
2022-02-10 18:50:26 +00:00
Treehugger Robot
87f153c71a Merge "Update rustfmt.toml to 2021 edition" am: 187d283312 am: 1ceb58457f am: 1e8401a799
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1977994

Change-Id: Ife5fdc8ecae37d2cff2b02514325b83cdc69bf3b
2022-02-10 18:49:34 +00:00
Treehugger Robot
c2cdd8ab73 Merge "Update cqueries for bazel rules dir rename" 2022-02-10 18:41:27 +00:00
Gurpreet Singh
5f93fb0f44 Merge "Manifest Fixer Params code refactor" am: 7761de5d4e am: bdf5b8030e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1979469

Change-Id: I86654c0f5ba939b7c8addb9dfc28596754f8e826
2022-02-10 18:39:26 +00:00
Gurpreet Singh
bdf5b8030e Merge "Manifest Fixer Params code refactor" am: 7761de5d4e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1979469

Change-Id: I9264bd97390c558ea728126bf16d0103f1f43949
2022-02-10 18:35:46 +00:00
Treehugger Robot
1e8401a799 Merge "Update rustfmt.toml to 2021 edition" am: 187d283312 am: 1ceb58457f
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1977994

Change-Id: I9498c6aea44516fbaeed84e87ef44e636aa7274b
2022-02-10 18:33:46 +00:00
Gurpreet Singh
7761de5d4e Merge "Manifest Fixer Params code refactor" 2022-02-10 18:22:30 +00:00
Treehugger Robot
1ceb58457f Merge "Update rustfmt.toml to 2021 edition" am: 187d283312
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1977994

Change-Id: I336967f3cfb906d15b005c623c2c3e7a18b8c2e8
2022-02-10 18:16:25 +00:00
Treehugger Robot
187d283312 Merge "Update rustfmt.toml to 2021 edition" 2022-02-10 17:56:47 +00:00
Presubmit Automerger Backend
0b88d0765b [automerged blank] Only output annotations properties in snapshots for T+ 2p: 7a57bb1063
Blank merge reason: Change-Id Ie59396287c08da77a6a1f15d4be202429e011e17 with SHA-1 a54016c3ba is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/16834488

Bug: 204763318
Change-Id: I248a0d146cb003e5cccaa1d3b4c3cad7aff0f60c
Merged-In: Ie59396287c08da77a6a1f15d4be202429e011e17
2022-02-10 17:50:51 +00:00
Presubmit Automerger Backend
3490e055ee [automerged blank] Allow pruning of unsupported fields in structs in maps 2p: 56f266d22c
Blank merge reason: Change-Id Id103f70f55d4202971321ef4925cbec4b55f8136 with SHA-1 106a3a4bec is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/16834487

Bug: 204763318
Change-Id: Iefb7118a0a3e1e08a7fbaf6ab5f95c9bb58d21cb
Merged-In: Id103f70f55d4202971321ef4925cbec4b55f8136
2022-02-10 17:50:51 +00:00
Presubmit Automerger Backend
0beaedd16a [automerged blank] Refactor build_release and test code 2p: 2f94ca5475
Blank merge reason: Change-Id I84dc99621497b7263e30466895b823eb02cb2b56 with SHA-1 545c59273d is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/16834486

Bug: 204763318
Change-Id: I058e7c444ba9215e152eaf0d00ef12cb7cd49d78
Merged-In: I84dc99621497b7263e30466895b823eb02cb2b56
2022-02-10 17:50:51 +00:00
Presubmit Automerger Backend
78bca34e4e [automerged blank] Support pruning properties by build release 2p: 3ea9205285
Blank merge reason: Change-Id Ib949a9cfe85fff30f86228eeb15d3a45c073b037 with SHA-1 0c3acbfd72 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/16834485

Bug: 197842263
Change-Id: Ic32a29d3517b5cf896e7706307b8273b9fa160c1
Merged-In: Ib949a9cfe85fff30f86228eeb15d3a45c073b037
2022-02-10 17:50:50 +00:00
Paul Duffin
02f766836c [automerged blank] Support generating sdk snapshot for specific build release 2p: 24c545e317
Blank merge reason: Change-Id I5cfde5e9e86af522b0d5030d301e116b0233fd62 with SHA-1 ef2df587be is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/16836905

Bug: 197842263
Change-Id: I564e82be4ab343eb9f89d9fb2ac7e90d878bc103
Merged-In: I5cfde5e9e86af522b0d5030d301e116b0233fd62
2022-02-10 17:50:49 +00:00
Paul Duffin
a4eb757537 [automerged blank] Insert imageVariantSpecificInfo between arch and link info 2p: 3e7d3ca127
Blank merge reason: Change-Id I1c187d814f44b2cb7607cd43a6b215134be0faad with SHA-1 b42fa67a47 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/16836904

Bug: 195754365
Change-Id: I209ea05c96e6f9938369a3d5c2f0a70eb0b5020a
Merged-In: I1c187d814f44b2cb7607cd43a6b215134be0faad
2022-02-10 17:50:48 +00:00
Paul Duffin
285d0f4b22 [automerged blank] Move setting of link type properties to linkPropertyInfo 2p: c566255300
Blank merge reason: Change-Id Ica90a42cd8e4a79251271164f137dcdf60b3bd55 with SHA-1 f68f85a3ca is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/16836903

Bug: 195754365
Change-Id: Ib08433fc5d8f6efa9c7e6fba1894221960b86601
Merged-In: Ica90a42cd8e4a79251271164f137dcdf60b3bd55
2022-02-10 17:50:48 +00:00
Presubmit Automerger Backend
ed941e8604 [automerged blank] Support handling build releases in sdk snapshot 2p: 49171a4a70
Blank merge reason: Change-Id Ib0dd4fc32851a4fffde3fa02ea22c8369f8c2995 with SHA-1 1812294f32 is in history

Original change: https://googleplex-android-review.googlesource.com/c/platform/build/soong/+/16834484

Bug: 197842263
Change-Id: If48dd617a56395b3db8ff134c3582e90bb269638
Merged-In: Ib0dd4fc32851a4fffde3fa02ea22c8369f8c2995
2022-02-10 17:50:48 +00:00
Paul Duffin
7a57bb1063 Only output annotations properties in snapshots for T+
Marks the `scopeProperties.AnnotationsZip` property as only being
supported on T builds and above.

Bug: 204763318
Test: m nothing
Merged-In: Ie59396287c08da77a6a1f15d4be202429e011e17
Change-Id: Ie59396287c08da77a6a1f15d4be202429e011e17
(cherry picked from commit a54016c3ba)
2022-02-10 17:29:58 +00:00
Paul Duffin
56f266d22c Allow pruning of unsupported fields in structs in maps
Adds support for traversing into a field that is of type:
   map[...]*struct{...}

This is needed to allow java_sdk_library to mark scope specific
properties, e.g. public.annotations as being target build release
specific.

It was necessary to change the Scope field from:
   Scope map[*apiScope]scopeProperties
to:
   Scope map[*apiScope]*scopeProperties

That is because there is no way in go to change the field of a struct
value of a map. i.e. you cannot do the following, not even using
reflection:
   Scope[apiScopePublic].AnnotationsZip = nil

Bug: 204763318
Test: m nothing
Merged-In: Id103f70f55d4202971321ef4925cbec4b55f8136
Change-Id: Id103f70f55d4202971321ef4925cbec4b55f8136
(cherry picked from commit 106a3a4bec)
2022-02-10 17:29:58 +00:00
Paul Duffin
2f94ca5475 Refactor build_release and test code
Minor restructuring of the build_release pruning code to make it easier
to add logic for handling fields of maps of structs. That includes:
1. Moving some code that is specific to clearing a selected field
   inside the associated if block.
2. Replacing an if with a switch.
3. Improving the error handling by separating the reporting of the
   container that broke from information about which field could not be
   set. That allows follow up code to provide information about the map
   key instead.

The tests were restructed by:
1. Switching from using AssertDeepEquals to compare the structs to
   comparing the output of marshalling the structs to JSON. That was
   for a couple of reasons. Firstly, because JSON will marshal (and so
   allow comparison of) the contents of pointers to structs whereas
   AssertDeepEquals will just compare the pointers themselves.
   Secondly, because JSON can pretty print the output and make it
   easier to read.
2. Using a func to create a new instance of the input structure for
   each test. That is to allow the test to modify the input structure,
   e.g. by clearing a field in a struct that is pointed to by a map.
   The test previously relied on the input structure being immutable
   and passed by value but a follow up change will change that by
   adding a map field that contains pointers to structs.

Bug: 204763318
Test: m nothing
Merged-In: I84dc99621497b7263e30466895b823eb02cb2b56
Change-Id: I84dc99621497b7263e30466895b823eb02cb2b56
(cherry picked from commit 545c59273d)
2022-02-10 17:29:58 +00:00
Paul Duffin
24c545e317 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
Merged-In: I5cfde5e9e86af522b0d5030d301e116b0233fd62
(cherry picked from commit ef2df587be)
2022-02-10 17:29:55 +00:00
Treehugger Robot
49c83cf6f5 Merge "Use Tiramisu instead of T in supported_build_releases" am: 52aad81d45 am: fcb871ac39 am: 5bf9b0691e am: b45e3d7b1a
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1979466

Change-Id: Ie9a5421b8e38f0643c5ea78ce75cf38ae85c02a5
2022-02-10 17:14:57 +00:00
Treehugger Robot
b45e3d7b1a Merge "Use Tiramisu instead of T in supported_build_releases" am: 52aad81d45 am: fcb871ac39 am: 5bf9b0691e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1979466

Change-Id: I7cafe524a8dbd8b7af91b5ebad1bd31829c2223b
2022-02-10 17:01:36 +00:00
Paul Duffin
3ea9205285 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
Merged-In: Ib949a9cfe85fff30f86228eeb15d3a45c073b037
Change-Id: Ib949a9cfe85fff30f86228eeb15d3a45c073b037
(cherry picked from commit 0c3acbfd72)
2022-02-10 16:55:22 +00:00
Paul Duffin
49171a4a70 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
Merged-In: Ib0dd4fc32851a4fffde3fa02ea22c8369f8c2995
Change-Id: Ib0dd4fc32851a4fffde3fa02ea22c8369f8c2995
(cherry picked from commit 1812294f32)
2022-02-10 16:55:22 +00:00
Paul Duffin
3e7d3ca127 Insert imageVariantSpecificInfo between arch and link info
Previously, the archTypeSpecificInfo included an array of
*linkTypeSpecificInfo. This change replaces that array with an array of
*imageVariantSpecificInfo which themselves contain an array of
*linkTypeSpecificInfo.

That allows the sdk snapshot to handle image variants correctly, i.e.
collate their properties, optimize their properties and then detect if
there are any image variant specific properties for any image variant
other than the CoreImageVariant ("") and report it as an error.

The latter case is treated as an error because while Soong needs to
handle image specific variants there is currently no requirement to
handle generating a prebuilt with image specific properties. A follow
up change will test the error handling.

Image specific variants are needed because the "jni_headers"
cc_library_headers module provides a number of image variants (e.g.
recovery) that are used outside the ART module. Therefore, the sdk
snapshot needs to do the same.

At the moment image variants like the recovery variant are supported by
copying the property that creates the variant (e.g. recovery_available)
through to the prebuilt but that is not safe for a couple of reasons:
1. It ignores any differences between the recovery variant and the
   other variants which could cause compatibility issues in modules
   that build against the prebuilts.
2. It marks modules in the snapshot with recovery_available even when
   they do not need it.

This change will allow follow up changes to address both those issues.

Bug: 195754365
Test: m nothing
Merged-In: I1c187d814f44b2cb7607cd43a6b215134be0faad
Change-Id: I1c187d814f44b2cb7607cd43a6b215134be0faad
(cherry picked from commit b42fa67a47)
2022-02-10 16:55:21 +00:00
Paul Duffin
c566255300 Move setting of link type properties to linkPropertyInfo
Bug: 195754365
Test: m nothing
Merged-In: Ica90a42cd8e4a79251271164f137dcdf60b3bd55
Change-Id: Ica90a42cd8e4a79251271164f137dcdf60b3bd55
(cherry picked from commit f68f85a3ca)
2022-02-10 16:55:21 +00:00
Treehugger Robot
5bf9b0691e Merge "Use Tiramisu instead of T in supported_build_releases" am: 52aad81d45 am: fcb871ac39
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1979466

Change-Id: I57d015db9976afaf5ca725e86807822c30614a23
2022-02-10 16:46:32 +00:00
Treehugger Robot
fcb871ac39 Merge "Use Tiramisu instead of T in supported_build_releases" am: 52aad81d45
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1979466

Change-Id: I79d59754a0b65fbdc96b10fd521564dd3211bcae
2022-02-10 16:28:46 +00:00
Gurpreet Singh
c8a8ffb1f0 Merge "Geneate AndroidManifest file if the apex_test module does not have one." am: 7fbe3c7f59 am: 82371b5ac2 am: 4971051525 am: 1fb15d2702
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1971344

Change-Id: I994dd16006c857fec39bd44ce355f560f3ba4427
2022-02-10 16:27:46 +00:00
Treehugger Robot
52aad81d45 Merge "Use Tiramisu instead of T in supported_build_releases" 2022-02-10 16:13:05 +00:00
Gurpreet Singh
1fb15d2702 Merge "Geneate AndroidManifest file if the apex_test module does not have one." am: 7fbe3c7f59 am: 82371b5ac2 am: 4971051525
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/1971344

Change-Id: I260611433e85f4c9dad86e8dd85c1f4ef56b0b97
2022-02-10 16:12:35 +00:00