Merge "Add an allowlist for modules that have broken optional_uses_libs." am: 4f8b23e8e2
am: 9ec2a5568e
am: e9aa9fdba0
am: ea123ebd24
am: 9e74da551e
Original change: https://android-review.googlesource.com/c/platform/build/soong/+/2612151 Change-Id: Ic2c67ceb5bfecc29f5a2347df9d649ce18567013 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -1925,6 +1925,10 @@ func (c *deviceConfig) BuildBrokenInputDir(name string) bool {
|
||||
return InList(name, c.config.productVariables.BuildBrokenInputDirModules)
|
||||
}
|
||||
|
||||
func (c *config) BuildWarningBadOptionalUsesLibsAllowlist() []string {
|
||||
return c.productVariables.BuildWarningBadOptionalUsesLibsAllowlist
|
||||
}
|
||||
|
||||
func (c *deviceConfig) GenruleSandboxing() bool {
|
||||
return Bool(c.config.productVariables.GenruleSandboxing)
|
||||
}
|
||||
|
@@ -449,6 +449,8 @@ type productVariables struct {
|
||||
BuildBrokenVendorPropertyNamespace bool `json:",omitempty"`
|
||||
BuildBrokenInputDirModules []string `json:",omitempty"`
|
||||
|
||||
BuildWarningBadOptionalUsesLibsAllowlist []string `json:",omitempty"`
|
||||
|
||||
BuildDebugfsRestrictionsEnabled bool `json:",omitempty"`
|
||||
|
||||
RequiresInsecureExecmemForSwiftshader bool `json:",omitempty"`
|
||||
|
@@ -1396,7 +1396,7 @@ func (u *usesLibrary) deps(ctx android.BottomUpMutatorContext, addCompatDeps boo
|
||||
func (u *usesLibrary) presentOptionalUsesLibs(ctx android.BaseModuleContext) []string {
|
||||
optionalUsesLibs := android.FilterListPred(u.usesLibraryProperties.Optional_uses_libs, func(s string) bool {
|
||||
exists := ctx.OtherModuleExists(s)
|
||||
if !exists {
|
||||
if !exists && !android.InList(ctx.ModuleName(), ctx.Config().BuildWarningBadOptionalUsesLibsAllowlist()) {
|
||||
fmt.Printf("Warning: Module '%s' depends on non-existing optional_uses_libs '%s'\n", ctx.ModuleName(), s)
|
||||
}
|
||||
return exists
|
||||
|
@@ -2644,6 +2644,9 @@ func TestUsesLibraries(t *testing.T) {
|
||||
prepareForJavaTest,
|
||||
PrepareForTestWithJavaSdkLibraryFiles,
|
||||
FixtureWithLastReleaseApis("runtime-library", "foo", "quuz", "qux", "bar", "fred"),
|
||||
android.FixtureModifyProductVariables(func(variables android.FixtureProductVariables) {
|
||||
variables.BuildWarningBadOptionalUsesLibsAllowlist = []string{"app", "prebuilt"}
|
||||
}),
|
||||
).RunTestWithBp(t, bp)
|
||||
|
||||
app := result.ModuleForTests("app", "android_common")
|
||||
|
Reference in New Issue
Block a user