summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Android Build Coastguard Worker <android-build-coastguard-worker@google.com> 2025-03-21 20:05:43 -0700
committer Android Build Coastguard Worker <android-build-coastguard-worker@google.com> 2025-03-21 20:05:43 -0700
commit1248ced0cad29018090e65e3762585cdd774e864 (patch)
tree2789f57ad33c7bf8a28df9ded872139adcf05ac7
parent29e0a00b2a9010b7b30f004fb9f6a2ad7ea20bcb (diff)
parent716fc3438bce5e2018b47cf906195b4f9aecea5c (diff)
Snap for 13256841 from 716fc3438bce5e2018b47cf906195b4f9aecea5c to 25Q2-release
Change-Id: I4c3a8288d87d662237450f7cb929abe4669668ca
-rw-r--r--android/androidmk.go3
-rw-r--r--android/module.go12
-rw-r--r--android/module_proxy.go4
-rw-r--r--android/otatools_package_cert_zip.go2
-rw-r--r--android/packaging.go41
-rw-r--r--android/variable.go4
-rw-r--r--apex/androidmk.go21
-rw-r--r--apex/apex_test.go10
-rw-r--r--cc/cc.go21
-rw-r--r--cc/library_sdk_member.go5
-rw-r--r--cmd/soong_ui/main.go4
-rw-r--r--filesystem/android_device.go30
-rw-r--r--filesystem/bootimg.go8
-rw-r--r--filesystem/filesystem.go22
-rw-r--r--filesystem/filesystem_test.go33
-rw-r--r--filesystem/vbmeta.go18
-rw-r--r--fsgen/filesystem_creator.go17
-rw-r--r--fsgen/filesystem_creator_test.go145
-rw-r--r--fsgen/prebuilt_etc_modules_gen.go4
-rw-r--r--fsgen/vbmeta_partitions.go16
-rw-r--r--java/app_import.go2
-rw-r--r--java/dex.go8
-rw-r--r--rust/fuzz_test.go25
-rw-r--r--ui/build/androidmk_denylist.go55
-rw-r--r--ui/build/dumpvars.go7
25 files changed, 427 insertions, 90 deletions
diff --git a/android/androidmk.go b/android/androidmk.go
index 784559312..7cc6aef00 100644
--- a/android/androidmk.go
+++ b/android/androidmk.go
@@ -510,6 +510,9 @@ func (a *AndroidMkEntries) fillInEntries(ctx fillInEntriesContext, mod Module) {
a.EntryMap = make(map[string][]string)
base := mod.base()
name := base.BaseModuleName()
+ if bmn, ok := mod.(baseModuleName); ok {
+ name = bmn.BaseModuleName()
+ }
if a.OverrideName != "" {
name = a.OverrideName
}
diff --git a/android/module.go b/android/module.go
index ecd0f239c..c0abfd0a3 100644
--- a/android/module.go
+++ b/android/module.go
@@ -45,6 +45,14 @@ type Module interface {
// For more information, see Module.GenerateBuildActions within Blueprint's module_ctx.go
GenerateAndroidBuildActions(ModuleContext)
+ // CleanupAfterBuildActions is called after ModuleBase.GenerateBuildActions is finished.
+ // If all interactions with this module are handled via providers instead of direct access
+ // to the module then it can free memory attached to the module.
+ // This is a temporary measure to reduce memory usage, eventually blueprint's reference
+ // to the Module should be dropped after GenerateAndroidBuildActions once all accesses
+ // can be done through providers.
+ CleanupAfterBuildActions()
+
// Add dependencies to the components of a module, i.e. modules that are created
// by the module and which are considered to be part of the creating module.
//
@@ -2387,8 +2395,12 @@ func (m *ModuleBase) GenerateBuildActions(blueprintCtx blueprint.ModuleContext)
})
}
}
+
+ m.module.CleanupAfterBuildActions()
}
+func (m *ModuleBase) CleanupAfterBuildActions() {}
+
func SetJarJarPrefixHandler(handler func(ModuleContext)) {
if jarJarPrefixHandler != nil {
panic("jarJarPrefixHandler already set")
diff --git a/android/module_proxy.go b/android/module_proxy.go
index 561c4770c..81d90e9a0 100644
--- a/android/module_proxy.go
+++ b/android/module_proxy.go
@@ -27,6 +27,10 @@ func (m ModuleProxy) GenerateAndroidBuildActions(context ModuleContext) {
panic("method is not implemented on ModuleProxy")
}
+func (m ModuleProxy) CleanupAfterBuildActions() {
+ panic("method is not implemented on ModuleProxy")
+}
+
func (m ModuleProxy) ComponentDepsMutator(ctx BottomUpMutatorContext) {
panic("method is not implemented on ModuleProxy")
}
diff --git a/android/otatools_package_cert_zip.go b/android/otatools_package_cert_zip.go
index 03265cad3..3a654cfe5 100644
--- a/android/otatools_package_cert_zip.go
+++ b/android/otatools_package_cert_zip.go
@@ -39,7 +39,7 @@ func OtatoolsPackageFactory() Module {
var (
otatoolsPackageCertRule = pctx.AndroidStaticRule("otatools_package_cert_files", blueprint.RuleParams{
- Command: "echo $out: > ${out}.d && cat $in >> ${out}.d && ${SoongZipCmd} -o $out -l $in",
+ Command: "echo '$out : ' $$(cat $in) > ${out}.d && ${SoongZipCmd} -o $out -l $in",
CommandDeps: []string{"${SoongZipCmd}"},
Depfile: "${out}.d",
Description: "Zip otatools-package cert files",
diff --git a/android/packaging.go b/android/packaging.go
index bb1fe4e45..bf1840929 100644
--- a/android/packaging.go
+++ b/android/packaging.go
@@ -506,13 +506,11 @@ func (p *PackagingBase) GatherPackagingSpecsWithFilterAndModifier(ctx ModuleCont
// all packaging specs gathered from the high priority deps.
var highPriorities []PackagingSpec
- // Name of the dependency which requested the packaging spec.
- // If this dep is overridden, the packaging spec will not be installed via this dependency chain.
- // (the packaging spec might still be installed if there are some other deps which depend on it).
- var depNames []string
-
// list of module names overridden
- var overridden []string
+ overridden := make(map[string]bool)
+
+ // all installed modules which are not overridden.
+ modulesToInstall := make(map[string]bool)
var arches []ArchType
for _, target := range getSupportedTargets(ctx) {
@@ -529,6 +527,7 @@ func (p *PackagingBase) GatherPackagingSpecsWithFilterAndModifier(ctx ModuleCont
return false
}
+ // find all overridden modules and packaging specs
ctx.VisitDirectDepsProxy(func(child ModuleProxy) {
depTag := ctx.OtherModuleDependencyTag(child)
if pi, ok := depTag.(PackagingItem); !ok || !pi.IsPackagingItem() {
@@ -556,20 +555,32 @@ func (p *PackagingBase) GatherPackagingSpecsWithFilterAndModifier(ctx ModuleCont
regularPriorities = append(regularPriorities, ps)
}
- depNames = append(depNames, child.Name())
- overridden = append(overridden, ps.overrides.ToSlice()...)
+ for o := range ps.overrides.Iter() {
+ overridden[o] = true
+ }
+ }
+ })
+
+ // gather modules to install, skipping overridden modules
+ ctx.WalkDeps(func(child, parent Module) bool {
+ owner := ctx.OtherModuleName(child)
+ if o, ok := child.(OverridableModule); ok {
+ if overriddenBy := o.GetOverriddenBy(); overriddenBy != "" {
+ owner = overriddenBy
+ }
+ }
+ if overridden[owner] {
+ return false
}
+ modulesToInstall[owner] = true
+ return true
})
filterOverridden := func(input []PackagingSpec) []PackagingSpec {
- // input minus packaging specs that are overridden
+ // input minus packaging specs that are not installed
var filtered []PackagingSpec
- for index, ps := range input {
- if ps.owner != "" && InList(ps.owner, overridden) {
- continue
- }
- // The dependency which requested this packaging spec has been overridden.
- if InList(depNames[index], overridden) {
+ for _, ps := range input {
+ if !modulesToInstall[ps.owner] {
continue
}
filtered = append(filtered, ps)
diff --git a/android/variable.go b/android/variable.go
index 357d137c7..f00dd138b 100644
--- a/android/variable.go
+++ b/android/variable.go
@@ -715,6 +715,10 @@ type PartitionVariables struct {
ReleaseToolsExtensionDir string `json:",omitempty"`
+ BoardPartialOtaUpdatePartitionsList []string `json:",omitempty"`
+ BoardFlashBlockSize string `json:",omitempty"`
+ BootloaderInUpdatePackage bool `json:",omitempty"`
+
BoardFastbootInfoFile string `json:",omitempty"`
}
diff --git a/apex/androidmk.go b/apex/androidmk.go
index 3a81ee4e6..0a5644ae3 100644
--- a/apex/androidmk.go
+++ b/apex/androidmk.go
@@ -75,7 +75,7 @@ func (a *apexBundle) fullModuleName(apexBundleName string, linkToSystemLib bool,
// populated by Soong for unconverted APEXes, or Bazel in mixed mode. Use
// apexFile#isBazelPrebuilt to differentiate.
func (a *apexBundle) androidMkForFiles(w io.Writer, apexBundleName, moduleDir string,
- apexAndroidMkData android.AndroidMkData) []string {
+ apexAndroidMkData android.AndroidMkData) (archSpecificModuleNames []string, moduleNames []string) {
// apexBundleName comes from the 'name' property or soong module.
// apexName comes from 'name' property of apex_manifest.
@@ -84,11 +84,12 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, apexBundleName, moduleDir st
// However, symbol files for apex files are installed under /apex/<apexBundleName> to avoid
// conflicts between two apexes with the same apexName.
- moduleNames := []string{}
-
for _, fi := range a.filesInfo {
linkToSystemLib := a.linkToSystemLib && fi.transitiveDep && fi.availableToPlatform()
moduleName := a.fullModuleName(apexBundleName, linkToSystemLib, &fi)
+ if !android.InList(moduleName, moduleNames) {
+ moduleNames = append(moduleNames, moduleName)
+ }
// This name will be added to LOCAL_REQUIRED_MODULES of the APEX. We need to be
// arch-specific otherwise we will end up installing both ABIs even when only
@@ -100,8 +101,8 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, apexBundleName, moduleDir st
case "lib64":
aName = aName + ":64"
}
- if !android.InList(aName, moduleNames) {
- moduleNames = append(moduleNames, aName)
+ if !android.InList(aName, archSpecificModuleNames) {
+ archSpecificModuleNames = append(archSpecificModuleNames, aName)
}
if linkToSystemLib {
@@ -216,7 +217,7 @@ func (a *apexBundle) androidMkForFiles(w io.Writer, apexBundleName, moduleDir st
fmt.Fprintf(w, "%s: %s\n", fi.androidMkModuleName, moduleName)
}
}
- return moduleNames
+ return
}
func (a *apexBundle) writeRequiredModules(w io.Writer, moduleNames []string) {
@@ -235,9 +236,10 @@ func (a *apexBundle) androidMkForType() android.AndroidMkData {
return android.AndroidMkData{
// While we do not provide a value for `Extra`, AconfigUpdateAndroidMkData may add some, which we must honor.
Custom: func(w io.Writer, name, prefix, moduleDir string, data android.AndroidMkData) {
+ archSpecificModuleNames := []string{}
moduleNames := []string{}
if a.installable() {
- moduleNames = a.androidMkForFiles(w, name, moduleDir, data)
+ archSpecificModuleNames, moduleNames = a.androidMkForFiles(w, name, moduleDir, data)
}
fmt.Fprintln(w, "\ninclude $(CLEAR_VARS) # apex.apexBundle")
@@ -274,7 +276,7 @@ func (a *apexBundle) androidMkForType() android.AndroidMkData {
}
android.AndroidMkEmitAssignList(w, "LOCAL_OVERRIDES_MODULES", a.overridableProperties.Overrides)
- a.writeRequiredModules(w, moduleNames)
+ a.writeRequiredModules(w, archSpecificModuleNames)
// AconfigUpdateAndroidMkData may have added elements to Extra. Process them here.
for _, extra := range data.Extra {
extra(w, a.outputFile)
@@ -296,6 +298,9 @@ func (a *apexBundle) androidMkForType() android.AndroidMkData {
fmt.Fprintln(w, dist)
}
+ fmt.Fprintf(w, "ALL_MODULES.$(my_register_name).SYMBOLIC_OUTPUT_PATH := $(foreach m,%s,$(ALL_MODULES.$(m).SYMBOLIC_OUTPUT_PATH))\n", strings.Join(moduleNames, " "))
+ fmt.Fprintf(w, "ALL_MODULES.$(my_register_name).ELF_SYMBOL_MAPPING_PATH := $(foreach m,%s,$(ALL_MODULES.$(m).ELF_SYMBOL_MAPPING_PATH))\n", strings.Join(moduleNames, " "))
+
distCoverageFiles(w, "ndk_apis_usedby_apex", a.nativeApisUsedByModuleFile.String())
distCoverageFiles(w, "ndk_apis_backedby_apex", a.nativeApisBackedByModuleFile.String())
distCoverageFiles(w, "java_apis_used_by_apex", a.javaApisUsedByModuleFile.String())
diff --git a/apex/apex_test.go b/apex/apex_test.go
index 36a697487..327e018f4 100644
--- a/apex/apex_test.go
+++ b/apex/apex_test.go
@@ -11468,6 +11468,16 @@ func TestInstallationRulesForMultipleApexPrebuilts(t *testing.T) {
// 1. The contents of the selected apex_contributions are visible to make
// 2. The rest of the apexes in the mainline module family (source or other prebuilt) is hidden from make
checkHideFromMake(t, ctx, tc.expectedVisibleModuleName, tc.expectedHiddenModuleNames)
+
+ // Check that source_apex_name is written as LOCAL_MODULE for make packaging
+ if tc.expectedVisibleModuleName == "prebuilt_com.google.android.foo.v2" {
+ apex := ctx.ModuleForTests(t, "prebuilt_com.google.android.foo.v2", "android_common_prebuilt_com.android.foo").Module()
+ entries := android.AndroidMkEntriesForTest(t, ctx, apex)[0]
+
+ expected := "com.google.android.foo"
+ actual := entries.EntryMap["LOCAL_MODULE"][0]
+ android.AssertStringEquals(t, "LOCAL_MODULE", expected, actual)
+ }
}
}
diff --git a/cc/cc.go b/cc/cc.go
index 85d2ebfbb..c616165c5 100644
--- a/cc/cc.go
+++ b/cc/cc.go
@@ -2438,6 +2438,27 @@ func (c *Module) GenerateAndroidBuildActions(actx android.ModuleContext) {
}
}
+func (c *Module) CleanupAfterBuildActions() {
+ // Clear as much of Module as possible to reduce memory usage.
+ c.generators = nil
+ c.compiler = nil
+ c.installer = nil
+ c.features = nil
+ c.coverage = nil
+ c.fuzzer = nil
+ c.sabi = nil
+ c.lto = nil
+ c.afdo = nil
+ c.orderfile = nil
+
+ // TODO: these can be cleared after nativeBinaryInfoProperties and nativeLibInfoProperties are switched to
+ // using providers.
+ // c.linker = nil
+ // c.stl = nil
+ // c.sanitize = nil
+ // c.library = nil
+}
+
func CreateCommonLinkableInfo(ctx android.ModuleContext, mod VersionedLinkableInterface) *LinkableInfo {
info := &LinkableInfo{
StaticExecutable: mod.StaticExecutable(),
diff --git a/cc/library_sdk_member.go b/cc/library_sdk_member.go
index d1440eaad..46290300c 100644
--- a/cc/library_sdk_member.go
+++ b/cc/library_sdk_member.go
@@ -573,9 +573,8 @@ func (p *nativeLibInfoProperties) PopulateFromVariant(ctx android.SdkMemberConte
func getRequiredMemberOutputFile(ctx android.SdkMemberContext, ccModule *Module) android.Path {
var path android.Path
- outputFile := ccModule.OutputFile()
- if outputFile.Valid() {
- path = outputFile.Path()
+ if info, ok := android.OtherModuleProvider(ctx.SdkModuleContext(), ccModule, LinkableInfoProvider); ok && info.OutputFile.Valid() {
+ path = info.OutputFile.Path()
} else {
ctx.SdkModuleContext().ModuleErrorf("member variant %s does not have a valid output file", ccModule)
}
diff --git a/cmd/soong_ui/main.go b/cmd/soong_ui/main.go
index 4f6de82a2..584cc042d 100644
--- a/cmd/soong_ui/main.go
+++ b/cmd/soong_ui/main.go
@@ -333,7 +333,7 @@ func dumpVar(ctx build.Context, config build.Config, args []string) {
varName := flags.Arg(0)
if varName == "report_config" {
- varData, err := build.DumpMakeVars(ctx, config, nil, build.BannerVars)
+ varData, err := build.DumpMakeVars(ctx, config, nil, append(build.BannerVars, "PRODUCT_SOONG_ONLY"))
if err != nil {
ctx.Fatal(err)
}
@@ -400,7 +400,7 @@ func dumpVars(ctx build.Context, config build.Config, args []string) {
if i := indexList("report_config", allVars); i != -1 {
allVars = append(allVars[:i], allVars[i+1:]...)
- allVars = append(allVars, build.BannerVars...)
+ allVars = append(allVars, append(build.BannerVars, "PRODUCT_SOONG_ONLY")...)
}
if len(allVars) == 0 {
diff --git a/filesystem/android_device.go b/filesystem/android_device.go
index feb000dc4..b96c5eae3 100644
--- a/filesystem/android_device.go
+++ b/filesystem/android_device.go
@@ -90,6 +90,10 @@ type DeviceProperties struct {
Releasetools_extension *string `android:"path"`
FastbootInfo *string `android:"path"`
+ Partial_ota_update_partitions []string
+ Flash_block_size *string
+ Bootloader_in_update_package *bool
+
// The kernel version in the build. Will be verified against the actual kernel.
// If not provided, will attempt to extract it from the loose kernel or the kernel inside
// the boot image. The version is later used to decide whether or not to enable uffd_gc
@@ -391,6 +395,13 @@ func (a *androidDevice) distFiles(ctx android.ModuleContext) {
if a.deviceProps.Android_info != nil {
ctx.DistForGoal("droidcore-unbundled", android.PathForModuleSrc(ctx, *a.deviceProps.Android_info))
}
+ if a.miscInfo != nil {
+ ctx.DistForGoal("droidcore-unbundled", a.miscInfo)
+ if a.partitionProps.Super_partition_name != nil {
+ ctx.DistForGoalWithFilename("dist_files", a.miscInfo, "super_misc_info.txt")
+ }
+ }
+
}
}
@@ -840,14 +851,25 @@ func (a *androidDevice) addMiscInfo(ctx android.ModuleContext) android.Path {
Textf("echo avb_enable=true >> %s", miscInfo).
Textf("&& echo avb_building_vbmeta_image=true >> %s", miscInfo).
Textf("&& echo avb_avbtool=avbtool >> %s", miscInfo)
+
+ var allChainedVbmetaPartitionTypes []string
for _, vbmetaPartitionName := range a.partitionProps.Vbmeta_partitions {
img := ctx.GetDirectDepProxyWithTag(vbmetaPartitionName, filesystemDepTag)
if provider, ok := android.OtherModuleProvider(ctx, img, vbmetaPartitionProvider); ok {
builder.Command().Text("cat").Input(provider.PropFileForMiscInfo).Textf(" >> %s", miscInfo)
+ if provider.FilesystemPartitionType != "" { // the top-level vbmeta.img
+ allChainedVbmetaPartitionTypes = append(allChainedVbmetaPartitionTypes, provider.FilesystemPartitionType)
+ }
} else {
ctx.ModuleErrorf("vbmeta dep %s does not set vbmetaPartitionProvider\n", vbmetaPartitionName)
}
}
+ // Determine the custom vbmeta partitions by removing system and vendor
+ customVbmetaPartitionTypes := android.RemoveListFromList(allChainedVbmetaPartitionTypes, []string{"system", "vendor"})
+ builder.Command().Textf("echo avb_custom_vbmeta_images_partition_list=%s >> %s",
+ strings.Join(android.SortedUniqueStrings(customVbmetaPartitionTypes), " "),
+ miscInfo,
+ )
}
if a.partitionProps.Boot_partition_name != nil {
@@ -883,6 +905,14 @@ func (a *androidDevice) addMiscInfo(ctx android.ModuleContext) android.Path {
builder.Command().Text("cat").Input(bootImgInfo.PropFileForMiscInfo).Textf(" >> %s", miscInfo)
}
+ builder.Command().Textf("echo blocksize=%s >> %s", proptools.String(a.deviceProps.Flash_block_size), miscInfo)
+ if proptools.Bool(a.deviceProps.Bootloader_in_update_package) {
+ builder.Command().Textf("echo bootloader_in_update_package=true >> %s", miscInfo)
+ }
+ if len(a.deviceProps.Partial_ota_update_partitions) > 0 {
+ builder.Command().Textf("echo partial_ota_update_partitions_list=%s >> %s", strings.Join(a.deviceProps.Partial_ota_update_partitions, " "), miscInfo)
+ }
+
// Sort and dedup
builder.Command().Textf("sort -u %s -o %s", miscInfo, miscInfo)
diff --git a/filesystem/bootimg.go b/filesystem/bootimg.go
index 5ab0c6899..485eae47c 100644
--- a/filesystem/bootimg.go
+++ b/filesystem/bootimg.go
@@ -539,6 +539,14 @@ func (b *bootimg) buildPropFileForMiscInfo(ctx android.ModuleContext) android.Pa
bootImgType := proptools.String(b.properties.Boot_image_type)
addStr("avb_"+bootImgType+"_add_hash_footer_args", b.getAvbHashFooterArgs(ctx))
+ if ramdisk := proptools.String(b.properties.Ramdisk_module); ramdisk != "" {
+ ramdiskModule := ctx.GetDirectDepWithTag(ramdisk, bootimgRamdiskDep)
+ fsInfo, _ := android.OtherModuleProvider(ctx, ramdiskModule, FilesystemProvider)
+ if fsInfo.HasOrIsRecovery {
+ // Create a dup entry for recovery
+ addStr("avb_recovery_add_hash_footer_args", strings.ReplaceAll(b.getAvbHashFooterArgs(ctx), bootImgType, "recovery"))
+ }
+ }
if b.properties.Avb_private_key != nil {
addStr("avb_"+bootImgType+"_algorithm", proptools.StringDefault(b.properties.Avb_algorithm, "SHA256_RSA4096"))
addStr("avb_"+bootImgType+"_key_path", android.PathForModuleSrc(ctx, proptools.String(b.properties.Avb_private_key)).String())
diff --git a/filesystem/filesystem.go b/filesystem/filesystem.go
index e86ebf4fa..fd1c784ec 100644
--- a/filesystem/filesystem.go
+++ b/filesystem/filesystem.go
@@ -463,6 +463,9 @@ type FilesystemInfo struct {
AvbAlgorithm string
AvbHashAlgorithm string
AvbKey android.Path
+ PartitionName string
+ // HasOrIsRecovery returns true for recovery and for ramdisks with a recovery partition.
+ HasOrIsRecovery bool
}
// FullInstallPathInfo contains information about the "full install" paths of all the files
@@ -720,6 +723,8 @@ func (f *filesystem) GenerateAndroidBuildActions(ctx android.ModuleContext) {
HasFsverity: f.properties.Fsverity.Inputs.GetOrDefault(ctx, nil) != nil,
PropFileForMiscInfo: propFileForMiscInfo,
PartitionSize: f.properties.Partition_size,
+ PartitionName: f.partitionName(),
+ HasOrIsRecovery: f.hasOrIsRecovery(ctx),
}
if proptools.Bool(f.properties.Use_avb) {
fsInfo.UseAvb = true
@@ -1177,10 +1182,6 @@ func (f *filesystem) buildPropFileForMiscInfo(ctx android.ModuleContext) android
if proptools.Bool(f.properties.Use_avb) {
addStr("avb_"+f.partitionName()+"_hashtree_enable", "true")
- if f.properties.Avb_private_key != nil {
- key := android.PathForModuleSrc(ctx, *f.properties.Avb_private_key)
- addStr("avb_"+f.partitionName()+"_key_path", key.String())
- }
addStr("avb_"+f.partitionName()+"_add_hashtree_footer_args", strings.TrimSpace(f.getAvbAddHashtreeFooterArgs(ctx)))
}
@@ -1307,6 +1308,19 @@ func includeFilesInstalledFiles(ctx android.ModuleContext) (ret []depset.DepSet[
return
}
+func (f *filesystem) hasOrIsRecovery(ctx android.ModuleContext) bool {
+ if f.partitionName() == "recovery" {
+ return true
+ }
+ ret := false
+ ctx.VisitDirectDepsWithTag(interPartitionInstallDependencyTag, func(m android.Module) {
+ if fsProvider, ok := android.OtherModuleProvider(ctx, m, FilesystemProvider); ok && fsProvider.PartitionName == "recovery" {
+ ret = true
+ }
+ })
+ return ret
+}
+
func (f *filesystem) buildCpioImage(
ctx android.ModuleContext,
builder *android.RuleBuilder,
diff --git a/filesystem/filesystem_test.go b/filesystem/filesystem_test.go
index bf7f5b64b..e57e45cb6 100644
--- a/filesystem/filesystem_test.go
+++ b/filesystem/filesystem_test.go
@@ -736,15 +736,14 @@ func TestOverrideModulesInDeps(t *testing.T) {
stl: "none",
system_shared_libs: [],
}
- android_filesystem {
- name: "myfilesystem",
- deps: ["myapp"],
+ phony {
+ name: "myapp_phony",
+ required: ["myapp"],
}
- android_filesystem {
- name: "myfilesystem_overridden",
- deps: ["myapp", "myoverrideapp"],
+ phony {
+ name: "myoverrideapp_phony",
+ required: ["myoverrideapp"],
}
-
android_app {
name: "myapp",
platform_apis: true,
@@ -755,15 +754,29 @@ func TestOverrideModulesInDeps(t *testing.T) {
base: "myapp",
required: ["libbar"],
}
+ android_filesystem {
+ name: "myfilesystem",
+ deps: ["myapp"],
+ }
+ android_filesystem {
+ name: "myfilesystem_overridden",
+ deps: ["myapp", "myoverrideapp"],
+ }
+ android_filesystem {
+ name: "myfilesystem_overridden_indirect",
+ deps: ["myapp_phony", "myoverrideapp_phony"],
+ }
`)
partition := result.ModuleForTests(t, "myfilesystem", "android_common")
fileList := android.ContentFromFileRuleForTests(t, result.TestContext, partition.Output("fileList"))
android.AssertStringEquals(t, "filesystem without override app", "app/myapp/myapp.apk\nlib64/libfoo.so\n", fileList)
- overriddenPartition := result.ModuleForTests(t, "myfilesystem_overridden", "android_common")
- overriddenFileList := android.ContentFromFileRuleForTests(t, result.TestContext, overriddenPartition.Output("fileList"))
- android.AssertStringEquals(t, "filesystem with override app", "app/myoverrideapp/myoverrideapp.apk\nlib64/libbar.so\n", overriddenFileList)
+ for _, overridden := range []string{"myfilesystem_overridden", "myfilesystem_overridden_indirect"} {
+ overriddenPartition := result.ModuleForTests(t, overridden, "android_common")
+ overriddenFileList := android.ContentFromFileRuleForTests(t, result.TestContext, overriddenPartition.Output("fileList"))
+ android.AssertStringEquals(t, "filesystem with "+overridden, "app/myoverrideapp/myoverrideapp.apk\nlib64/libbar.so\n", overriddenFileList)
+ }
}
func TestRamdiskPartitionSetsDevNodes(t *testing.T) {
diff --git a/filesystem/vbmeta.go b/filesystem/vbmeta.go
index d59a2aec5..e7a39bef7 100644
--- a/filesystem/vbmeta.go
+++ b/filesystem/vbmeta.go
@@ -55,6 +55,10 @@ type VbmetaProperties struct {
// Name of the partition stored in vbmeta desc. Defaults to the name of this module.
Partition_name *string
+ // Type of the `android_filesystem` for which the vbmeta.img is created.
+ // Examples are system, vendor, product.
+ Filesystem_partition_type *string
+
// Set the name of the output. Defaults to <module_name>.img.
Stem *string
@@ -118,6 +122,9 @@ type vbmetaPartitionInfo struct {
// Name of the partition
Name string
+ // Partition type of the correspdonding android_filesystem.
+ FilesystemPartitionType string
+
// Rollback index location, non-negative int
RollbackIndexLocation int
@@ -305,11 +312,12 @@ func (v *vbmeta) GenerateAndroidBuildActions(ctx android.ModuleContext) {
})
android.SetProvider(ctx, vbmetaPartitionProvider, vbmetaPartitionInfo{
- Name: v.partitionName(),
- RollbackIndexLocation: ril,
- PublicKey: extractedPublicKey,
- Output: output,
- PropFileForMiscInfo: v.buildPropFileForMiscInfo(ctx),
+ Name: v.partitionName(),
+ FilesystemPartitionType: proptools.String(v.properties.Filesystem_partition_type),
+ RollbackIndexLocation: ril,
+ PublicKey: extractedPublicKey,
+ Output: output,
+ PropFileForMiscInfo: v.buildPropFileForMiscInfo(ctx),
})
ctx.SetOutputFiles([]android.Path{output}, "")
diff --git a/fsgen/filesystem_creator.go b/fsgen/filesystem_creator.go
index b73fb219f..14aa062fc 100644
--- a/fsgen/filesystem_creator.go
+++ b/fsgen/filesystem_creator.go
@@ -419,13 +419,16 @@ func (f *filesystemCreator) createDeviceModule(
partitionProps.Vbmeta_partitions = vbmetaPartitions
deviceProps := &filesystem.DeviceProperties{
- Main_device: proptools.BoolPtr(true),
- Ab_ota_updater: proptools.BoolPtr(ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.AbOtaUpdater),
- Ab_ota_partitions: ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.AbOtaPartitions,
- Ab_ota_postinstall_config: ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.AbOtaPostInstallConfig,
- Ramdisk_node_list: proptools.StringPtr(":ramdisk_node_list"),
- Android_info: proptools.StringPtr(":" + generatedModuleName(ctx.Config(), "android_info.prop{.txt}")),
- Kernel_version: ctx.Config().ProductVariables().BoardKernelVersion,
+ Main_device: proptools.BoolPtr(true),
+ Ab_ota_updater: proptools.BoolPtr(ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.AbOtaUpdater),
+ Ab_ota_partitions: ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.AbOtaPartitions,
+ Ab_ota_postinstall_config: ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.AbOtaPostInstallConfig,
+ Ramdisk_node_list: proptools.StringPtr(":ramdisk_node_list"),
+ Android_info: proptools.StringPtr(":" + generatedModuleName(ctx.Config(), "android_info.prop{.txt}")),
+ Kernel_version: ctx.Config().ProductVariables().BoardKernelVersion,
+ Partial_ota_update_partitions: ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.BoardPartialOtaUpdatePartitionsList,
+ Flash_block_size: proptools.StringPtr(ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.BoardFlashBlockSize),
+ Bootloader_in_update_package: proptools.BoolPtr(ctx.Config().ProductVariables().PartitionVarsForSoongMigrationOnlyDoNotUse.BootloaderInUpdatePackage),
}
if bootloader, ok := f.createBootloaderFilegroup(ctx); ok {
diff --git a/fsgen/filesystem_creator_test.go b/fsgen/filesystem_creator_test.go
index 651d2d1a9..2c4d3c817 100644
--- a/fsgen/filesystem_creator_test.go
+++ b/fsgen/filesystem_creator_test.go
@@ -289,6 +289,10 @@ func TestPrebuiltEtcModuleGen(t *testing.T) {
"device/sample/etc/apns-full-conf.xml:product/etc/apns-conf-2.xml",
"device/sample/etc/apns-full-conf.xml:system/foo/file.txt",
"device/sample/etc/apns-full-conf.xml:system/foo/apns-full-conf.xml",
+ "device/sample/firmware/firmware.bin:recovery/root/firmware.bin",
+ "device/sample/firmware/firmware.bin:recovery/root/firmware-2.bin",
+ "device/sample/firmware/firmware.bin:recovery/root/lib/firmware/firmware.bin",
+ "device/sample/firmware/firmware.bin:recovery/root/lib/firmware/firmware-2.bin",
}
config.TestProductVariables.PartitionVarsForSoongMigrationOnlyDoNotUse.PartitionQualifiedVariables =
map[string]android.PartitionQualifiedVariablesType{
@@ -309,6 +313,7 @@ func TestPrebuiltEtcModuleGen(t *testing.T) {
"frameworks/base/data/keyboards/Vendor_0079_Product_0011.kl": nil,
"frameworks/base/data/keyboards/Vendor_0079_Product_18d4.kl": nil,
"device/sample/etc/apns-full-conf.xml": nil,
+ "device/sample/firmware/firmware.bin": nil,
}),
).RunTest(t)
@@ -324,7 +329,7 @@ func TestPrebuiltEtcModuleGen(t *testing.T) {
// check generated prebuilt_* module type install path and install partition
generatedModule := result.ModuleForTests(t, "system-frameworks_base_config-etc-0", "android_arm64_armv8-a").Module()
- etcModule, _ := generatedModule.(*etc.PrebuiltEtc)
+ etcModule := generatedModule.(*etc.PrebuiltEtc)
android.AssertStringEquals(
t,
"module expected to have etc install path",
@@ -342,7 +347,7 @@ func TestPrebuiltEtcModuleGen(t *testing.T) {
// check generated prebuilt_* module specifies correct relative_install_path property
generatedModule = result.ModuleForTests(t, "system-frameworks_base_data_keyboards-usr_keylayout_subdir-0", "android_arm64_armv8-a").Module()
- etcModule, _ = generatedModule.(*etc.PrebuiltEtc)
+ etcModule = generatedModule.(*etc.PrebuiltEtc)
android.AssertStringEquals(
t,
"module expected to set correct relative_install_path properties",
@@ -490,7 +495,7 @@ func TestPrebuiltEtcModuleGen(t *testing.T) {
)
// check generated prebuilt_* module specifies correct install path and relative install path
- etcModule, _ = generatedModule1.(*etc.PrebuiltEtc)
+ etcModule = generatedModule1.(*etc.PrebuiltEtc)
android.AssertStringEquals(
t,
"module expected to have . install path",
@@ -520,4 +525,138 @@ func TestPrebuiltEtcModuleGen(t *testing.T) {
return ""
}),
)
+
+ generatedModule0 = result.ModuleForTests(t, "recovery-device_sample_firmware-0", "android_recovery_arm64_armv8-a").Module()
+ generatedModule1 = result.ModuleForTests(t, "recovery-device_sample_firmware-1", "android_recovery_common").Module()
+
+ // check generated prebuilt_* module specifies correct install path and relative install path
+ etcModule = generatedModule0.(*etc.PrebuiltEtc)
+ android.AssertStringEquals(
+ t,
+ "module expected to have . install path",
+ ".",
+ etcModule.BaseDir(),
+ )
+ android.AssertStringEquals(
+ t,
+ "module expected to set empty relative_install_path properties",
+ "",
+ etcModule.SubDir(),
+ )
+
+ // check that generated prebuilt_* module don't set dsts
+ eval = generatedModule0.ConfigurableEvaluator(android.PanickingConfigAndErrorContext(result.TestContext))
+ android.AssertStringEquals(
+ t,
+ "module expected to not set dsts property",
+ "",
+ getModuleProp(generatedModule0, func(actual interface{}) string {
+ if p, ok := actual.(*etc.PrebuiltDstsProperties); ok {
+ dsts := p.Dsts.GetOrDefault(eval, nil)
+ if len(dsts) != 0 {
+ return dsts[0]
+ }
+ }
+ return ""
+ }),
+ )
+
+ // check generated prebuilt_* module specifies correct install path and relative install path
+ etcModule = generatedModule1.(*etc.PrebuiltEtc)
+ android.AssertStringEquals(
+ t,
+ "module expected to have . install path",
+ ".",
+ etcModule.BaseDir(),
+ )
+ android.AssertStringEquals(
+ t,
+ "module expected to set empty relative_install_path properties",
+ "",
+ etcModule.SubDir(),
+ )
+
+ // check that generated prebuilt_* module sets correct dsts
+ eval = generatedModule1.ConfigurableEvaluator(android.PanickingConfigAndErrorContext(result.TestContext))
+ android.AssertStringEquals(
+ t,
+ "module expected to set correct dsts property",
+ "firmware-2.bin",
+ getModuleProp(generatedModule1, func(actual interface{}) string {
+ if p, ok := actual.(*etc.PrebuiltDstsProperties); ok {
+ dsts := p.Dsts.GetOrDefault(eval, nil)
+ if len(dsts) == 1 {
+ return dsts[0]
+ }
+ }
+ return ""
+ }),
+ )
+
+ generatedModule0 = result.ModuleForTests(t, "recovery-device_sample_firmware-lib_firmware-0", "android_recovery_common").Module()
+ generatedModule1 = result.ModuleForTests(t, "recovery-device_sample_firmware-lib_firmware-1", "android_recovery_common").Module()
+
+ // check generated prebuilt_* module specifies correct install path and relative install path
+ etcModule = generatedModule0.(*etc.PrebuiltEtc)
+ android.AssertStringEquals(
+ t,
+ "module expected to have . install path",
+ ".",
+ etcModule.BaseDir(),
+ )
+ android.AssertStringEquals(
+ t,
+ "module expected to set correct relative_install_path properties",
+ "lib/firmware",
+ etcModule.SubDir(),
+ )
+
+ // check that generated prebuilt_* module sets correct srcs
+ eval = generatedModule0.ConfigurableEvaluator(android.PanickingConfigAndErrorContext(result.TestContext))
+ android.AssertStringEquals(
+ t,
+ "module expected to not set dsts property",
+ "",
+ getModuleProp(generatedModule0, func(actual interface{}) string {
+ if p, ok := actual.(*etc.PrebuiltDstsProperties); ok {
+ dsts := p.Dsts.GetOrDefault(eval, nil)
+ if len(dsts) != 0 {
+ return dsts[0]
+ }
+ }
+ return ""
+ }),
+ )
+
+ // check generated prebuilt_* module specifies correct install path and relative install path
+ etcModule = generatedModule1.(*etc.PrebuiltEtc)
+ android.AssertStringEquals(
+ t,
+ "module expected to have . install path",
+ ".",
+ etcModule.BaseDir(),
+ )
+ android.AssertStringEquals(
+ t,
+ "module expected to set empty relative_install_path properties",
+ "",
+ etcModule.SubDir(),
+ )
+
+ // check that generated prebuilt_* module sets correct srcs
+ eval = generatedModule1.ConfigurableEvaluator(android.PanickingConfigAndErrorContext(result.TestContext))
+ android.AssertStringEquals(
+ t,
+ "module expected to set correct dsts property",
+ "lib/firmware/firmware-2.bin",
+ getModuleProp(generatedModule1, func(actual interface{}) string {
+ if p, ok := actual.(*etc.PrebuiltDstsProperties); ok {
+ dsts := p.Dsts.GetOrDefault(eval, nil)
+ if len(dsts) == 1 {
+ return dsts[0]
+ }
+ }
+ return ""
+ }),
+ )
}
diff --git a/fsgen/prebuilt_etc_modules_gen.go b/fsgen/prebuilt_etc_modules_gen.go
index e9dabe44c..c0f114caf 100644
--- a/fsgen/prebuilt_etc_modules_gen.go
+++ b/fsgen/prebuilt_etc_modules_gen.go
@@ -337,6 +337,10 @@ func createPrebuiltEtcModulesInDirectory(ctx android.LoadHookContext, partition,
propsList = append(propsList, &prebuiltInstallInRootProperties{
Install_in_root: proptools.BoolPtr(true),
})
+ // Discard any previously picked module and force it to prebuilt_{root,any} as
+ // they are the only modules allowed to specify the `install_in_root` property.
+ etcInstallPathKey = ""
+ relDestDirFromInstallDirBase = destDir
}
// Set appropriate srcs, dsts, and releative_install_path based on
diff --git a/fsgen/vbmeta_partitions.go b/fsgen/vbmeta_partitions.go
index 11f4bd013..594c40482 100644
--- a/fsgen/vbmeta_partitions.go
+++ b/fsgen/vbmeta_partitions.go
@@ -76,6 +76,7 @@ func (f *filesystemCreator) createVbmetaPartitions(ctx android.LoadHookContext,
var chainedPartitionTypes []string
for _, chainedName := range android.SortedKeys(partitionVars.ChainedVbmetaPartitions) {
props := partitionVars.ChainedVbmetaPartitions[chainedName]
+ filesystemPartitionType := chainedName
chainedName = "vbmeta_" + chainedName
if len(props.Partitions) == 0 {
continue
@@ -123,13 +124,14 @@ func (f *filesystemCreator) createVbmetaPartitions(ctx android.LoadHookContext,
filesystem.VbmetaFactory,
".", // Create in the root directory for now so its easy to get the key
&filesystem.VbmetaProperties{
- Partition_name: proptools.StringPtr(chainedName),
- Stem: proptools.StringPtr(chainedName + ".img"),
- Private_key: proptools.StringPtr(props.Key),
- Algorithm: &props.Algorithm,
- Rollback_index: rollbackIndex,
- Rollback_index_location: &ril,
- Partitions: proptools.NewSimpleConfigurable(partitionModules),
+ Partition_name: proptools.StringPtr(chainedName),
+ Filesystem_partition_type: proptools.StringPtr(filesystemPartitionType),
+ Stem: proptools.StringPtr(chainedName + ".img"),
+ Private_key: proptools.StringPtr(props.Key),
+ Algorithm: &props.Algorithm,
+ Rollback_index: rollbackIndex,
+ Rollback_index_location: &ril,
+ Partitions: proptools.NewSimpleConfigurable(partitionModules),
}, &struct {
Name *string
}{
diff --git a/java/app_import.go b/java/app_import.go
index c0e8171d5..9fb13ba3c 100644
--- a/java/app_import.go
+++ b/java/app_import.go
@@ -338,7 +338,7 @@ func (a *AndroidAppImport) stripEmbeddedJniLibsUnusedArch(
for _, target := range ctx.MultiTargets() {
supported_abis := target.Arch.Abi
for _, arch := range supported_abis {
- wantedJniLibSlice = append(wantedJniLibSlice, " -X lib/"+arch+"/*.so")
+ wantedJniLibSlice = append(wantedJniLibSlice, " -X 'lib/"+arch+"/*.so'")
}
}
wantedJniLibString := strings.Join(wantedJniLibSlice, " ")
diff --git a/java/dex.go b/java/dex.go
index dd6467546..f2406fb3c 100644
--- a/java/dex.go
+++ b/java/dex.go
@@ -42,6 +42,9 @@ type DexProperties struct {
// True if the module containing this has it set by default.
EnabledByDefault bool `blueprint:"mutated"`
+ // If true, then this module will be optimized on eng builds.
+ Enabled_on_eng *bool
+
// Whether to allow that library classes inherit from program classes.
// Defaults to false.
Ignore_library_extends_program *bool
@@ -162,7 +165,10 @@ type dexer struct {
}
func (d *dexer) effectiveOptimizeEnabled(ctx android.EarlyModuleContext) bool {
- return BoolDefault(d.dexProperties.Optimize.Enabled, d.dexProperties.Optimize.EnabledByDefault && !ctx.Config().Eng())
+ if ctx.Config().Eng() {
+ return proptools.Bool(d.dexProperties.Optimize.Enabled_on_eng)
+ }
+ return BoolDefault(d.dexProperties.Optimize.Enabled, d.dexProperties.Optimize.EnabledByDefault)
}
func (d *DexProperties) resourceShrinkingEnabled(ctx android.ModuleContext) bool {
diff --git a/rust/fuzz_test.go b/rust/fuzz_test.go
index bdcfbbba1..f462795aa 100644
--- a/rust/fuzz_test.go
+++ b/rust/fuzz_test.go
@@ -134,17 +134,24 @@ func TestCCFuzzDepBundling(t *testing.T) {
}
`)
- fuzz_shared_libtest := ctx.ModuleForTests(t, "fuzz_shared_libtest", "android_arm64_armv8-a_fuzzer").Module().(cc.LinkableInterface)
- fuzz_static_libtest := ctx.ModuleForTests(t, "fuzz_static_libtest", "android_arm64_armv8-a_fuzzer").Module().(cc.LinkableInterface)
- fuzz_staticffi_libtest := ctx.ModuleForTests(t, "fuzz_staticffi_libtest", "android_arm64_armv8-a_fuzzer").Module().(cc.LinkableInterface)
+ fuzz_shared_libtest := ctx.ModuleForTests(t, "fuzz_shared_libtest", "android_arm64_armv8-a_fuzzer").Module()
+ fuzz_static_libtest := ctx.ModuleForTests(t, "fuzz_static_libtest", "android_arm64_armv8-a_fuzzer").Module()
+ fuzz_staticffi_libtest := ctx.ModuleForTests(t, "fuzz_staticffi_libtest", "android_arm64_armv8-a_fuzzer").Module()
- if !strings.Contains(fuzz_shared_libtest.FuzzSharedLibraries().String(), ":libcc_transitive_dep.so") {
- t.Errorf("cc_fuzz does not contain the expected bundled transitive shared libs from rust_ffi_shared ('libcc_transitive_dep'): %#v", fuzz_shared_libtest.FuzzSharedLibraries().String())
+ fuzzSharedLibraries := func(module android.Module) string {
+ if info, ok := android.OtherModuleProvider(ctx, module, cc.LinkableInfoProvider); ok {
+ return info.FuzzSharedLibraries.String()
+ }
+ return ""
}
- if !strings.Contains(fuzz_static_libtest.FuzzSharedLibraries().String(), ":libcc_transitive_dep.so") {
- t.Errorf("cc_fuzz does not contain the expected bundled transitive shared libs from rust_ffi_static ('libcc_transitive_dep'): %#v", fuzz_static_libtest.FuzzSharedLibraries().String())
+
+ if libs := fuzzSharedLibraries(fuzz_shared_libtest); !strings.Contains(libs, ":libcc_transitive_dep.so") {
+ t.Errorf("cc_fuzz does not contain the expected bundled transitive shared libs from rust_ffi_shared ('libcc_transitive_dep'): %#v", libs)
+ }
+ if libs := fuzzSharedLibraries(fuzz_static_libtest); !strings.Contains(libs, ":libcc_transitive_dep.so") {
+ t.Errorf("cc_fuzz does not contain the expected bundled transitive shared libs from rust_ffi_static ('libcc_transitive_dep'): %#v", libs)
}
- if !strings.Contains(fuzz_staticffi_libtest.FuzzSharedLibraries().String(), ":libcc_transitive_dep.so") {
- t.Errorf("cc_fuzz does not contain the expected bundled transitive shared libs from rust_ffi_static ('libcc_transitive_dep'): %#v", fuzz_staticffi_libtest.FuzzSharedLibraries().String())
+ if libs := fuzzSharedLibraries(fuzz_staticffi_libtest); !strings.Contains(libs, ":libcc_transitive_dep.so") {
+ t.Errorf("cc_fuzz does not contain the expected bundled transitive shared libs from rust_ffi_static ('libcc_transitive_dep'): %#v", libs)
}
}
diff --git a/ui/build/androidmk_denylist.go b/ui/build/androidmk_denylist.go
index cd49ec876..622aadb95 100644
--- a/ui/build/androidmk_denylist.go
+++ b/ui/build/androidmk_denylist.go
@@ -15,20 +15,29 @@
package build
import (
+ "os"
+ "slices"
"strings"
)
var androidmk_denylist []string = []string{
+ "art/",
"bionic/",
- "chained_build_config/",
+ "bootable/",
+ "build/",
"cts/",
"dalvik/",
"developers/",
"development/",
"device/common/",
+ "device/generic/",
+ "device/google/",
"device/google_car/",
"device/sample/",
+ "external/",
"frameworks/",
+ "hardware/google/",
+ "hardware/interfaces/",
"hardware/libhardware/",
"hardware/libhardware_legacy/",
"hardware/ril/",
@@ -45,24 +54,38 @@ var androidmk_denylist []string = []string{
"sdk/",
"system/",
"test/",
+ "tools/",
"trusty/",
- // Add back toolchain/ once defensive Android.mk files are removed
- //"toolchain/",
- "vendor/google_contexthub/",
- "vendor/google_data/",
- "vendor/google_elmyra/",
- "vendor/google_mhl/",
- "vendor/google_pdk/",
- "vendor/google_testing/",
- "vendor/partner_testing/",
- "vendor/partner_tools/",
- "vendor/pdk/",
+ "toolchain/",
+}
+
+var androidmk_allowlist []string = []string{
+ "art/Android.mk",
+ "bootable/deprecated-ota/updater/Android.mk",
+}
+
+func getAllLines(ctx Context, filename string) []string {
+ bytes, err := os.ReadFile(filename)
+ if err != nil {
+ if os.IsNotExist(err) {
+ return []string{}
+ } else {
+ ctx.Fatalf("Could not read %s: %v", filename, err)
+ }
+ }
+ return strings.Split(strings.Trim(string(bytes), " \n"), "\n")
}
func blockAndroidMks(ctx Context, androidMks []string) {
+ allowlist := getAllLines(ctx, "vendor/google/build/androidmk/allowlist.txt")
+ androidmk_allowlist = append(androidmk_allowlist, allowlist...)
+
+ denylist := getAllLines(ctx, "vendor/google/build/androidmk/denylist.txt")
+ androidmk_denylist = append(androidmk_denylist, denylist...)
+
for _, mkFile := range androidMks {
for _, d := range androidmk_denylist {
- if strings.HasPrefix(mkFile, d) {
+ if strings.HasPrefix(mkFile, d) && !slices.Contains(androidmk_allowlist, mkFile) {
ctx.Fatalf("Found blocked Android.mk file: %s. "+
"Please see androidmk_denylist.go for the blocked directories and contact build system team if the file should not be blocked.", mkFile)
}
@@ -86,6 +109,12 @@ var external_androidmks []string = []string{
// These directories hold the published Android SDK, used in Unbundled Gradle builds.
"prebuilts/fullsdk-darwin",
"prebuilts/fullsdk-linux",
+ // wpa_supplicant_8 has been converted to Android.bp and Android.mk files are kept for troubleshooting.
+ "external/wpa_supplicant_8/",
+ // Empty Android.mk in package's top directory
+ "external/proguard/",
+ "external/swig/",
+ "toolchain/",
}
var art_androidmks = []string{
diff --git a/ui/build/dumpvars.go b/ui/build/dumpvars.go
index 16a3db8e6..710be8407 100644
--- a/ui/build/dumpvars.go
+++ b/ui/build/dumpvars.go
@@ -181,7 +181,12 @@ func Banner(config Config, make_vars map[string]string) string {
fmt.Fprintf(b, "%s=%s\n", name, make_vars[name])
}
}
- fmt.Fprintf(b, "SOONG_ONLY=%t\n", config.soongOnlyRequested)
+ if config.skipKatiControlledByFlags {
+ fmt.Fprintf(b, "SOONG_ONLY=%t\n", config.soongOnlyRequested)
+ } else { // default for this product
+ fmt.Fprintf(b, "SOONG_ONLY=%t\n", make_vars["PRODUCT_SOONG_ONLY"] == "true")
+ }
+
fmt.Fprint(b, "============================================")
return b.String()