diff options
author | 2020-07-11 04:52:24 +0100 | |
---|---|---|
committer | 2020-08-03 21:06:50 +0100 | |
commit | caa47d7eed2f8d3504683e84b514f55fff0f6c0c (patch) | |
tree | 639d6252f4bbee793406ede23e042ec2c6036722 /android/sdk.go | |
parent | 0d333752cfe330e90a00f01356f393b6b4069547 (diff) |
Disable all host OS variants except those explicitly included.
Necessary to avoid problems with implicitly enabled host OS'es, e.g.
linux_glibc getting enabled when we only supply a linux_bionic linker
in runtime-module-host-exports. That will then cause a non-functional
prebuilt to take precedence over source if the prebuilt is preferred.
We don't do this for device since we so far only support a single
device OS (android).
This introduces the notion that SDK member types can be host OS
dependent or not. That way java members with host prebuilts don't get
restricted to a specific host OS.
Test: m nothing
Test: build/soong/scripts/build-aml-prebuilts.sh runtime-module-host-exports
Check that the generated Android.bp correctly disables the bionic
linker prebuilt for linux_glibc.
Test: art/build/apex/runtests.sh
on master-art with an updated runtime SDK snapshot
Test: art/tools/buildbot-build.sh {--host,--target}
on master-art with an updated runtime SDK snapshot
Bug: 160349757
Change-Id: Idad7ef138cdbcbd209d390bf6c10ca8365d4619f
Diffstat (limited to 'android/sdk.go')
-rw-r--r-- | android/sdk.go | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/android/sdk.go b/android/sdk.go index 28f5cd585..9ea7ff49c 100644 --- a/android/sdk.go +++ b/android/sdk.go @@ -327,6 +327,12 @@ type SdkMemberType interface { // SdkAware and be added with an SdkMemberTypeDependencyTag tag. HasTransitiveSdkMembers() bool + // Return true if prebuilt host artifacts may be specific to the host OS. Only + // applicable to modules where HostSupported() is true. If this is true, + // snapshots will list each host OS variant explicitly and disable all other + // host OS'es. + IsHostOsDependent() bool + // Add dependencies from the SDK module to all the module variants the member // type contributes to the SDK. `names` is the list of module names given in // the member type property (as returned by SdkPropertyName()) in the SDK @@ -389,6 +395,7 @@ type SdkMemberTypeBase struct { PropertyName string SupportsSdk bool TransitiveSdkMembers bool + HostOsDependent bool } func (b *SdkMemberTypeBase) SdkPropertyName() string { @@ -403,6 +410,10 @@ func (b *SdkMemberTypeBase) HasTransitiveSdkMembers() bool { return b.TransitiveSdkMembers } +func (b *SdkMemberTypeBase) IsHostOsDependent() bool { + return b.HostOsDependent +} + // Encapsulates the information about registered SdkMemberTypes. type SdkMemberTypesRegistry struct { // The list of types sorted by property name. |