* changes:
[automerged blank] Only output annotations properties in snapshots for T+ 2p: 7a57bb1063
Only output annotations properties in snapshots for T+
* changes:
[automerged blank] Allow pruning of unsupported fields in structs in maps 2p: 56f266d22c
Allow pruning of unsupported fields in structs in maps
* 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
Previously this would result in a Ninja variable lookup, instead, let's
error sooner in Soong.
Test: CI
Change-Id: Ib3e15dce84364e6f7a83b82cb5f0e8694ffc9d2a
* 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
Use dependencies instead of libflags to link libclang_rt.builtins
and libclang_rt.ubsan_minimal.
Test: m checkbuild
Change-Id: I403cee0fb8cc21c347b42d8f8a3c20d6f43337a4
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
Add musl_<arch> and glibc_<arch> properties similar to bionic_<arch>.
Bug: 215802826
Test: m checkbuild
Change-Id: Icfc42ad7b54ee1052f84a46b7c0acffb0a27b236
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
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)
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)
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)
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)
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)
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)
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)