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

@@ -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