From 19fbb07dabf3a0a0836e6c4b36fd5584a2d1957b Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Thu, 30 Jan 2025 18:19:29 -0800 Subject: Fix staging dir creation for adevice Adevice does a `ninja -t inputs -i droid` and filters the results for out/target/product/ to find files in the staging directories. We were just copying the staging directories without creating ninja rules before, so that failed. Actually create the ninja rules. The rules are created in the android_device module instead of the filesystem so that if you have multiple filesystems, they don't create conflicting installation rules. We should provide a way for tools like adevice to query the build system for installed files, no matter where they are in the out/ dir, and use that to replace this logic. This cl produces the following diff in out/target/product compared to soong-only builds before this change: https://paste.googleplex.com/4624734193713152 It's mostly empty directories, which I don't think matter for adevice. Bug: 393464638 Bug: 392957226 Test: `m installclean && m && launch_cvd && adevice update` says the device is up-to-date. Change-Id: Ifb52aaf5bc3edd2e3900546bf9df73a52d1022c0 --- filesystem/aconfig_files.go | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'filesystem/aconfig_files.go') diff --git a/filesystem/aconfig_files.go b/filesystem/aconfig_files.go index 9a3ca5408..6d034027d 100644 --- a/filesystem/aconfig_files.go +++ b/filesystem/aconfig_files.go @@ -34,7 +34,13 @@ type importAconfigDepDag struct { var importAconfigDependencyTag = interPartitionDepTag{} -func (f *filesystem) buildAconfigFlagsFiles(ctx android.ModuleContext, builder *android.RuleBuilder, specs map[string]android.PackagingSpec, dir android.OutputPath) { +func (f *filesystem) buildAconfigFlagsFiles( + ctx android.ModuleContext, + builder *android.RuleBuilder, + specs map[string]android.PackagingSpec, + dir android.OutputPath, + fullInstallPaths *[]FullInstallPathInfo, +) { var caches []android.Path for _, ps := range specs { caches = append(caches, ps.GetAconfigPaths()...) @@ -70,6 +76,10 @@ func (f *filesystem) buildAconfigFlagsFiles(ctx android.ModuleContext, builder * for _, cache := range caches { cmd.FlagWithInput("--cache ", cache) } + *fullInstallPaths = append(*fullInstallPaths, FullInstallPathInfo{ + FullInstallPath: android.PathForModuleInPartitionInstall(ctx, f.PartitionType(), "etc/aconfig_flags.pb"), + SourcePath: installAconfigFlagsPath, + }) f.appendToEntry(ctx, installAconfigFlagsPath) installAconfigStorageDir := dir.Join(ctx, "etc", "aconfig") @@ -90,6 +100,10 @@ func (f *filesystem) buildAconfigFlagsFiles(ctx android.ModuleContext, builder * FlagWithOutput("--out ", outputPath). FlagWithArg("--cache ", installAconfigFlagsPath.String()). FlagWithArg("--version ", strconv.Itoa(storageFilesVersion)) + *fullInstallPaths = append(*fullInstallPaths, FullInstallPathInfo{ + FullInstallPath: android.PathForModuleInPartitionInstall(ctx, f.PartitionType(), "etc/aconfig", fileName), + SourcePath: outputPath, + }) f.appendToEntry(ctx, outputPath) } -- cgit v1.2.3-59-g8ed1b