Merge "Remove the SdkLibraryDependency interface" into main
diff --git a/Android.bp b/Android.bp
index 535246e..f2d0d94 100644
--- a/Android.bp
+++ b/Android.bp
@@ -116,6 +116,11 @@
visibility: ["//visibility:public"],
}
+art_boot_images {
+ name: "art_boot_images",
+ visibility: ["//art:__subpackages__"],
+}
+
// Pseudo-test that's run on checkbuilds to ensure that get_clang_version can
// parse cc/config/global.go.
genrule {
diff --git a/aconfig/codegen/cc_aconfig_library.go b/aconfig/codegen/cc_aconfig_library.go
index b5cf687..8c4bfe6 100644
--- a/aconfig/codegen/cc_aconfig_library.go
+++ b/aconfig/codegen/cc_aconfig_library.go
@@ -63,7 +63,7 @@
callbacks := &CcAconfigLibraryCallbacks{
properties: &CcAconfigLibraryProperties{},
}
- return cc.GeneratedCcLibraryModuleFactory("cc_aconfig_library", callbacks)
+ return cc.GeneratedCcLibraryModuleFactory(callbacks)
}
func (this *CcAconfigLibraryCallbacks) GeneratorInit(ctx cc.BaseModuleContext) {
diff --git a/aconfig/codegen/init.go b/aconfig/codegen/init.go
index 98d288f..ed0b3ed 100644
--- a/aconfig/codegen/init.go
+++ b/aconfig/codegen/init.go
@@ -32,6 +32,7 @@
` --mode ${mode}` +
` --cache ${in}` +
` --out ${out}.tmp` +
+ ` --allow-instrumentation ${debug}` +
` && $soong_zip -write_if_changed -jar -o ${out} -C ${out}.tmp -D ${out}.tmp` +
` && rm -rf ${out}.tmp`,
CommandDeps: []string{
@@ -39,7 +40,7 @@
"$soong_zip",
},
Restat: true,
- }, "mode")
+ }, "mode", "debug")
// For cc_aconfig_library: Generate C++ library
cppRule = pctx.AndroidStaticRule("cc_aconfig_library",
diff --git a/aconfig/codegen/java_aconfig_library.go b/aconfig/codegen/java_aconfig_library.go
index 673ac2a..ebca413 100644
--- a/aconfig/codegen/java_aconfig_library.go
+++ b/aconfig/codegen/java_aconfig_library.go
@@ -20,6 +20,7 @@
"github.com/google/blueprint"
"github.com/google/blueprint/proptools"
+ "strconv"
)
type declarationsTagType struct {
@@ -71,6 +72,7 @@
module.AddSharedLibrary("aconfig-annotations-lib")
// TODO(b/303773055): Remove the annotation after access issue is resolved.
module.AddSharedLibrary("unsupportedappusage")
+ module.AddSharedLibrary("aconfig_storage_reader_java")
}
}
@@ -102,7 +104,8 @@
Output: srcJarPath,
Description: "aconfig.srcjar",
Args: map[string]string{
- "mode": mode,
+ "mode": mode,
+ "debug": strconv.FormatBool(ctx.Config().ReleaseReadFromNewStorage()),
},
})
diff --git a/android/apex.go b/android/apex.go
index 114fe29..79ab13c 100644
--- a/android/apex.go
+++ b/android/apex.go
@@ -989,8 +989,8 @@
// Function called while walking an APEX's payload dependencies.
//
// Return true if the `to` module should be visited, false otherwise.
-type PayloadDepsCallback func(ctx ModuleContext, from blueprint.Module, to ApexModule, externalDep bool) bool
-type WalkPayloadDepsFunc func(ctx ModuleContext, do PayloadDepsCallback)
+type PayloadDepsCallback func(ctx BaseModuleContext, from blueprint.Module, to ApexModule, externalDep bool) bool
+type WalkPayloadDepsFunc func(ctx BaseModuleContext, do PayloadDepsCallback)
// ModuleWithMinSdkVersionCheck represents a module that implements min_sdk_version checks
type ModuleWithMinSdkVersionCheck interface {
@@ -1017,7 +1017,7 @@
return
}
- walk(ctx, func(ctx ModuleContext, from blueprint.Module, to ApexModule, externalDep bool) bool {
+ walk(ctx, func(ctx BaseModuleContext, from blueprint.Module, to ApexModule, externalDep bool) bool {
if externalDep {
// external deps are outside the payload boundary, which is "stable"
// interface. We don't have to check min_sdk_version for external
diff --git a/android/arch.go b/android/arch.go
index 942727a..d9ecb50 100644
--- a/android/arch.go
+++ b/android/arch.go
@@ -138,6 +138,13 @@
return a.Name
}
+func (a ArchType) Bitness() string {
+ if a.Multilib == "lib32" {
+ return "32"
+ }
+ return "64"
+}
+
const COMMON_VARIANT = "common"
var (
diff --git a/android/arch_list.go b/android/arch_list.go
index 9501c87..a47d5eb 100644
--- a/android/arch_list.go
+++ b/android/arch_list.go
@@ -29,6 +29,7 @@
"armv9-2a",
},
X86: {
+ "alderlake",
"amberlake",
"atom",
"broadwell",
@@ -53,6 +54,7 @@
"x86_64",
},
X86_64: {
+ "alderlake",
"amberlake",
"broadwell",
"goldmont",
@@ -165,6 +167,16 @@
},
},
X86: {
+ "alderlake": {
+ "ssse3",
+ "sse4",
+ "sse4_1",
+ "sse4_2",
+ "avx",
+ "avx2",
+ "aes_ni",
+ "popcnt",
+ },
"amberlake": {
"ssse3",
"sse4",
@@ -341,6 +353,16 @@
"sse4_2",
"popcnt",
},
+ "alderlake": {
+ "ssse3",
+ "sse4",
+ "sse4_1",
+ "sse4_2",
+ "avx",
+ "avx2",
+ "aes_ni",
+ "popcnt",
+ },
"amberlake": {
"ssse3",
"sse4",
diff --git a/android/config.go b/android/config.go
index 00fc823..ca20012 100644
--- a/android/config.go
+++ b/android/config.go
@@ -1252,7 +1252,7 @@
}
func (c *config) LibartImgHostBaseAddress() string {
- return "0x60000000"
+ return "0x70000000"
}
func (c *config) LibartImgDeviceBaseAddress() string {
@@ -1691,14 +1691,6 @@
return Bool(c.productVariables.EnforceProductPartitionInterface)
}
-func (c *config) EnforceInterPartitionJavaSdkLibrary() bool {
- return Bool(c.productVariables.EnforceInterPartitionJavaSdkLibrary)
-}
-
-func (c *config) InterPartitionJavaLibraryAllowList() []string {
- return c.productVariables.InterPartitionJavaLibraryAllowList
-}
-
func (c *config) ProductHiddenAPIStubs() []string {
return c.productVariables.ProductHiddenAPIStubs
}
diff --git a/android/module.go b/android/module.go
index e2b7e11..d6c129a 100644
--- a/android/module.go
+++ b/android/module.go
@@ -1057,8 +1057,29 @@
}{}
func addVintfFragmentDeps(ctx BottomUpMutatorContext) {
+ // Vintf manifests in the recovery partition will be ignored.
+ if !ctx.Device() || ctx.Module().InstallInRecovery() {
+ return
+ }
+
+ deviceConfig := ctx.DeviceConfig()
+
mod := ctx.Module()
- ctx.AddDependency(mod, vintfDepTag, mod.VintfFragmentModuleNames(ctx)...)
+ vintfModules := ctx.AddDependency(mod, vintfDepTag, mod.VintfFragmentModuleNames(ctx)...)
+
+ modPartition := mod.PartitionTag(deviceConfig)
+ for _, vintf := range vintfModules {
+ if vintfModule, ok := vintf.(*vintfFragmentModule); ok {
+ vintfPartition := vintfModule.PartitionTag(deviceConfig)
+ if modPartition != vintfPartition {
+ ctx.ModuleErrorf("Module %q(%q) and Vintf_fragment %q(%q) are installed to different partitions.",
+ mod.Name(), modPartition,
+ vintfModule.Name(), vintfPartition)
+ }
+ } else {
+ ctx.ModuleErrorf("Only vintf_fragment type module should be listed in vintf_fragment_modules : %q", vintf.Name())
+ }
+ }
}
// AddProperties "registers" the provided props
diff --git a/android/module_test.go b/android/module_test.go
index d64e3a5..d76d9b3 100644
--- a/android/module_test.go
+++ b/android/module_test.go
@@ -1080,3 +1080,29 @@
})
}
}
+
+func TestVintfFragmentModulesChecksPartition(t *testing.T) {
+ bp := `
+ vintf_fragment {
+ name: "vintfModA",
+ src: "test_vintf_file",
+ vendor: true,
+ }
+ deps {
+ name: "modA",
+ vintf_fragment_modules: [
+ "vintfModA",
+ ]
+ }
+ `
+
+ testPreparer := GroupFixturePreparers(
+ PrepareForTestWithAndroidBuildComponents,
+ prepareForModuleTests,
+ )
+
+ testPreparer.
+ ExtendWithErrorHandler(FixtureExpectsOneErrorPattern(
+ "Module .+ and Vintf_fragment .+ are installed to different partitions.")).
+ RunTestWithBp(t, bp)
+}
diff --git a/android/mutator.go b/android/mutator.go
index 9404945..434e3ba 100644
--- a/android/mutator.go
+++ b/android/mutator.go
@@ -26,7 +26,7 @@
// run Pre-deps mutators
// run depsMutator
// run PostDeps mutators
-// run FinalDeps mutators (CreateVariations disallowed in this phase)
+// run FinalDeps mutators (TransitionMutators disallowed in this phase)
// continue on to GenerateAndroidBuildActions
// collateGloballyRegisteredMutators constructs the list of mutators that have been registered
@@ -231,36 +231,6 @@
// module's dependency list.
AddReverseDependency(module blueprint.Module, tag blueprint.DependencyTag, name string)
- // CreateVariations splits a module into multiple variants, one for each name in the variationNames
- // parameter. It returns a list of new modules in the same order as the variationNames
- // list.
- //
- // If any of the dependencies of the module being operated on were already split
- // by calling CreateVariations with the same name, the dependency will automatically
- // be updated to point the matching variant.
- //
- // If a module is split, and then a module depending on the first module is not split
- // when the Mutator is later called on it, the dependency of the depending module will
- // automatically be updated to point to the first variant.
- CreateVariations(...string) []Module
-
- // CreateLocationVariations splits a module into multiple variants, one for each name in the variantNames
- // parameter. It returns a list of new modules in the same order as the variantNames
- // list.
- //
- // Local variations do not affect automatic dependency resolution - dependencies added
- // to the split module via deps or DynamicDependerModule must exactly match a variant
- // that contains all the non-local variations.
- CreateLocalVariations(...string) []Module
-
- // SetDependencyVariation sets all dangling dependencies on the current module to point to the variation
- // with given name. This function ignores the default variation set by SetDefaultDependencyVariation.
- SetDependencyVariation(string)
-
- // SetDefaultDependencyVariation sets the default variation when a dangling reference is detected
- // during the subsequent calls on Create*Variations* functions. To reset, set it to nil.
- SetDefaultDependencyVariation(*string)
-
// AddVariationDependencies adds deps as dependencies of the current module, but uses the variations
// argument to select which variant of the dependency to use. It returns a slice of modules for
// each dependency (some entries may be nil). A variant of the dependency must exist that matches
@@ -287,12 +257,6 @@
// be ordered correctly for all future mutator passes.
AddFarVariationDependencies([]blueprint.Variation, blueprint.DependencyTag, ...string) []blueprint.Module
- // AddInterVariantDependency adds a dependency between two variants of the same module. Variants are always
- // ordered in the same orderas they were listed in CreateVariations, and AddInterVariantDependency does not change
- // that ordering, but it associates a DependencyTag with the dependency and makes it visible to VisitDirectDeps,
- // WalkDeps, etc.
- AddInterVariantDependency(tag blueprint.DependencyTag, from, to blueprint.Module)
-
// ReplaceDependencies finds all the variants of the module with the specified name, then
// replaces all dependencies onto those variants with the current variant of this module.
// Replacements don't take effect until after the mutator pass is finished.
@@ -303,30 +267,6 @@
// as long as the supplied predicate returns true.
// Replacements don't take effect until after the mutator pass is finished.
ReplaceDependenciesIf(string, blueprint.ReplaceDependencyPredicate)
-
- // AliasVariation takes a variationName that was passed to CreateVariations for this module,
- // and creates an alias from the current variant (before the mutator has run) to the new
- // variant. The alias will be valid until the next time a mutator calls CreateVariations or
- // CreateLocalVariations on this module without also calling AliasVariation. The alias can
- // be used to add dependencies on the newly created variant using the variant map from
- // before CreateVariations was run.
- AliasVariation(variationName string)
-
- // CreateAliasVariation takes a toVariationName that was passed to CreateVariations for this
- // module, and creates an alias from a new fromVariationName variant the toVariationName
- // variant. The alias will be valid until the next time a mutator calls CreateVariations or
- // CreateLocalVariations on this module without also calling AliasVariation. The alias can
- // be used to add dependencies on the toVariationName variant using the fromVariationName
- // variant.
- CreateAliasVariation(fromVariationName, toVariationName string)
-
- // SetVariationProvider sets the value for a provider for the given newly created variant of
- // the current module, i.e. one of the Modules returned by CreateVariations.. It panics if
- // not called during the appropriate mutator or GenerateBuildActions pass for the provider,
- // if the value is not of the appropriate type, or if the module is not a newly created
- // variant of the current module. The value should not be modified after being passed to
- // SetVariationProvider.
- SetVariationProvider(module blueprint.Module, provider blueprint.AnyProviderKey, value interface{})
}
// An outgoingTransitionContextImpl and incomingTransitionContextImpl is created for every dependency of every module
@@ -763,51 +703,6 @@
}
b.bp.AddReverseDependency(module, tag, name)
}
-
-func (b *bottomUpMutatorContext) CreateVariations(variations ...string) []Module {
- if b.finalPhase {
- panic("CreateVariations not allowed in FinalDepsMutators")
- }
-
- modules := b.bp.CreateVariations(variations...)
-
- aModules := make([]Module, len(modules))
- for i := range variations {
- aModules[i] = modules[i].(Module)
- base := aModules[i].base()
- base.commonProperties.DebugMutators = append(base.commonProperties.DebugMutators, b.MutatorName())
- base.commonProperties.DebugVariations = append(base.commonProperties.DebugVariations, variations[i])
- }
-
- return aModules
-}
-
-func (b *bottomUpMutatorContext) CreateLocalVariations(variations ...string) []Module {
- if b.finalPhase {
- panic("CreateLocalVariations not allowed in FinalDepsMutators")
- }
-
- modules := b.bp.CreateLocalVariations(variations...)
-
- aModules := make([]Module, len(modules))
- for i := range variations {
- aModules[i] = modules[i].(Module)
- base := aModules[i].base()
- base.commonProperties.DebugMutators = append(base.commonProperties.DebugMutators, b.MutatorName())
- base.commonProperties.DebugVariations = append(base.commonProperties.DebugVariations, variations[i])
- }
-
- return aModules
-}
-
-func (b *bottomUpMutatorContext) SetDependencyVariation(variation string) {
- b.bp.SetDependencyVariation(variation)
-}
-
-func (b *bottomUpMutatorContext) SetDefaultDependencyVariation(variation *string) {
- b.bp.SetDefaultDependencyVariation(variation)
-}
-
func (b *bottomUpMutatorContext) AddVariationDependencies(variations []blueprint.Variation, tag blueprint.DependencyTag,
names ...string) []blueprint.Module {
if b.baseModuleContext.checkedMissingDeps() {
@@ -825,10 +720,6 @@
return b.bp.AddFarVariationDependencies(variations, tag, names...)
}
-func (b *bottomUpMutatorContext) AddInterVariantDependency(tag blueprint.DependencyTag, from, to blueprint.Module) {
- b.bp.AddInterVariantDependency(tag, from, to)
-}
-
func (b *bottomUpMutatorContext) ReplaceDependencies(name string) {
if b.baseModuleContext.checkedMissingDeps() {
panic("Adding deps not allowed after checking for missing deps")
@@ -842,15 +733,3 @@
}
b.bp.ReplaceDependenciesIf(name, predicate)
}
-
-func (b *bottomUpMutatorContext) AliasVariation(variationName string) {
- b.bp.AliasVariation(variationName)
-}
-
-func (b *bottomUpMutatorContext) CreateAliasVariation(fromVariationName, toVariationName string) {
- b.bp.CreateAliasVariation(fromVariationName, toVariationName)
-}
-
-func (b *bottomUpMutatorContext) SetVariationProvider(module blueprint.Module, provider blueprint.AnyProviderKey, value interface{}) {
- b.bp.SetVariationProvider(module, provider, value)
-}
diff --git a/android/mutator_test.go b/android/mutator_test.go
index b3ef00f..5d4074a 100644
--- a/android/mutator_test.go
+++ b/android/mutator_test.go
@@ -287,7 +287,7 @@
AssertDeepEquals(t, "final", finalWant, finalGot)
}
-func TestNoCreateVariationsInFinalDeps(t *testing.T) {
+func TestTransitionMutatorInFinalDeps(t *testing.T) {
GroupFixturePreparers(
FixtureRegisterWithContext(func(ctx RegistrationContext) {
ctx.FinalDepsMutators(func(ctx RegisterMutatorsContext) {
diff --git a/android/prebuilt.go b/android/prebuilt.go
index fd5a6ea..4f04d05 100644
--- a/android/prebuilt.go
+++ b/android/prebuilt.go
@@ -359,8 +359,8 @@
//
// This function is for use on dependencies after PrebuiltPostDepsMutator has
// run - any dependency that is registered before that will already reference
-// the right module. This function is only safe to call after all mutators that
-// may call CreateVariations, e.g. in GenerateAndroidBuildActions.
+// the right module. This function is only safe to call after all TransitionMutators
+// have run, e.g. in GenerateAndroidBuildActions.
func PrebuiltGetPreferred(ctx BaseModuleContext, module Module) Module {
if !module.IsReplacedByPrebuilt() {
return module
diff --git a/android/variable.go b/android/variable.go
index e0d512d..7041f49 100644
--- a/android/variable.go
+++ b/android/variable.go
@@ -428,9 +428,6 @@
EnforceProductPartitionInterface *bool `json:",omitempty"`
- EnforceInterPartitionJavaSdkLibrary *bool `json:",omitempty"`
- InterPartitionJavaLibraryAllowList []string `json:",omitempty"`
-
BoardUsesRecoveryAsBoot *bool `json:",omitempty"`
BoardKernelBinaries []string `json:",omitempty"`
diff --git a/apex/apex.go b/apex/apex.go
index 0caf37c..aff69c1 100644
--- a/apex/apex.go
+++ b/apex/apex.go
@@ -583,7 +583,7 @@
dataPaths []android.DataPath // becomes LOCAL_TEST_DATA
jacocoReportClassesFile android.Path // only for javalibs and apps
- lintDepSets java.LintDepSets // only for javalibs and apps
+ lintInfo *java.LintInfo // only for javalibs and apps
certificate java.Certificate // only for apps
overriddenPackageName string // only for apps
@@ -1122,19 +1122,11 @@
return
}
if apex, ok := mctx.Module().(*apexBundle); ok && apex.checkStrictUpdatabilityLinting(mctx) {
- mctx.WalkDeps(func(child, parent android.Module) bool {
- // b/208656169 Do not propagate strict updatability linting to libcore/
- // These libs are available on the classpath during compilation
- // These libs are transitive deps of the sdk. See java/sdk.go:decodeSdkDep
- // Only skip libraries defined in libcore root, not subdirectories
- if mctx.OtherModuleDir(child) == "libcore" {
- // Do not traverse transitive deps of libcore/ libs
+ apex.WalkPayloadDeps(mctx, func(mctx android.BaseModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool) bool {
+ if externalDep {
return false
}
- if android.InList(child.Name(), skipLintJavalibAllowlist) {
- return false
- }
- if lintable, ok := child.(java.LintDepSetsIntf); ok {
+ if lintable, ok := to.(java.LintDepSetsIntf); ok {
lintable.SetStrictUpdatabilityLinting(true)
}
// visit transitive deps
@@ -1203,17 +1195,6 @@
"test_jitzygote_com.android.art",
// go/keep-sorted end
}
-
- // TODO: b/215736885 Remove this list
- skipLintJavalibAllowlist = []string{
- "conscrypt.module.platform.api.stubs",
- "conscrypt.module.public.api.stubs",
- "conscrypt.module.public.api.stubs.system",
- "conscrypt.module.public.api.stubs.module_lib",
- "framework-media.stubs",
- "framework-media.stubs.system",
- "framework-media.stubs.module_lib",
- }
)
func (a *apexBundle) checkStrictUpdatabilityLinting(mctx android.TopDownMutatorContext) bool {
@@ -1662,7 +1643,6 @@
BaseModuleName() string
DexJarBuildPath(ctx android.ModuleErrorfContext) java.OptionalDexJarPath
JacocoReportClassesFile() android.Path
- LintDepSets() java.LintDepSets
Stem() string
}
@@ -1682,7 +1662,9 @@
dirInApex := "javalib"
af := newApexFile(ctx, dexImplementationJar, module.BaseModuleName(), dirInApex, javaSharedLib, module)
af.jacocoReportClassesFile = module.JacocoReportClassesFile()
- af.lintDepSets = module.LintDepSets()
+ if lintInfo, ok := android.OtherModuleProvider(ctx, module, java.LintProvider); ok {
+ af.lintInfo = lintInfo
+ }
af.customStem = module.Stem() + ".jar"
// TODO: b/338641779 - Remove special casing of sdkLibrary once bcpf and sscpf depends
// on the implementation library
@@ -1720,7 +1702,6 @@
JacocoReportClassesFile() android.Path
Certificate() java.Certificate
BaseModuleName() string
- LintDepSets() java.LintDepSets
PrivAppAllowlist() android.OptionalPath
}
@@ -1756,7 +1737,9 @@
af := newApexFile(ctx, fileToCopy, aapp.BaseModuleName(), dirInApex, app, aapp)
af.jacocoReportClassesFile = aapp.JacocoReportClassesFile()
- af.lintDepSets = aapp.LintDepSets()
+ if lintInfo, ok := android.OtherModuleProvider(ctx, aapp, java.LintProvider); ok {
+ af.lintInfo = lintInfo
+ }
af.certificate = aapp.Certificate()
if app, ok := aapp.(interface {
@@ -1807,7 +1790,7 @@
// visited module, the `do` callback is executed. Returning true in the callback continues the visit
// to the child modules. Returning false makes the visit to continue in the sibling or the parent
// modules. This is used in check* functions below.
-func (a *apexBundle) WalkPayloadDeps(ctx android.ModuleContext, do android.PayloadDepsCallback) {
+func (a *apexBundle) WalkPayloadDeps(ctx android.BaseModuleContext, do android.PayloadDepsCallback) {
ctx.WalkDeps(func(child, parent android.Module) bool {
am, ok := child.(android.ApexModule)
if !ok || !am.CanHaveApexVariants() {
@@ -2653,7 +2636,7 @@
abInfo, _ := android.ModuleProvider(ctx, android.ApexBundleInfoProvider)
- a.WalkPayloadDeps(ctx, func(ctx android.ModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool) bool {
+ a.WalkPayloadDeps(ctx, func(ctx android.BaseModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool) bool {
if ccm, ok := to.(*cc.Module); ok {
apexName := ctx.ModuleName()
fromName := ctx.OtherModuleName(from)
@@ -2765,7 +2748,7 @@
return
}
- a.WalkPayloadDeps(ctx, func(ctx android.ModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool) bool {
+ a.WalkPayloadDeps(ctx, func(ctx android.BaseModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool) bool {
// As soon as the dependency graph crosses the APEX boundary, don't go further.
if externalDep {
return false
diff --git a/apex/apex_test.go b/apex/apex_test.go
index ad0bb17..8cb8a91 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -9749,67 +9749,6 @@
}
}
-func TestUpdatabilityLintSkipLibcore(t *testing.T) {
- bp := `
- apex {
- name: "myapex",
- key: "myapex.key",
- java_libs: ["myjavalib"],
- updatable: true,
- min_sdk_version: "29",
- }
- apex_key {
- name: "myapex.key",
- }
- java_library {
- name: "myjavalib",
- srcs: ["MyClass.java"],
- apex_available: [ "myapex" ],
- sdk_version: "current",
- min_sdk_version: "29",
- lint: {
- baseline_filename: "lint-baseline.xml",
- }
- }
- `
-
- testCases := []struct {
- testCaseName string
- moduleDirectory string
- disallowedFlagExpected bool
- }{
- {
- testCaseName: "lintable module defined outside libcore",
- moduleDirectory: "",
- disallowedFlagExpected: true,
- },
- {
- testCaseName: "lintable module defined in libcore root directory",
- moduleDirectory: "libcore/",
- disallowedFlagExpected: false,
- },
- {
- testCaseName: "lintable module defined in libcore child directory",
- moduleDirectory: "libcore/childdir/",
- disallowedFlagExpected: true,
- },
- }
-
- for _, testCase := range testCases {
- lintFileCreator := android.FixtureAddTextFile(testCase.moduleDirectory+"lint-baseline.xml", "")
- bpFileCreator := android.FixtureAddTextFile(testCase.moduleDirectory+"Android.bp", bp)
- result := testApex(t, "", lintFileCreator, bpFileCreator)
- myjavalib := result.ModuleForTests("myjavalib", "android_common_apex29")
- sboxProto := android.RuleBuilderSboxProtoForTests(t, result, myjavalib.Output("lint.sbox.textproto"))
- cmdFlags := fmt.Sprintf("--baseline %vlint-baseline.xml --disallowed_issues NewApi", testCase.moduleDirectory)
- disallowedFlagActual := strings.Contains(*sboxProto.Commands[0].Command, cmdFlags)
-
- if disallowedFlagActual != testCase.disallowedFlagExpected {
- t.Errorf("Failed testcase: %v \nActual lint cmd: %v", testCase.testCaseName, *sboxProto.Commands[0].Command)
- }
- }
-}
-
// checks transtive deps of an apex coming from bootclasspath_fragment
func TestApexStrictUpdtabilityLintBcpFragmentDeps(t *testing.T) {
bp := `
diff --git a/apex/builder.go b/apex/builder.go
index 19ec1bd..244119b 100644
--- a/apex/builder.go
+++ b/apex/builder.go
@@ -1092,7 +1092,7 @@
}
depInfos := android.DepNameToDepInfoMap{}
- a.WalkPayloadDeps(ctx, func(ctx android.ModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool) bool {
+ a.WalkPayloadDeps(ctx, func(ctx android.BaseModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool) bool {
if from.Name() == to.Name() {
// This can happen for cc.reuseObjTag. We are not interested in tracking this.
// As soon as the dependency graph crosses the APEX boundary, don't go further.
@@ -1159,7 +1159,9 @@
func (a *apexBundle) buildLintReports(ctx android.ModuleContext) {
depSetsBuilder := java.NewLintDepSetBuilder()
for _, fi := range a.filesInfo {
- depSetsBuilder.Transitive(fi.lintDepSets)
+ if fi.lintInfo != nil {
+ depSetsBuilder.Transitive(fi.lintInfo)
+ }
}
a.lintReports = java.BuildModuleLintReportZips(ctx, depSetsBuilder.Build())
diff --git a/cc/cc.go b/cc/cc.go
index 96795d3..a8ff474 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -137,7 +137,7 @@
// LLNDK headers for the ABI checker to check LLNDK implementation library.
// An LLNDK implementation is the core variant. LLNDK header libs are reexported by the vendor variant.
- // The core variant cannot depend on the vendor variant because of the order of CreateVariations.
+ // The core variant cannot depend on the vendor variant because of the order of imageTransitionMutator.Split().
// Instead, the LLNDK implementation depends on the LLNDK header libs.
LlndkHeaderLibs []string
}
diff --git a/cc/config/x86_64_device.go b/cc/config/x86_64_device.go
index 5aa2a7e..e7ac038 100644
--- a/cc/config/x86_64_device.go
+++ b/cc/config/x86_64_device.go
@@ -40,6 +40,9 @@
"-march=x86-64",
},
+ "alderlake": []string{
+ "-march=alderlake",
+ },
"broadwell": []string{
"-march=broadwell",
},
diff --git a/cc/config/x86_device.go b/cc/config/x86_device.go
index 4b0041c..a92881d 100644
--- a/cc/config/x86_device.go
+++ b/cc/config/x86_device.go
@@ -42,6 +42,9 @@
"x86_64": []string{
"-march=prescott",
},
+ "alderlake": []string{
+ "-march=alderlake",
+ },
"atom": []string{
"-march=atom",
},
diff --git a/cc/generated_cc_library.go b/cc/generated_cc_library.go
index b1084e4..709586b 100644
--- a/cc/generated_cc_library.go
+++ b/cc/generated_cc_library.go
@@ -18,7 +18,7 @@
"android/soong/android"
)
-func GeneratedCcLibraryModuleFactory(moduleName string, callbacks Generator) android.Module {
+func GeneratedCcLibraryModuleFactory(callbacks Generator) android.Module {
module, _ := NewLibrary(android.HostAndDeviceSupported)
// Can be used as both a static and a shared library.
diff --git a/java/Android.bp b/java/Android.bp
index a930dd4..1101d7a 100644
--- a/java/Android.bp
+++ b/java/Android.bp
@@ -72,7 +72,6 @@
"rro.go",
"sdk.go",
"sdk_library.go",
- "sdk_library_external.go",
"sdk_library_internal.go",
"support_libraries.go",
"system_modules.go",
diff --git a/java/androidmk.go b/java/androidmk.go
index a1bc904..0539d25 100644
--- a/java/androidmk.go
+++ b/java/androidmk.go
@@ -415,7 +415,7 @@
} else {
var names []string
for _, jniLib := range app.jniLibs {
- names = append(names, jniLib.name)
+ names = append(names, jniLib.name+":"+jniLib.target.Arch.ArchType.Bitness())
}
entries.AddStrings("LOCAL_REQUIRED_MODULES", names...)
}
diff --git a/java/androidmk_test.go b/java/androidmk_test.go
index 243a279..1d98b18 100644
--- a/java/androidmk_test.go
+++ b/java/androidmk_test.go
@@ -286,7 +286,7 @@
}{
{
name: "app",
- expected: []string{"libjni"},
+ expected: []string{"libjni:64"},
},
{
name: "app_embedded",
diff --git a/java/app.go b/java/app.go
index 7707a7e..b77793b 100644
--- a/java/app.go
+++ b/java/app.go
@@ -1135,7 +1135,7 @@
return jniLibs, prebuiltJniPackages
}
-func (a *AndroidApp) WalkPayloadDeps(ctx android.ModuleContext, do android.PayloadDepsCallback) {
+func (a *AndroidApp) WalkPayloadDeps(ctx android.BaseModuleContext, do android.PayloadDepsCallback) {
ctx.WalkDeps(func(child, parent android.Module) bool {
isExternal := !a.DepIsInSameApex(ctx, child)
if am, ok := child.(android.ApexModule); ok {
@@ -1153,7 +1153,7 @@
}
depsInfo := android.DepNameToDepInfoMap{}
- a.WalkPayloadDeps(ctx, func(ctx android.ModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool) bool {
+ a.WalkPayloadDeps(ctx, func(ctx android.BaseModuleContext, from blueprint.Module, to android.ApexModule, externalDep bool) bool {
depName := to.Name()
// Skip dependencies that are only available to APEXes; they are developed with updatability
@@ -1417,7 +1417,8 @@
}
testConfig := tradefed.AutoGenInstrumentationTestConfig(ctx, a.testProperties.Test_config,
- a.testProperties.Test_config_template, a.manifestPath, a.testProperties.Test_suites, a.testProperties.Auto_gen_config, configs)
+ a.testProperties.Test_config_template, a.manifestPath, a.testProperties.Test_suites,
+ a.testProperties.Auto_gen_config, configs, a.testProperties.Test_options.Test_runner_options)
a.testConfig = a.FixTestConfig(ctx, testConfig)
a.extraTestConfigs = android.PathsForModuleSrc(ctx, a.testProperties.Test_options.Extra_test_configs)
a.data = android.PathsForModuleSrc(ctx, a.testProperties.Data)
diff --git a/java/app_import.go b/java/app_import.go
index 045a89a..a54cf2f 100644
--- a/java/app_import.go
+++ b/java/app_import.go
@@ -533,10 +533,6 @@
return android.SdkSpecPrivate.ApiLevel
}
-func (a *AndroidAppImport) LintDepSets() LintDepSets {
- return LintDepSets{}
-}
-
var _ android.ApexModule = (*AndroidAppImport)(nil)
// Implements android.ApexModule
diff --git a/java/base.go b/java/base.go
index df523b7..ed9c3f4 100644
--- a/java/base.go
+++ b/java/base.go
@@ -708,9 +708,6 @@
ctx.SetOutputFiles(android.Paths{m.dexer.proguardDictionary.Path()}, ".proguard_map")
}
ctx.SetOutputFiles(m.properties.Generated_srcjars, ".generated_srcjars")
- if m.linter.outputs.xml != nil {
- ctx.SetOutputFiles(android.Paths{m.linter.outputs.xml}, ".lint")
- }
}
func InitJavaModule(module android.DefaultableModule, hod android.HostOrDeviceSupported) {
@@ -854,33 +851,6 @@
// Add dependency on libraries that provide additional hidden api annotations.
ctx.AddVariationDependencies(nil, hiddenApiAnnotationsTag, j.properties.Hiddenapi_additional_annotations...)
- if ctx.Config().EnforceInterPartitionJavaSdkLibrary() {
- // Require java_sdk_library at inter-partition java dependency to ensure stable
- // interface between partitions. If inter-partition java_library dependency is detected,
- // raise build error because java_library doesn't have a stable interface.
- //
- // Inputs:
- // PRODUCT_ENFORCE_INTER_PARTITION_JAVA_SDK_LIBRARY
- // if true, enable enforcement
- // PRODUCT_INTER_PARTITION_JAVA_LIBRARY_ALLOWLIST
- // exception list of java_library names to allow inter-partition dependency
- for idx := range j.properties.Libs {
- if libDeps[idx] == nil {
- continue
- }
-
- if javaDep, ok := libDeps[idx].(javaSdkLibraryEnforceContext); ok {
- // java_sdk_library is always allowed at inter-partition dependency.
- // So, skip check.
- if _, ok := javaDep.(*SdkLibrary); ok {
- continue
- }
-
- j.checkPartitionsForJavaDependency(ctx, "libs", javaDep)
- }
- }
- }
-
// For library dependencies that are component libraries (like stubs), add the implementation
// as a dependency (dexpreopt needs to be against the implementation library, not stubs).
for _, dep := range libDeps {
@@ -1736,8 +1706,12 @@
return
}
+ completeStaticLibsImplementationJarsToCombine := completeStaticLibsImplementationJars
+
if j.shouldInstrument(ctx) {
- outputFile = j.instrument(ctx, flags, outputFile, jarName, specs)
+ instrumentedOutputFile := j.instrument(ctx, flags, outputFile, jarName, specs)
+ completeStaticLibsImplementationJarsToCombine = android.NewDepSet(android.PREORDER, android.Paths{instrumentedOutputFile}, nil)
+ outputFile = instrumentedOutputFile
}
// merge implementation jar with resources if necessary
@@ -1745,7 +1719,7 @@
if ctx.Config().UseTransitiveJarsInClasspath() {
resourceJars := completeStaticLibsResourceJars.ToList()
if len(resourceJars) > 0 {
- implementationAndResourcesJarsToCombine = append(resourceJars, completeStaticLibsImplementationJars.ToList()...)
+ implementationAndResourcesJarsToCombine = append(resourceJars, completeStaticLibsImplementationJarsToCombine.ToList()...)
implementationAndResourcesJarsToCombine = append(implementationAndResourcesJarsToCombine, extraDepCombinedJars...)
}
} else {
diff --git a/java/dex.go b/java/dex.go
index e0e642c..faf51a3 100644
--- a/java/dex.go
+++ b/java/dex.go
@@ -220,14 +220,28 @@
deps = append(deps, f)
}
+ var requestReleaseMode bool
+ requestReleaseMode, flags = android.RemoveFromList("--release", flags)
+
if ctx.Config().Getenv("NO_OPTIMIZE_DX") != "" {
flags = append(flags, "--debug")
+ requestReleaseMode = false
}
if ctx.Config().Getenv("GENERATE_DEX_DEBUG") != "" {
flags = append(flags,
"--debug",
"--verbose")
+ requestReleaseMode = false
+ }
+
+ // Don't strip out debug information for eng builds, unless the target
+ // explicitly provided the `--release` build flag. This allows certain
+ // test targets to remain optimized as part of eng test_suites builds.
+ if requestReleaseMode {
+ flags = append(flags, "--release")
+ } else if ctx.Config().Eng() {
+ flags = append(flags, "--debug")
}
// Supplying the platform build flag disables various features like API modeling and desugaring.
@@ -384,11 +398,6 @@
// TODO(ccross): if this is an instrumentation test of an obfuscated app, use the
// dictionary of the app and move the app from libraryjars to injars.
- // Don't strip out debug information for eng builds.
- if ctx.Config().Eng() {
- r8Flags = append(r8Flags, "--debug")
- }
-
// TODO(b/180878971): missing classes should be added to the relevant builds.
// TODO(b/229727645): do not use true as default for Android platform builds.
if proptools.BoolDefault(opt.Ignore_warnings, true) {
diff --git a/java/dex_test.go b/java/dex_test.go
index 4862d06..8bc28e6 100644
--- a/java/dex_test.go
+++ b/java/dex_test.go
@@ -713,3 +713,97 @@
}
}`)
}
+
+func TestDebugReleaseFlags(t *testing.T) {
+ bp := `
+ android_app {
+ name: "app",
+ srcs: ["foo.java"],
+ platform_apis: true,
+ dxflags: ["%s"]
+ }
+ `
+
+ testcases := []struct {
+ name string
+ envVar string
+ isEng bool
+ dxFlags string
+ expectedFlags string
+ }{
+ {
+ name: "app_no_optimize_dx",
+ envVar: "NO_OPTIMIZE_DX",
+ expectedFlags: "--debug",
+ },
+ {
+ name: "app_release_no_optimize_dx",
+ envVar: "NO_OPTIMIZE_DX",
+ dxFlags: "--release",
+ // Global env vars override explicit dxflags.
+ expectedFlags: "--debug",
+ },
+ {
+ name: "app_generate_dex_debug",
+ envVar: "GENERATE_DEX_DEBUG",
+ expectedFlags: "--debug",
+ },
+ {
+ name: "app_release_generate_dex_debug",
+ envVar: "GENERATE_DEX_DEBUG",
+ dxFlags: "--release",
+ // Global env vars override explicit dxflags.
+ expectedFlags: "--debug",
+ },
+ {
+ name: "app_eng",
+ isEng: true,
+ expectedFlags: "--debug",
+ },
+ {
+ name: "app_release_eng",
+ isEng: true,
+ dxFlags: "--release",
+ // Eng mode does *not* override explicit dxflags.
+ expectedFlags: "--release",
+ },
+ }
+
+ for _, tc := range testcases {
+ t.Run(tc.name, func(t *testing.T) {
+ fixturePreparer := PrepareForTestWithJavaDefaultModules
+ fixturePreparer = android.GroupFixturePreparers(
+ fixturePreparer,
+ android.FixtureModifyProductVariables(
+ func(variables android.FixtureProductVariables) {
+ variables.Eng = proptools.BoolPtr(tc.isEng)
+ },
+ ),
+ )
+ if tc.envVar != "" {
+ fixturePreparer = android.GroupFixturePreparers(
+ fixturePreparer,
+ android.FixtureMergeEnv(map[string]string{
+ tc.envVar: "true",
+ }),
+ )
+ }
+ result := fixturePreparer.RunTestWithBp(t, fmt.Sprintf(bp, tc.dxFlags))
+
+ appR8 := result.ModuleForTests("app", "android_common").Rule("r8")
+ android.AssertStringDoesContain(t, "expected flag in R8 flags",
+ appR8.Args["r8Flags"], tc.expectedFlags)
+
+ var unexpectedFlags string
+ if tc.expectedFlags == "--debug" {
+ unexpectedFlags = "--release"
+ } else if tc.expectedFlags == "--release" {
+ unexpectedFlags = "--debug"
+ }
+ if unexpectedFlags != "" {
+ android.AssertStringDoesNotContain(t, "unexpected flag in R8 flags",
+ appR8.Args["r8Flags"], unexpectedFlags)
+ }
+ })
+ }
+}
diff --git a/java/dexpreopt_bootjars.go b/java/dexpreopt_bootjars.go
index a2e4734..ad0e0a7 100644
--- a/java/dexpreopt_bootjars.go
+++ b/java/dexpreopt_bootjars.go
@@ -463,6 +463,7 @@
func RegisterDexpreoptBootJarsComponents(ctx android.RegistrationContext) {
ctx.RegisterParallelSingletonModuleType("dex_bootjars", dexpreoptBootJarsFactory)
+ ctx.RegisterModuleType("art_boot_images", artBootImagesFactory)
ctx.FinalDepsMutators(func(ctx android.RegisterMutatorsContext) {
ctx.BottomUp("dex_bootjars_deps", DexpreoptBootJarsMutator).Parallel()
})
@@ -601,6 +602,7 @@
d.defaultBootImage = defaultBootImageConfig(ctx)
d.otherImages = make([]*bootImageConfig, 0, len(imageConfigs)-1)
var profileInstalls android.RuleBuilderInstalls
+ var artBootImageHostInstalls android.RuleBuilderInstalls
for _, name := range getImageNames() {
config := imageConfigs[name]
if config != d.defaultBootImage {
@@ -616,6 +618,18 @@
d.bootFrameworkProfile = bootProfile
profileInstalls = append(profileInstalls, installs...)
}
+ // Gather the install files of the host variant of the ART boot image.
+ // These installed files will be used in ART tests.
+ if config.name == "art" {
+ for _, variant := range config.variants {
+ if variant.target.Os != ctx.Config().BuildOS {
+ // not a host variant
+ continue
+ }
+ artBootImageHostInstalls = append(artBootImageHostInstalls, variant.installs...)
+ artBootImageHostInstalls = append(artBootImageHostInstalls, variant.vdexInstalls...)
+ }
+ }
}
if len(profileInstalls) > 0 {
android.SetProvider(ctx, profileInstallInfoProvider, profileInstallInfo{
@@ -626,6 +640,15 @@
installFile(ctx, install)
}
}
+ // Set a provider containing the install files of the host variant of the ART boot image.
+ // The actual install rules will be created by `art_boot_images`
+ android.SetProvider(
+ ctx,
+ artBootImageHostInfoProvider,
+ artBootImageHostInfo{
+ installs: artBootImageHostInstalls,
+ },
+ )
}
// GenerateSingletonBuildActions generates build rules for the dexpreopt config for Make.
@@ -968,6 +991,14 @@
}
}
+var artBootImageHostInfoProvider = blueprint.NewProvider[artBootImageHostInfo]()
+
+// artBootImageHostInfo contains the install locations of the host variant of ART boot image
+// this contains both the primary and secondary arch locations
+type artBootImageHostInfo struct {
+ installs android.RuleBuilderInstalls
+}
+
// Generate boot image build rules for a specific target.
func buildBootImageVariant(ctx android.ModuleContext, image *bootImageVariant, profile android.Path) bootImageVariantOutputs {
@@ -1396,3 +1427,70 @@
OutputFile: android.OptionalPathForPath(d.bootFrameworkProfile),
}}
}
+
+// artBootImages is a thin wrapper around `dex_bootjars`.
+// it creates the installation rules for the host variant of the ART boot image.
+type artBootImages struct {
+ android.ModuleBase
+
+ // A non-empty file that will be written as `LOCAL_SOONG_INSTALLED_MODULE` in out/soong/Android-*.mk
+ outputFile android.OptionalPath
+}
+
+func artBootImagesFactory() android.Module {
+ m := &artBootImages{}
+ android.InitAndroidMultiTargetsArchModule(m, android.HostSupported, android.MultilibCommon)
+ return m
+}
+
+func (dbj *artBootImages) DepsMutator(ctx android.BottomUpMutatorContext) {
+ // Create a dependency on `dex_bootjars` to access the intermediate locations of host art boot image.
+ ctx.AddDependency(ctx.Module(), dexpreoptBootJarDepTag, "dex_bootjars")
+}
+
+func (d *artBootImages) GenerateAndroidBuildActions(ctx android.ModuleContext) {
+ ctx.VisitDirectDepsWithTag(dexpreoptBootJarDepTag, func(m android.Module) {
+ hostInstallsInfo, ok := android.OtherModuleProvider(ctx, m, artBootImageHostInfoProvider)
+ if !ok {
+ ctx.ModuleErrorf("Could not find information about the host variant of ART boot image")
+ }
+ installs := d.installFile(ctx, hostInstallsInfo.installs)
+ if len(installs) > 0 {
+ d.outputFile = android.OptionalPathForPath(installs[0])
+ // Create a phony target that can ART run-tests can depend on.
+ ctx.Phony(d.Name(), installs...)
+ } else {
+ // this might be true e.g. when building with `WITH_DEXPREOPT=false`
+ // create an empty file so that the `art_boot_images` is known to the packaging system.
+ d.outputFile = android.OptionalPathForPath(android.PathForModuleOut(ctx, "undefined_art_boot_images"))
+ }
+ })
+}
+
+// Creates an installation rule for host variant of ART boot image files.
+// Returns the list of install locations (out/host/linux-x86/...)
+func (d *artBootImages) installFile(ctx android.ModuleContext, ruleBuilderInstalls android.RuleBuilderInstalls) android.Paths {
+ var ret android.Paths
+ for _, ruleBuilderInstall := range ruleBuilderInstalls {
+ installDir := android.PathForModuleInstall(
+ ctx,
+ strings.TrimPrefix(filepath.Dir(ruleBuilderInstall.To), "/"),
+ )
+ filename := filepath.Base(ruleBuilderInstall.To)
+ ctx.InstallFile(
+ installDir,
+ filename,
+ ruleBuilderInstall.From,
+ )
+ ret = append(ret, installDir.Join(ctx, filename))
+ }
+ return ret
+}
+
+// Set `OutputFile` expclitly so that this module does not get elided when generating out/soong/Android-*.mk
+func (d *artBootImages) AndroidMkEntries() []android.AndroidMkEntries {
+ return []android.AndroidMkEntries{{
+ Class: "ETC",
+ OutputFile: d.outputFile,
+ }}
+}
diff --git a/java/java.go b/java/java.go
index 7ccf91c..ab11363 100644
--- a/java/java.go
+++ b/java/java.go
@@ -2612,10 +2612,6 @@
return nil
}
-func (j *Import) LintDepSets() LintDepSets {
- return LintDepSets{}
-}
-
func (j *Import) getStrictUpdatabilityLinting() bool {
return false
}
@@ -3098,10 +3094,6 @@
return nil
}
-func (a *DexImport) LintDepSets() LintDepSets {
- return LintDepSets{}
-}
-
func (j *DexImport) IsInstallable() bool {
return true
}
diff --git a/java/java_test.go b/java/java_test.go
index e0fd0f2..641bf40 100644
--- a/java/java_test.go
+++ b/java/java_test.go
@@ -3065,6 +3065,43 @@
"baz.jar", bazOutputPaths[0].Rel())
}
+func TestCoverage(t *testing.T) {
+ result := android.GroupFixturePreparers(
+ PrepareForTestWithJavaDefaultModules,
+ prepareForTestWithFrameworkJacocoInstrumentation,
+ PrepareForTestWithTransitiveClasspathEnabled,
+ ).RunTestWithBp(t, `
+ android_app {
+ name: "foo",
+ srcs: ["foo.java"],
+ static_libs: ["android.car"],
+ platform_apis: true,
+ }
+
+ // A library in InstrumentFrameworkModules
+ java_library {
+ name: "android.car",
+ srcs: ["android.car.java"],
+ }
+ `)
+
+ foo := result.ModuleForTests("foo", "android_common")
+ androidCar := result.ModuleForTests("android.car", "android_common")
+
+ fooJacoco := foo.Rule("jacoco")
+ fooCombine := foo.Description("for javac")
+
+ androidCarJacoco := androidCar.Rule("jacoco")
+ androidCarJavac := androidCar.Rule("javac")
+
+ android.AssertStringEquals(t, "foo instrumentation rule inputs", fooJacoco.Input.String(), fooCombine.Output.String())
+ android.AssertStringEquals(t, "android.car instrumentation rule inputs", androidCarJacoco.Input.String(), androidCarJavac.Output.String())
+
+ // The input to instrumentation for the `foo` app contains the non-instrumented android.car classes.
+ android.AssertStringListContains(t, "foo combined inputs", fooCombine.Inputs.Strings(), androidCarJavac.Output.String())
+ android.AssertStringListDoesNotContain(t, "foo combined inputs", fooCombine.Inputs.Strings(), androidCarJacoco.Output.String())
+}
+
func assertTestOnlyAndTopLevel(t *testing.T, ctx *android.TestResult, expectedTestOnly []string, expectedTopLevel []string) {
t.Helper()
actualTrueModules := []string{}
diff --git a/java/lint.go b/java/lint.go
index 6782adc..5cd49a8 100644
--- a/java/lint.go
+++ b/java/lint.go
@@ -19,6 +19,7 @@
"sort"
"strings"
+ "github.com/google/blueprint"
"github.com/google/blueprint/proptools"
"android/soong/android"
@@ -90,7 +91,6 @@
compileSdkKind android.SdkKind
javaLanguageLevel string
kotlinLanguageLevel string
- outputs lintOutputs
properties LintProperties
extraMainlineLintErrors []string
compile_data android.Paths
@@ -100,22 +100,7 @@
buildModuleReportZip bool
}
-type lintOutputs struct {
- html android.Path
- text android.Path
- xml android.Path
- referenceBaseline android.Path
-
- depSets LintDepSets
-}
-
-type lintOutputsIntf interface {
- lintOutputs() *lintOutputs
-}
-
type LintDepSetsIntf interface {
- LintDepSets() LintDepSets
-
// Methods used to propagate strict_updatability_linting values.
GetStrictUpdatabilityLinting() bool
SetStrictUpdatabilityLinting(bool)
@@ -144,15 +129,15 @@
return l
}
-func (l LintDepSetsBuilder) Transitive(depSets LintDepSets) LintDepSetsBuilder {
- if depSets.HTML != nil {
- l.HTML.Transitive(depSets.HTML)
+func (l LintDepSetsBuilder) Transitive(info *LintInfo) LintDepSetsBuilder {
+ if info.TransitiveHTML != nil {
+ l.HTML.Transitive(info.TransitiveHTML)
}
- if depSets.Text != nil {
- l.Text.Transitive(depSets.Text)
+ if info.TransitiveText != nil {
+ l.Text.Transitive(info.TransitiveText)
}
- if depSets.XML != nil {
- l.XML.Transitive(depSets.XML)
+ if info.TransitiveXML != nil {
+ l.XML.Transitive(info.TransitiveXML)
}
return l
}
@@ -209,10 +194,6 @@
},
}
-func (l *linter) LintDepSets() LintDepSets {
- return l.outputs.depSets
-}
-
func (l *linter) GetStrictUpdatabilityLinting() bool {
return BoolDefault(l.properties.Lint.Strict_updatability_linting, false)
}
@@ -223,10 +204,17 @@
var _ LintDepSetsIntf = (*linter)(nil)
-var _ lintOutputsIntf = (*linter)(nil)
+var LintProvider = blueprint.NewProvider[*LintInfo]()
-func (l *linter) lintOutputs() *lintOutputs {
- return &l.outputs
+type LintInfo struct {
+ HTML android.Path
+ Text android.Path
+ XML android.Path
+ ReferenceBaseline android.Path
+
+ TransitiveHTML *android.DepSet[android.Path]
+ TransitiveText *android.DepSet[android.Path]
+ TransitiveXML *android.DepSet[android.Path]
}
func (l *linter) enabled() bool {
@@ -447,11 +435,13 @@
depSetsBuilder := NewLintDepSetBuilder().Direct(html, text, xml)
ctx.VisitDirectDepsWithTag(staticLibTag, func(dep android.Module) {
- if depLint, ok := dep.(LintDepSetsIntf); ok {
- depSetsBuilder.Transitive(depLint.LintDepSets())
+ if info, ok := android.OtherModuleProvider(ctx, dep, LintProvider); ok {
+ depSetsBuilder.Transitive(info)
}
})
+ depSets := depSetsBuilder.Build()
+
rule.Command().Text("rm -rf").Flag(lintPaths.cacheDir.String()).Flag(lintPaths.homeDir.String())
rule.Command().Text("mkdir -p").Flag(lintPaths.cacheDir.String()).Flag(lintPaths.homeDir.String())
rule.Command().Text("rm -f").Output(html).Output(text).Output(xml)
@@ -530,22 +520,26 @@
rule.Build("lint", "lint")
- l.outputs = lintOutputs{
- html: html,
- text: text,
- xml: xml,
- referenceBaseline: referenceBaseline,
+ android.SetProvider(ctx, LintProvider, &LintInfo{
+ HTML: html,
+ Text: text,
+ XML: xml,
+ ReferenceBaseline: referenceBaseline,
- depSets: depSetsBuilder.Build(),
- }
+ TransitiveHTML: depSets.HTML,
+ TransitiveText: depSets.Text,
+ TransitiveXML: depSets.XML,
+ })
if l.buildModuleReportZip {
- l.reports = BuildModuleLintReportZips(ctx, l.LintDepSets())
+ l.reports = BuildModuleLintReportZips(ctx, depSets)
}
// Create a per-module phony target to run the lint check.
phonyName := ctx.ModuleName() + "-lint"
ctx.Phony(phonyName, xml)
+
+ ctx.SetOutputFiles(android.Paths{xml}, ".lint")
}
func BuildModuleLintReportZips(ctx android.ModuleContext, depSets LintDepSets) android.Paths {
@@ -642,7 +636,7 @@
return
}
- var outputs []*lintOutputs
+ var outputs []*LintInfo
var dirs []string
ctx.VisitAllModules(func(m android.Module) {
if ctx.Config().KatiEnabled() && !m.ExportedToMake() {
@@ -658,14 +652,14 @@
}
}
- if l, ok := m.(lintOutputsIntf); ok {
- outputs = append(outputs, l.lintOutputs())
+ if lintInfo, ok := android.OtherModuleProvider(ctx, m, LintProvider); ok {
+ outputs = append(outputs, lintInfo)
}
})
dirs = android.SortedUniqueStrings(dirs)
- zip := func(outputPath android.WritablePath, get func(*lintOutputs) android.Path) {
+ zip := func(outputPath android.WritablePath, get func(*LintInfo) android.Path) {
var paths android.Paths
for _, output := range outputs {
@@ -678,16 +672,16 @@
}
l.htmlZip = android.PathForOutput(ctx, "lint-report-html.zip")
- zip(l.htmlZip, func(l *lintOutputs) android.Path { return l.html })
+ zip(l.htmlZip, func(l *LintInfo) android.Path { return l.HTML })
l.textZip = android.PathForOutput(ctx, "lint-report-text.zip")
- zip(l.textZip, func(l *lintOutputs) android.Path { return l.text })
+ zip(l.textZip, func(l *LintInfo) android.Path { return l.Text })
l.xmlZip = android.PathForOutput(ctx, "lint-report-xml.zip")
- zip(l.xmlZip, func(l *lintOutputs) android.Path { return l.xml })
+ zip(l.xmlZip, func(l *LintInfo) android.Path { return l.XML })
l.referenceBaselineZip = android.PathForOutput(ctx, "lint-report-reference-baselines.zip")
- zip(l.referenceBaselineZip, func(l *lintOutputs) android.Path { return l.referenceBaseline })
+ zip(l.referenceBaselineZip, func(l *LintInfo) android.Path { return l.ReferenceBaseline })
ctx.Phony("lint-check", l.htmlZip, l.textZip, l.xmlZip, l.referenceBaselineZip)
}
diff --git a/java/sdk_library.go b/java/sdk_library.go
index 8a4f1f8..37e01e8 100644
--- a/java/sdk_library.go
+++ b/java/sdk_library.go
@@ -1280,7 +1280,7 @@
}
func CheckMinSdkVersion(ctx android.ModuleContext, module *Library) {
- android.CheckMinSdkVersion(ctx, module.MinSdkVersion(ctx), func(c android.ModuleContext, do android.PayloadDepsCallback) {
+ android.CheckMinSdkVersion(ctx, module.MinSdkVersion(ctx), func(c android.BaseModuleContext, do android.PayloadDepsCallback) {
ctx.WalkDeps(func(child android.Module, parent android.Module) bool {
isExternal := !module.depIsInSameApex(ctx, child)
if am, ok := child.(android.ApexModule); ok {
@@ -1471,7 +1471,10 @@
module.dexer.proguardDictionary = module.implLibraryModule.dexer.proguardDictionary
module.dexer.proguardUsageZip = module.implLibraryModule.dexer.proguardUsageZip
module.linter.reports = module.implLibraryModule.linter.reports
- module.linter.outputs.depSets = module.implLibraryModule.LintDepSets()
+
+ if lintInfo, ok := android.OtherModuleProvider(ctx, module.implLibraryModule, LintProvider); ok {
+ android.SetProvider(ctx, LintProvider, lintInfo)
+ }
if !module.Host() {
module.hostdexInstallFile = module.implLibraryModule.hostdexInstallFile
@@ -2207,14 +2210,6 @@
}
// to satisfy apex.javaDependency interface
-func (module *SdkLibraryImport) LintDepSets() LintDepSets {
- if module.implLibraryModule == nil {
- return LintDepSets{}
- } else {
- return module.implLibraryModule.LintDepSets()
- }
-}
-
func (module *SdkLibraryImport) GetStrictUpdatabilityLinting() bool {
if module.implLibraryModule == nil {
return false
diff --git a/java/sdk_library_external.go b/java/sdk_library_external.go
deleted file mode 100644
index 4f83981..0000000
--- a/java/sdk_library_external.go
+++ /dev/null
@@ -1,119 +0,0 @@
-// Copyright 2020 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 java
-
-import (
- "android/soong/android"
-)
-
-type partitionGroup int
-
-// Representation of partition group for checking inter-partition library dependencies.
-// Between system and system_ext, there are no restrictions of dependencies,
-// so we can treat these partitions as the same in terms of inter-partition dependency.
-// Same policy is applied between vendor and odm partiton.
-const (
- partitionGroupNone partitionGroup = iota
- // group for system, and system_ext partition
- partitionGroupSystem
- // group for vendor and odm partition
- partitionGroupVendor
- // product partition
- partitionGroupProduct
-)
-
-func (g partitionGroup) String() string {
- switch g {
- case partitionGroupSystem:
- return "system"
- case partitionGroupVendor:
- return "vendor"
- case partitionGroupProduct:
- return "product"
- }
-
- return ""
-}
-
-// Get partition group of java module that can be used at inter-partition dependency check.
-// We currently have three groups
-//
-// (system, system_ext) => system partition group
-// (vendor, odm) => vendor partition group
-// (product) => product partition group
-func (j *Module) partitionGroup(ctx android.EarlyModuleContext) partitionGroup {
- // system and system_ext partition can be treated as the same in terms of inter-partition dependency.
- if j.Platform() || j.SystemExtSpecific() {
- return partitionGroupSystem
- }
-
- // vendor and odm partition can be treated as the same in terms of inter-partition dependency.
- if j.SocSpecific() || j.DeviceSpecific() {
- return partitionGroupVendor
- }
-
- // product partition is independent.
- if j.ProductSpecific() {
- return partitionGroupProduct
- }
-
- panic("Cannot determine partition type")
-}
-
-func (j *Module) allowListedInterPartitionJavaLibrary(ctx android.EarlyModuleContext) bool {
- return inList(j.Name(), ctx.Config().InterPartitionJavaLibraryAllowList())
-}
-
-func (j *Module) syspropWithPublicStubs() bool {
- return j.deviceProperties.SyspropPublicStub != ""
-}
-
-type javaSdkLibraryEnforceContext interface {
- Name() string
- allowListedInterPartitionJavaLibrary(ctx android.EarlyModuleContext) bool
- partitionGroup(ctx android.EarlyModuleContext) partitionGroup
- syspropWithPublicStubs() bool
-}
-
-var _ javaSdkLibraryEnforceContext = (*Module)(nil)
-
-func (j *Module) checkPartitionsForJavaDependency(ctx android.EarlyModuleContext, propName string, dep javaSdkLibraryEnforceContext) {
- if dep.allowListedInterPartitionJavaLibrary(ctx) {
- return
- }
-
- if dep.syspropWithPublicStubs() {
- return
- }
-
- // If product interface is not enforced, skip check between system and product partition.
- // But still need to check between product and vendor partition because product interface flag
- // just represents enforcement between product and system, and vendor interface enforcement
- // that is enforced here by precondition is representing enforcement between vendor and other partitions.
- if !ctx.Config().EnforceProductPartitionInterface() {
- productToSystem := j.partitionGroup(ctx) == partitionGroupProduct && dep.partitionGroup(ctx) == partitionGroupSystem
- systemToProduct := j.partitionGroup(ctx) == partitionGroupSystem && dep.partitionGroup(ctx) == partitionGroupProduct
-
- if productToSystem || systemToProduct {
- return
- }
- }
-
- // If module and dependency library is inter-partition
- if j.partitionGroup(ctx) != dep.partitionGroup(ctx) {
- errorFormat := "dependency on java_library (%q) is not allowed across the partitions (%s -> %s), use java_sdk_library instead"
- ctx.PropertyErrorf(propName, errorFormat, dep.Name(), j.partitionGroup(ctx), dep.partitionGroup(ctx))
- }
-}
diff --git a/java/testing.go b/java/testing.go
index 0c79e9f..6cc9fd1 100644
--- a/java/testing.go
+++ b/java/testing.go
@@ -424,7 +424,9 @@
"kotlin-stdlib-jdk8",
"kotlin-annotations",
"stub-annotations",
+
"aconfig-annotations-lib",
+ "aconfig_storage_reader_java",
"unsupportedappusage",
}
diff --git a/rust/config/x86_64_device.go b/rust/config/x86_64_device.go
index fee1923..3c484d8 100644
--- a/rust/config/x86_64_device.go
+++ b/rust/config/x86_64_device.go
@@ -29,6 +29,7 @@
x86_64ArchVariantRustFlags = map[string][]string{
"": []string{},
+ "alderlake": []string{"-C target-cpu=alderlake"},
"broadwell": []string{"-C target-cpu=broadwell"},
"goldmont": []string{"-C target-cpu=goldmont"},
"goldmont-plus": []string{"-C target-cpu=goldmont-plus"},
diff --git a/rust/config/x86_device.go b/rust/config/x86_device.go
index 5d9d88a..3c597cc 100644
--- a/rust/config/x86_device.go
+++ b/rust/config/x86_device.go
@@ -27,6 +27,7 @@
x86ArchVariantRustFlags = map[string][]string{
"": []string{},
+ "alderlake": []string{"-C target-cpu=alderlake"},
"atom": []string{"-C target-cpu=atom"},
"broadwell": []string{"-C target-cpu=broadwell"},
"goldmont": []string{"-C target-cpu=goldmont"},
diff --git a/tradefed/autogen.go b/tradefed/autogen.go
index ddd0a80..e230795 100644
--- a/tradefed/autogen.go
+++ b/tradefed/autogen.go
@@ -196,16 +196,16 @@
}
var autogenInstrumentationTest = pctx.StaticRule("autogenInstrumentationTest", blueprint.RuleParams{
- Command: "${AutoGenTestConfigScript} $out $in ${EmptyTestConfig} $template ${extraConfigs}",
+ Command: "${AutoGenTestConfigScript} $out $in ${EmptyTestConfig} $template ${extraConfigs} ${extraTestRunnerConfigs}",
CommandDeps: []string{
"${AutoGenTestConfigScript}",
"${EmptyTestConfig}",
"$template",
},
-}, "name", "template", "extraConfigs")
+}, "name", "template", "extraConfigs", "extraTestRunnerConfigs")
func AutoGenInstrumentationTestConfig(ctx android.ModuleContext, testConfigProp *string,
- testConfigTemplateProp *string, manifest android.Path, testSuites []string, autoGenConfig *bool, configs []Config) android.Path {
+ testConfigTemplateProp *string, manifest android.Path, testSuites []string, autoGenConfig *bool, configs []Config, testRunnerConfigs []Option) android.Path {
path, autogenPath := testConfigPath(ctx, testConfigProp, testSuites, autoGenConfig, testConfigTemplateProp)
var configStrings []string
if autogenPath != nil {
@@ -220,15 +220,26 @@
extraConfigs := strings.Join(configStrings, fmt.Sprintf("\\n%s", test_xml_indent))
extraConfigs = fmt.Sprintf("--extra-configs '%s'", extraConfigs)
+ var testRunnerConfigStrings []string
+ for _, config := range testRunnerConfigs {
+ testRunnerConfigStrings = append(testRunnerConfigStrings, config.Config())
+ }
+ extraTestRunnerConfigs := strings.Join(testRunnerConfigStrings, fmt.Sprintf("\\n%s%s", test_xml_indent, test_xml_indent))
+ if len(extraTestRunnerConfigs) > 0 {
+ extraTestRunnerConfigs += fmt.Sprintf("\\n%s%s", test_xml_indent, test_xml_indent)
+ }
+ extraTestRunnerConfigs = fmt.Sprintf("--extra-test-runner-configs '%s'", extraTestRunnerConfigs)
+
ctx.Build(pctx, android.BuildParams{
Rule: autogenInstrumentationTest,
Description: "test config",
Input: manifest,
Output: autogenPath,
Args: map[string]string{
- "name": ctx.ModuleName(),
- "template": template,
- "extraConfigs": extraConfigs,
+ "name": ctx.ModuleName(),
+ "template": template,
+ "extraConfigs": extraConfigs,
+ "extraTestRunnerConfigs": extraTestRunnerConfigs,
},
})
return autogenPath
diff --git a/ui/build/soong.go b/ui/build/soong.go
index eb51022..41425ac 100644
--- a/ui/build/soong.go
+++ b/ui/build/soong.go
@@ -27,6 +27,7 @@
"strings"
"sync"
"sync/atomic"
+ "syscall"
"time"
"android/soong/ui/tracer"
@@ -780,7 +781,7 @@
hasNewDep := false
for _, dep := range cachedGlob.Deps {
info, err := os.Stat(dep)
- if errors.Is(err, fs.ErrNotExist) {
+ if errors.Is(err, fs.ErrNotExist) || errors.Is(err, syscall.ENOTDIR) {
hasNewDep = true
break
} else if err != nil {