Remove PlatformVndkVersion property

Platform VNDK version is no longer available based on VNDK deprecation.
Remove all code using Platform VNDK version.

Bug: 330100430
Test: AOSP CF build succeeded
Change-Id: I7d0f7e23eff5d153346890f242a94b78bad6736b
This commit is contained in:
Kiyoung Kim 2024-03-18 16:01:19 +09:00
parent 1db4a74a59
commit fa13ff194c
11 changed files with 21 additions and 160 deletions

View file

@ -1448,10 +1448,6 @@ func (c *deviceConfig) CurrentApiLevelForVendorModules() string {
return StringDefault(c.config.productVariables.DeviceCurrentApiLevelForVendorModules, "current")
}
func (c *deviceConfig) PlatformVndkVersion() string {
return String(c.config.productVariables.Platform_vndk_version)
}
func (c *deviceConfig) ExtraVndkVersions() []string {
return c.config.productVariables.ExtraVndkVersions
}

View file

@ -209,7 +209,6 @@ type ProductVariables struct {
Platform_base_sdk_extension_version *int `json:",omitempty"`
Platform_version_active_codenames []string `json:",omitempty"`
Platform_version_all_preview_codenames []string `json:",omitempty"`
Platform_vndk_version *string `json:",omitempty"`
Platform_systemsdk_versions []string `json:",omitempty"`
Platform_security_patch *string `json:",omitempty"`
Platform_preview_sdk_version *string `json:",omitempty"`
@ -597,7 +596,6 @@ func (v *ProductVariables) SetDefaultConfig() {
Platform_sdk_final: boolPtr(false),
Platform_version_active_codenames: []string{"S"},
Platform_version_all_preview_codenames: []string{"S"},
Platform_vndk_version: stringPtr("S"),
HostArch: stringPtr("x86_64"),
HostSecondaryArch: stringPtr("x86"),

View file

@ -737,7 +737,7 @@ func (a *apexBundle) combineProperties(ctx android.BottomUpMutatorContext) {
// image variation name.
func (a *apexBundle) getImageVariationPair(deviceConfig android.DeviceConfig) (string, string) {
if a.vndkApex {
return cc.VendorVariationPrefix, a.vndkVersion(deviceConfig)
return cc.VendorVariationPrefix, a.vndkVersion()
}
prefix := android.CoreVariation
@ -746,9 +746,6 @@ func (a *apexBundle) getImageVariationPair(deviceConfig android.DeviceConfig) (s
if a.SocSpecific() || a.DeviceSpecific() {
prefix = cc.VendorVariationPrefix
vndkVersion = deviceConfig.VndkVersion()
} else if a.ProductSpecific() {
prefix = cc.ProductVariationPrefix
vndkVersion = deviceConfig.PlatformVndkVersion()
}
} else {
if a.SocSpecific() || a.DeviceSpecific() {
@ -757,9 +754,6 @@ func (a *apexBundle) getImageVariationPair(deviceConfig android.DeviceConfig) (s
prefix = cc.ProductVariation
}
}
if vndkVersion == "current" {
vndkVersion = deviceConfig.PlatformVndkVersion()
}
return prefix, vndkVersion
}

View file

@ -277,7 +277,7 @@ func (a *apexBundle) buildManifest(ctx android.ModuleContext, provideNativeLibs,
// VNDK APEX name is determined at runtime, so update "name" in apex_manifest
optCommands := []string{}
if a.vndkApex {
apexName := vndkApexNamePrefix + a.vndkVersion(ctx.DeviceConfig())
apexName := vndkApexNamePrefix + a.vndkVersion()
optCommands = append(optCommands, "-v name "+apexName)
}
@ -1043,7 +1043,7 @@ func (a *apexBundle) getOverrideManifestPackageName(ctx android.ModuleContext) s
if a.vndkApex {
overrideName, overridden := ctx.DeviceConfig().OverrideManifestPackageNameFor(vndkApexName)
if overridden {
return overrideName + ".v" + a.vndkVersion(ctx.DeviceConfig())
return overrideName + ".v" + a.vndkVersion()
}
return ""
}

View file

@ -45,16 +45,12 @@ func vndkApexBundleFactory() android.Module {
return bundle
}
func (a *apexBundle) vndkVersion(config android.DeviceConfig) string {
vndkVersion := proptools.StringDefault(a.vndkProperties.Vndk_version, "current")
if vndkVersion == "current" {
vndkVersion = config.PlatformVndkVersion()
}
return vndkVersion
func (a *apexBundle) vndkVersion() string {
return proptools.StringDefault(a.vndkProperties.Vndk_version, "current")
}
type apexVndkProperties struct {
// Indicates VNDK version of which this VNDK APEX bundles VNDK libs. Default is Platform VNDK Version.
// Indicates VNDK version of which this VNDK APEX bundles VNDK libs.
Vndk_version *string
}
@ -64,7 +60,7 @@ func apexVndkMutator(mctx android.TopDownMutatorContext) {
mctx.PropertyErrorf("native_bridge_supported", "%q doesn't support native bridge binary.", mctx.ModuleType())
}
vndkVersion := ab.vndkVersion(mctx.DeviceConfig())
vndkVersion := ab.vndkVersion()
if vndkVersion != "" {
apiLevel, err := android.ApiLevelFromUser(mctx, vndkVersion)
if err != nil {
@ -73,17 +69,9 @@ func apexVndkMutator(mctx android.TopDownMutatorContext) {
}
targets := mctx.MultiTargets()
if len(targets) > 0 && apiLevel.LessThan(cc.MinApiForArch(mctx, targets[0].Arch.ArchType)) &&
vndkVersion != mctx.DeviceConfig().PlatformVndkVersion() {
if len(targets) > 0 && apiLevel.LessThan(cc.MinApiForArch(mctx, targets[0].Arch.ArchType)) {
// Disable VNDK APEXes for VNDK versions less than the minimum supported API
// level for the primary architecture. This validation is skipped if the VNDK
// version matches the platform VNDK version, which can occur when the device
// config targets the 'current' VNDK (see `vndkVersion`).
ab.Disable()
}
if proptools.String(ab.vndkProperties.Vndk_version) != "" &&
mctx.DeviceConfig().PlatformVndkVersion() != "" &&
apiLevel.GreaterThanOrEqualTo(android.ApiLevelOrPanic(mctx, mctx.DeviceConfig().PlatformVndkVersion())) {
// level for the primary architecture.
ab.Disable()
}
}
@ -93,20 +81,11 @@ func apexVndkMutator(mctx android.TopDownMutatorContext) {
func apexVndkDepsMutator(mctx android.BottomUpMutatorContext) {
if m, ok := mctx.Module().(*cc.Module); ok && cc.IsForVndkApex(mctx, m) {
vndkVersion := m.VndkVersion()
// For VNDK-Lite device, we gather core-variants of VNDK-Sp libraries, which doesn't have VNDK version defined
if vndkVersion == "" {
vndkVersion = mctx.DeviceConfig().PlatformVndkVersion()
}
if vndkVersion == "" {
return
}
if vndkVersion == mctx.DeviceConfig().PlatformVndkVersion() {
vndkVersion = "current"
} else {
vndkVersion = "v" + vndkVersion
}
vndkVersion = "v" + vndkVersion
vndkApexName := "com.android.vndk." + vndkVersion

View file

@ -1896,9 +1896,6 @@ func getNameSuffixWithVndkVersion(ctx android.ModuleContext, c LinkableInterface
vndkVersion = ctx.DeviceConfig().VndkVersion()
nameSuffix = VendorSuffix
}
if vndkVersion == "current" {
vndkVersion = ctx.DeviceConfig().PlatformVndkVersion()
}
if c.VndkVersion() != vndkVersion && c.VndkVersion() != "" {
// add version suffix only if the module is using different vndk version than the
// version in product or vendor partition.

View file

@ -121,18 +121,7 @@ func (g *GenruleExtraProperties) ExtraImageVariations(ctx android.BaseModuleCont
}
} else {
if vendorVariantRequired {
// If vndkVersion is current, we can always use PlatformVndkVersion.
// If not, we assume modules under proprietary paths are compatible for
// BOARD_VNDK_VERSION. The other modules are regarded as AOSP, that is
// PLATFORM_VNDK_VERSION.
if vndkVersion == "current" || !snapshot.IsVendorProprietaryModule(ctx) {
variants = append(variants, VendorVariationPrefix+ctx.DeviceConfig().PlatformVndkVersion())
} else {
variants = append(variants, VendorVariationPrefix+vndkVersion)
}
}
if productVariantRequired {
variants = append(variants, ProductVariationPrefix+ctx.DeviceConfig().PlatformVndkVersion())
variants = append(variants, VendorVariationPrefix+vndkVersion)
}
}

View file

@ -429,7 +429,6 @@ func MutateImage(mctx android.BaseModuleContext, m ImageMutatableModule) {
var vendorVariants []string
var productVariants []string
platformVndkVersion := mctx.DeviceConfig().PlatformVndkVersion()
boardVndkVersion := mctx.DeviceConfig().VndkVersion()
recoverySnapshotVersion := mctx.DeviceConfig().RecoverySnapshotVersion()
usingRecoverySnapshot := recoverySnapshotVersion != "current" &&
@ -444,17 +443,13 @@ func MutateImage(mctx android.BaseModuleContext, m ImageMutatableModule) {
needVndkVersionVendorVariantForLlndk = boardVndkApiLevel.LessThanOrEqualTo(android.ApiLevelOrPanic(mctx, "30"))
}
}
if boardVndkVersion == "current" {
boardVndkVersion = platformVndkVersion
}
if m.NeedsLlndkVariants() {
// This is an LLNDK library. The implementation of the library will be on /system,
// and vendor and product variants will be created with LLNDK stubs.
// The LLNDK libraries need vendor variants even if there is no VNDK.
coreVariantNeeded = true
vendorVariants = append(vendorVariants, platformVndkVersion)
productVariants = append(productVariants, platformVndkVersion)
vendorVariants = append(vendorVariants, "")
productVariants = append(productVariants, "")
// Generate vendor variants for boardVndkVersion only if the VNDK snapshot does not
// provide the LLNDK stub libraries.
if needVndkVersionVendorVariantForLlndk {
@ -465,7 +460,7 @@ func MutateImage(mctx android.BaseModuleContext, m ImageMutatableModule) {
// for system and product.
coreVariantNeeded = true
vendorVariants = append(vendorVariants, boardVndkVersion)
productVariants = append(productVariants, platformVndkVersion)
productVariants = append(productVariants, "")
} else if m.IsSnapshotPrebuilt() {
// Make vendor variants only for the versions in BOARD_VNDK_VERSION and
// PRODUCT_EXTRA_VNDK_VERSIONS.
@ -486,13 +481,13 @@ func MutateImage(mctx android.BaseModuleContext, m ImageMutatableModule) {
if snapshot.IsVendorProprietaryModule(mctx) {
vendorVariants = append(vendorVariants, boardVndkVersion)
} else {
vendorVariants = append(vendorVariants, platformVndkVersion)
vendorVariants = append(vendorVariants, "")
}
}
// product_available modules are available to /product.
if m.HasProductVariant() {
productVariants = append(productVariants, platformVndkVersion)
productVariants = append(productVariants, "")
}
} else if vendorSpecific && m.SdkVersion() == "" {
// This will be available in /vendor (or /odm) only
@ -505,13 +500,13 @@ func MutateImage(mctx android.BaseModuleContext, m ImageMutatableModule) {
// are regarded as AOSP, which is PLATFORM_VNDK_VERSION.
if m.KernelHeadersDecorator() {
vendorVariants = append(vendorVariants,
platformVndkVersion,
"",
boardVndkVersion,
)
} else if snapshot.IsVendorProprietaryModule(mctx) {
vendorVariants = append(vendorVariants, boardVndkVersion)
} else {
vendorVariants = append(vendorVariants, platformVndkVersion)
vendorVariants = append(vendorVariants, "")
}
} else {
// This is either in /system (or similar: /data), or is a
@ -523,7 +518,7 @@ func MutateImage(mctx android.BaseModuleContext, m ImageMutatableModule) {
if coreVariantNeeded && productSpecific && m.SdkVersion() == "" {
// The module has "product_specific: true" that does not create core variant.
coreVariantNeeded = false
productVariants = append(productVariants, platformVndkVersion)
productVariants = append(productVariants, "")
}
if m.RamdiskAvailable() {

View file

@ -324,7 +324,7 @@ func (p *BaseSnapshotDecorator) SetSnapshotAndroidMkSuffix(ctx android.ModuleCon
variations = append(ctx.Target().Variations(), blueprint.Variation{
Mutator: "image",
Variation: ProductVariationPrefix + ctx.DeviceConfig().PlatformVndkVersion()})
Variation: ProductVariation})
if ctx.OtherModuleFarDependencyVariantExists(variations, ctx.Module().(LinkableInterface).BaseModuleName()) {
p.baseProperties.Androidmk_suffix = p.Image.moduleNameSuffix()

View file

@ -42,28 +42,6 @@ const (
)
func VndkLibrariesTxtModules(vndkVersion string, ctx android.BaseModuleContext) []string {
// Return the list of vndk txt files for the vndk apex of the vndkVersion.
if vndkVersion == "current" {
// We can assume all txt files are snapshotted if we find one of them.
currentVndkSnapshotted := ctx.OtherModuleExists(insertVndkVersion(llndkLibrariesTxt, ctx.DeviceConfig().PlatformVndkVersion()))
if currentVndkSnapshotted {
// If the current VNDK is already snapshotted (which can happen with
// the `next` config), use the prebuilt txt files in the snapshot.
// This is because the txt files built from source are probably be
// for the in-development version.
vndkVersion = ctx.DeviceConfig().PlatformVndkVersion()
} else {
// Use the txt files generated from the source
return []string{
llndkLibrariesTxtForApex,
vndkCoreLibrariesTxt,
vndkSpLibrariesTxt,
vndkPrivateLibrariesTxt,
vndkProductLibrariesTxt,
}
}
}
// Snapshot vndks have their own *.libraries.VER.txt files.
// Note that snapshots don't have "vndkcorevariant.libraries.VER.txt"
result := []string{
@ -376,15 +354,6 @@ func IsForVndkApex(mctx android.BottomUpMutatorContext, m *Module) bool {
if !p.MatchesWithDevice(mctx.DeviceConfig()) {
return false
}
platformVndkVersion := mctx.DeviceConfig().PlatformVndkVersion()
if platformVndkVersion != "" {
// ignore prebuilt vndk modules that are newer than or equal to the platform vndk version
platformVndkApiLevel := android.ApiLevelOrPanic(mctx, platformVndkVersion)
if platformVndkApiLevel.LessThanOrEqualTo(android.ApiLevelOrPanic(mctx, p.Version())) {
return false
}
}
}
if lib, ok := m.linker.(libraryInterface); ok {
@ -392,8 +361,7 @@ func IsForVndkApex(mctx android.BottomUpMutatorContext, m *Module) bool {
if lib.buildStubs() {
return false
}
useCoreVariant := m.VndkVersion() == mctx.DeviceConfig().PlatformVndkVersion() &&
mctx.DeviceConfig().VndkUseCoreVariant() && !m.MustUseVendorVariant()
useCoreVariant := mctx.DeviceConfig().VndkUseCoreVariant() && !m.MustUseVendorVariant()
return lib.shared() && m.InVendor() && m.IsVndk() && !m.IsVndkExt() && !useCoreVariant
}
return false
@ -548,22 +516,9 @@ func insertVndkVersion(filename string, vndkVersion string) string {
return filename
}
func (txt *vndkLibrariesTxt) DepsMutator(mctx android.BottomUpMutatorContext) {
versionedName := insertVndkVersion(txt.Name(), mctx.DeviceConfig().PlatformVndkVersion())
if mctx.OtherModuleExists(versionedName) {
// If the prebuilt vndk libraries txt files exist, install them instead.
txt.HideFromMake()
mctx.AddDependency(txt, nil, versionedName)
}
}
func (txt *vndkLibrariesTxt) GenerateAndroidBuildActions(ctx android.ModuleContext) {
filename := proptools.StringDefault(txt.properties.Stem, txt.Name())
if Bool(txt.properties.Insert_vndk_version) {
filename = insertVndkVersion(filename, ctx.DeviceConfig().PlatformVndkVersion())
}
txt.outputFile = android.PathForModuleOut(ctx, filename).OutputPath
installPath := android.PathForModuleInstall(ctx, "etc")
@ -639,34 +594,6 @@ type vndkSnapshotSingleton struct {
func isVndkSnapshotAware(config android.DeviceConfig, m LinkableInterface,
apexInfo android.ApexInfo) (vndkType string, isVndkSnapshotLib bool) {
if m.Target().NativeBridge == android.NativeBridgeEnabled {
return "", false
}
// !inVendor: There's product/vendor variants for VNDK libs. We only care about vendor variants.
// !installable: Snapshot only cares about "installable" modules.
// !m.IsLlndk: llndk stubs are required for building against snapshots.
// IsSnapshotPrebuilt: Snapshotting a snapshot doesn't make sense.
// !outputFile.Valid: Snapshot requires valid output file.
if !m.InVendor() || (!installable(m, apexInfo) && !m.IsLlndk()) || m.IsSnapshotPrebuilt() || !m.OutputFile().Valid() {
return "", false
}
if !m.IsSnapshotLibrary() || !m.Shared() {
return "", false
}
if m.VndkVersion() == config.PlatformVndkVersion() {
if m.IsVndk() && !m.IsVndkExt() {
if m.IsVndkSp() {
return "vndk-sp", true
} else {
return "vndk-core", true
}
} else if m.HasLlndkStubs() && m.StubsVersion() == "" {
// Use default version for the snapshot.
return "llndk-stub", true
}
}
return "", false
}
@ -679,10 +606,6 @@ func (c *vndkSnapshotSingleton) GenerateBuildActions(ctx android.SingletonContex
return
}
if ctx.DeviceConfig().PlatformVndkVersion() == "" {
return
}
var snapshotOutputs android.Paths
/*

View file

@ -131,16 +131,6 @@ func (p *vndkPrebuiltLibraryDecorator) singleSourcePath(ctx ModuleContext) andro
func (p *vndkPrebuiltLibraryDecorator) link(ctx ModuleContext,
flags Flags, deps PathDeps, objs Objects) android.Path {
platformVndkVersion := ctx.DeviceConfig().PlatformVndkVersion()
if platformVndkVersion != "" {
platformVndkApiLevel := android.ApiLevelOrPanic(ctx, platformVndkVersion)
if platformVndkApiLevel.LessThanOrEqualTo(android.ApiLevelOrPanic(ctx, p.Version())) {
// This prebuilt VNDK module is not required for the current build
ctx.Module().HideFromMake()
return nil
}
}
if !p.MatchesWithDevice(ctx.DeviceConfig()) {
ctx.Module().HideFromMake()
return nil