From 95b24b1165963c80b78868bfafca3c56449f3ee2 Mon Sep 17 00:00:00 2001 From: Spandan Das Date: Mon, 26 Jun 2023 22:39:19 +0000 Subject: [PATCH] Remove special-casing of DCLA libraries This is a revert of aosp/2449906 mixed build currently supports platform and apex variants of allowlisted cc libraries. However when building apex variants, we would pass an apexKey only for allowlisted _dcla_ libraries. This meant that for libraries in mixed build allowlist but not in dcla allowlist, Soong's apex variants were being replaced with Bazel's platform variants. Bug: 270339610 Bug: 288906815 Test: Added libnativeloader, libartpalette-system to prod mixed build allowlist and `m` Change-Id: I922fed898b3c3961466cd1165c371839a4192237 --- android/bazel_handler.go | 16 +--------------- cc/cc.go | 3 --- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/android/bazel_handler.go b/android/bazel_handler.go index 4b1a8f491..d5ccfcad8 100644 --- a/android/bazel_handler.go +++ b/android/bazel_handler.go @@ -176,8 +176,6 @@ type BazelContext interface { // (for example, that it is MixedBuildBuildable). IsModuleNameAllowed(moduleName string, withinApex bool) bool - IsModuleDclaAllowed(moduleName string) bool - // Returns the bazel output base (the root directory for all bazel intermediate outputs). OutputBase() string @@ -316,10 +314,6 @@ func (m MockBazelContext) IsModuleNameAllowed(_ string, _ bool) bool { return true } -func (m MockBazelContext) IsModuleDclaAllowed(_ string) bool { - return true -} - func (m MockBazelContext) OutputBase() string { return m.OutputBaseDir } func (m MockBazelContext) BuildStatementsToRegister() []*bazel.BuildStatement { @@ -461,10 +455,6 @@ func (n noopBazelContext) IsModuleNameAllowed(_ string, _ bool) bool { return false } -func (n noopBazelContext) IsModuleDclaAllowed(_ string) bool { - return false -} - func (m noopBazelContext) BuildStatementsToRegister() []*bazel.BuildStatement { return []*bazel.BuildStatement{} } @@ -598,17 +588,13 @@ func (context *mixedBuildBazelContext) IsModuleNameAllowed(moduleName string, wi if context.bazelEnabledModules[moduleName] { return true } - if withinApex && context.IsModuleDclaAllowed(moduleName) { + if withinApex && context.bazelDclaEnabledModules[moduleName] { return true } return false } -func (context *mixedBuildBazelContext) IsModuleDclaAllowed(moduleName string) bool { - return context.bazelDclaEnabledModules[moduleName] -} - func pwdPrefix() string { // Darwin doesn't have /proc if runtime.GOOS != "darwin" { diff --git a/cc/cc.go b/cc/cc.go index af4b977e6..6a67e548f 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -1968,9 +1968,6 @@ func allEnabledSanitizersSupportedByBazel(ctx android.BaseModuleContext, c *Modu func GetApexConfigKey(ctx android.BaseModuleContext) *android.ApexConfigKey { apexInfo := ctx.Provider(android.ApexInfoProvider).(android.ApexInfo) if !apexInfo.IsForPlatform() { - if !ctx.Config().BazelContext.IsModuleDclaAllowed(ctx.Module().Name()) { - return nil - } apexKey := android.ApexConfigKey{ WithinApex: true, ApexSdkVersion: findApexSdkVersion(ctx, apexInfo).String(),