From 22152f6cdac24347537c34b5ca26155a69c70af7 Mon Sep 17 00:00:00 2001 From: Kiyoung Kim Date: Fri, 24 May 2024 10:45:28 +0900 Subject: [PATCH] Remove VndkUseCoreVariant related code from build VndkUseCoreVariant feature is deprecated along with VNDK. This change removes related code from Soong. Bug: 330100430 Test: AOSP CF build succeeded Change-Id: Ie182c9e4dc9cf0a4fe9d5fddf5b36754ddb53d18 --- android/config.go | 4 ---- android/variable.go | 1 - cc/androidmk.go | 9 --------- cc/cc.go | 26 +------------------------ cc/config/Android.bp | 1 - cc/config/vndk.go | 45 -------------------------------------------- cc/library.go | 26 ------------------------- cc/linkable.go | 1 - cc/vndk.go | 44 +++++-------------------------------------- rust/rust.go | 4 ---- 10 files changed, 6 insertions(+), 155 deletions(-) delete mode 100644 cc/config/vndk.go diff --git a/android/config.go b/android/config.go index 600745162..2d32f1cf2 100644 --- a/android/config.go +++ b/android/config.go @@ -1466,10 +1466,6 @@ func (c *deviceConfig) ExtraVndkVersions() []string { return c.config.productVariables.ExtraVndkVersions } -func (c *deviceConfig) VndkUseCoreVariant() bool { - return Bool(c.config.productVariables.VndkUseCoreVariant) && Bool(c.config.productVariables.KeepVndk) -} - func (c *deviceConfig) SystemSdkVersions() []string { return c.config.productVariables.DeviceSystemSdkVersions } diff --git a/android/variable.go b/android/variable.go index a3fdafb77..779f6a1f8 100644 --- a/android/variable.go +++ b/android/variable.go @@ -362,7 +362,6 @@ type ProductVariables struct { PgoAdditionalProfileDirs []string `json:",omitempty"` - VndkUseCoreVariant *bool `json:",omitempty"` VndkSnapshotBuildArtifacts *bool `json:",omitempty"` DirectedVendorSnapshot bool `json:",omitempty"` diff --git a/cc/androidmk.go b/cc/androidmk.go index 0c6f97c34..e1bc33669 100644 --- a/cc/androidmk.go +++ b/cc/androidmk.go @@ -261,15 +261,6 @@ func (library *libraryDecorator) AndroidMkEntries(ctx AndroidMkContext, entries if library.coverageOutputFile.Valid() { entries.SetString("LOCAL_PREBUILT_COVERAGE_ARCHIVE", library.coverageOutputFile.String()) } - - if library.useCoreVariant { - entries.SetBool("LOCAL_UNINSTALLABLE_MODULE", true) - entries.SetBool("LOCAL_NO_NOTICE_FILE", true) - entries.SetBool("LOCAL_VNDK_DEPEND_ON_CORE_VARIANT", true) - } - if library.checkSameCoreVariant { - entries.SetBool("LOCAL_CHECK_SAME_VNDK_VARIANTS", true) - } }) if library.shared() && !library.buildStubs() { diff --git a/cc/cc.go b/cc/cc.go index a64775d5f..cb82f8610 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -374,10 +374,6 @@ type BaseProperties struct { // build system and source tree. Cmake_snapshot_supported *bool - // Even if DeviceConfig().VndkUseCoreVariant() is set, this module must use vendor variant. - // see soong/cc/config/vndk.go - MustUseVendorVariant bool `blueprint:"mutated"` - Installable *bool `android:"arch_variant"` // Set by factories of module types that can only be referenced from variants compiled against @@ -479,10 +475,6 @@ type VendorProperties struct { // IsLLNDK is set to true for the vendor variant of a cc_library module that has LLNDK stubs. IsLLNDK bool `blueprint:"mutated"` - // IsVNDKUsingCoreVariant is true for VNDK modules if the global VndkUseCoreVariant option is - // set and the module is not listed in VndkMustUseVendorVariantList. - IsVNDKUsingCoreVariant bool `blueprint:"mutated"` - // IsVNDKCore is set if a VNDK module does not set the vndk.support_system_process property. IsVNDKCore bool `blueprint:"mutated"` @@ -548,7 +540,6 @@ type ModuleContextIntf interface { apexVariationName() string apexSdkVersion() android.ApiLevel bootstrap() bool - mustUseVendorVariant() bool nativeCoverage() bool directlyInAnyApex() bool isPreventInstall() bool @@ -1472,10 +1463,6 @@ func (c *Module) SubName() string { return c.Properties.SubName } -func (c *Module) MustUseVendorVariant() bool { - return c.IsVndkSp() || c.Properties.MustUseVendorVariant -} - func (c *Module) getVndkExtendsModuleName() string { if vndkdep := c.vndkdep; vndkdep != nil { return vndkdep.getVndkExtendsModuleName() @@ -1768,10 +1755,6 @@ func (ctx *moduleContextImpl) IsVendorPublicLibrary() bool { return ctx.mod.IsVendorPublicLibrary() } -func (ctx *moduleContextImpl) mustUseVendorVariant() bool { - return ctx.mod.MustUseVendorVariant() -} - func (ctx *moduleContextImpl) selectedStl() string { if stl := ctx.mod.stl; stl != nil { return stl.Properties.SelectedStl @@ -3648,12 +3631,7 @@ func MakeLibName(ctx android.ModuleContext, c LinkableInterface, ccDep LinkableI } } - if ctx.DeviceConfig().VndkUseCoreVariant() && ccDep.IsVndk() && !ccDep.MustUseVendorVariant() && - !c.InRamdisk() && !c.InVendorRamdisk() && !c.InRecovery() { - // The vendor module is a no-vendor-variant VNDK library. Depend on the - // core module instead. - return libName - } else if ccDep.InVendorOrProduct() && nonSystemVariantsExist { + if ccDep.InVendorOrProduct() && nonSystemVariantsExist { // The vendor and product modules in Make will have been renamed to not conflict with the // core module, so update the dependency name here accordingly. return libName + ccDep.SubName() @@ -3866,8 +3844,6 @@ func GetMakeLinkType(actx android.ModuleContext, c LinkableInterface) string { // TODO(b/114741097): use the correct ndk stl once build errors have been fixed //family, link := getNdkStlFamilyAndLinkType(c) //return fmt.Sprintf("native:ndk:%s:%s", family, link) - } else if actx.DeviceConfig().VndkUseCoreVariant() && !c.MustUseVendorVariant() { - return "native:platform_vndk" } else { return "native:platform" } diff --git a/cc/config/Android.bp b/cc/config/Android.bp index fdc94ada8..289409fb3 100644 --- a/cc/config/Android.bp +++ b/cc/config/Android.bp @@ -15,7 +15,6 @@ bootstrap_go_package { "global.go", "tidy.go", "toolchain.go", - "vndk.go", "bionic.go", diff --git a/cc/config/vndk.go b/cc/config/vndk.go deleted file mode 100644 index dd612ce63..000000000 --- a/cc/config/vndk.go +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright 2019 Google Inc. All rights reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package config - -// List of VNDK libraries that have different core variant and vendor variant. -// For these libraries, the vendor variants must be installed even if the device -// has VndkUseCoreVariant set. -// Note that AIDL-generated modules must use vendor variants by default. -var VndkMustUseVendorVariantList = []string{ - "android.hardware.nfc@1.2", - "libbinder", - "libcrypto", - "libexpat", - "libgatekeeper", - "libgui", - "libhidlcache", - "libkeymaster_messages", - "libkeymaster_portable", - "libmedia_omx", - "libpuresoftkeymasterdevice", - "libselinux", - "libsoftkeymasterdevice", - "libsqlite", - "libssl", - "libstagefright_bufferpool@2.0", - "libstagefright_bufferqueue_helper", - "libstagefright_foundation", - "libstagefright_omx", - "libstagefright_omx_utils", - "libstagefright_xmlparser", - "libui", - "libxml2", -} diff --git a/cc/library.go b/cc/library.go index b9018a7cf..b9c1466b6 100644 --- a/cc/library.go +++ b/cc/library.go @@ -419,11 +419,6 @@ type libraryDecorator struct { postInstallCmds []string - // If useCoreVariant is true, the vendor variant of a VNDK library is - // not installed. - useCoreVariant bool - checkSameCoreVariant bool - skipAPIDefine bool // Decorated interfaces @@ -1767,27 +1762,6 @@ func (library *libraryDecorator) install(ctx ModuleContext, file android.Path) { } } - // In some cases we want to use core variant for VNDK-Core libs. - // Skip product variant since VNDKs use only the vendor variant. - if ctx.isVndk() && !ctx.isVndkSp() && !ctx.IsVndkExt() && !ctx.inProduct() { - mayUseCoreVariant := true - - if ctx.mustUseVendorVariant() { - mayUseCoreVariant = false - } - - if ctx.Config().CFIEnabledForPath(ctx.ModuleDir()) { - mayUseCoreVariant = false - } - - if mayUseCoreVariant { - library.checkSameCoreVariant = true - if ctx.DeviceConfig().VndkUseCoreVariant() { - library.useCoreVariant = true - } - } - } - // do not install vndk libs // vndk libs are packaged into VNDK APEX if ctx.isVndk() && !ctx.IsVndkExt() && !ctx.Config().IsVndkDeprecated() && !ctx.inProduct() { diff --git a/cc/linkable.go b/cc/linkable.go index 5579aaea5..fecc6a2e6 100644 --- a/cc/linkable.go +++ b/cc/linkable.go @@ -165,7 +165,6 @@ type LinkableInterface interface { // IsVndkSp returns true if this is a VNDK-SP module. IsVndkSp() bool - MustUseVendorVariant() bool IsVndk() bool IsVndkExt() bool IsVndkPrivate() bool diff --git a/cc/vndk.go b/cc/vndk.go index 548992d37..ea55835e4 100644 --- a/cc/vndk.go +++ b/cc/vndk.go @@ -20,7 +20,6 @@ import ( "strings" "android/soong/android" - "android/soong/cc/config" "android/soong/etc" "github.com/google/blueprint" @@ -219,11 +218,10 @@ func vndkIsVndkDepAllowed(from *vndkdep, to *vndkdep) error { type moduleListerFunc func(ctx android.SingletonContext) (moduleNames, fileNames []string) var ( - vndkSPLibraries = vndkModuleLister(func(m *Module) bool { return m.VendorProperties.IsVNDKSP }) - vndkCoreLibraries = vndkModuleLister(func(m *Module) bool { return m.VendorProperties.IsVNDKCore }) - vndkPrivateLibraries = vndkModuleLister(func(m *Module) bool { return m.VendorProperties.IsVNDKPrivate }) - vndkProductLibraries = vndkModuleLister(func(m *Module) bool { return m.VendorProperties.IsVNDKProduct }) - vndkUsingCoreVariantLibraries = vndkModuleLister(func(m *Module) bool { return m.VendorProperties.IsVNDKUsingCoreVariant }) + vndkSPLibraries = vndkModuleLister(func(m *Module) bool { return m.VendorProperties.IsVNDKSP }) + vndkCoreLibraries = vndkModuleLister(func(m *Module) bool { return m.VendorProperties.IsVNDKCore }) + vndkPrivateLibraries = vndkModuleLister(func(m *Module) bool { return m.VendorProperties.IsVNDKPrivate }) + vndkProductLibraries = vndkModuleLister(func(m *Module) bool { return m.VendorProperties.IsVNDKProduct }) ) // vndkModuleLister takes a predicate that operates on a Module and returns a moduleListerFunc @@ -266,22 +264,6 @@ func vndkModuleListRemover(lister moduleListerFunc, prefix string) moduleListerF } } -var vndkMustUseVendorVariantListKey = android.NewOnceKey("vndkMustUseVendorVariantListKey") - -func vndkMustUseVendorVariantList(cfg android.Config) []string { - return cfg.Once(vndkMustUseVendorVariantListKey, func() interface{} { - return config.VndkMustUseVendorVariantList - }).([]string) -} - -// test may call this to override global configuration(config.VndkMustUseVendorVariantList) -// when it is called, it must be before the first call to vndkMustUseVendorVariantList() -func setVndkMustUseVendorVariantListForTest(config android.Config, mustUseVendorVariantList []string) { - config.Once(vndkMustUseVendorVariantListKey, func() interface{} { - return mustUseVendorVariantList - }) -} - func processVndkLibrary(mctx android.BottomUpMutatorContext, m *Module) { if m.InProduct() { // We may skip the steps for the product variants because they @@ -301,13 +283,6 @@ func processVndkLibrary(mctx android.BottomUpMutatorContext, m *Module) { mctx.PropertyErrorf("vndk.enabled", "This library provides stubs. Shouldn't be VNDK. Consider making it as LLNDK") } - if inList(name, vndkMustUseVendorVariantList(mctx.Config())) { - m.Properties.MustUseVendorVariant = true - } - if mctx.DeviceConfig().VndkUseCoreVariant() && !m.Properties.MustUseVendorVariant { - m.VendorProperties.IsVNDKUsingCoreVariant = true - } - if m.vndkdep.isVndkSp() { m.VendorProperties.IsVNDKSP = true } else { @@ -356,8 +331,7 @@ func IsForVndkApex(mctx android.BottomUpMutatorContext, m *Module) bool { if lib.buildStubs() { return false } - useCoreVariant := mctx.DeviceConfig().VndkUseCoreVariant() && !m.MustUseVendorVariant() - return lib.shared() && m.InVendor() && m.IsVndk() && !m.IsVndkExt() && !useCoreVariant + return lib.shared() && m.InVendor() && m.IsVndk() && !m.IsVndkExt() } return false } @@ -400,7 +374,6 @@ func RegisterVndkLibraryTxtTypes(ctx android.RegistrationContext) { ctx.RegisterParallelSingletonModuleType("vndkcore_libraries_txt", vndkCoreLibrariesTxtFactory) ctx.RegisterParallelSingletonModuleType("vndkprivate_libraries_txt", vndkPrivateLibrariesTxtFactory) ctx.RegisterParallelSingletonModuleType("vndkproduct_libraries_txt", vndkProductLibrariesTxtFactory) - ctx.RegisterParallelSingletonModuleType("vndkcorevariant_libraries_txt", vndkUsingCoreVariantLibrariesTxtFactory) } type vndkLibrariesTxt struct { @@ -453,13 +426,6 @@ func vndkProductLibrariesTxtFactory() android.SingletonModule { return newVndkLibrariesTxt(vndkProductLibraries, "VNDK_PRODUCT_LIBRARIES") } -// vndkcorevariant_libraries_txt is a singleton module whose content is a list of VNDK libraries -// that are using the core variant, generated by Soong but can be referenced by other modules. -// For example, apex_vndk can depend on these files as prebuilt. -func vndkUsingCoreVariantLibrariesTxtFactory() android.SingletonModule { - return newVndkLibrariesTxt(vndkUsingCoreVariantLibraries, "VNDK_USING_CORE_VARIANT_LIBRARIES") -} - func newVndkLibrariesWithMakeVarFilter(lister moduleListerFunc, makeVarName string, filter string) android.SingletonModule { m := &vndkLibrariesTxt{ lister: lister, diff --git a/rust/rust.go b/rust/rust.go index 93853e534..5790dd6e4 100644 --- a/rust/rust.go +++ b/rust/rust.go @@ -341,10 +341,6 @@ func (mod *Module) Bootstrap() bool { return Bool(mod.Properties.Bootstrap) } -func (mod *Module) MustUseVendorVariant() bool { - return true -} - func (mod *Module) SubName() string { return mod.Properties.SubName }