From 521e951ad41de6f82d289be7ba0d9fd63b16335e Mon Sep 17 00:00:00 2001 From: Cole Faust Date: Tue, 14 Sep 2021 15:06:23 -0700 Subject: [PATCH] Fix `m product-graph` `m product-graph` runs a "non-full" build, which skips some steps to improve performance. One of the steps it skips is making a .installable_files file. Soong reads this file and removes any files that were removed from the list in this file. It errored out if the file didn't exist. Make soong less strict about the presence of this file, because if it doesn't exist, there shouldn't be any installed files to remove either. Fixes: 168105598 Test: rm -rf out/, m product-graph Change-Id: I366f7b09d87911f9660d4e08c2d2f097cc04800f --- ui/build/cleanbuild.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ui/build/cleanbuild.go b/ui/build/cleanbuild.go index 65b91bcfe..a3a1aaf68 100644 --- a/ui/build/cleanbuild.go +++ b/ui/build/cleanbuild.go @@ -250,7 +250,10 @@ func cleanOldFiles(ctx Context, basePath, newFile string) { newFile = filepath.Join(basePath, newFile) oldFile := newFile + ".previous" - if _, err := os.Stat(newFile); err != nil { + if _, err := os.Stat(newFile); os.IsNotExist(err) { + // If the file doesn't exist, assume no installed files exist either + return + } else if err != nil { ctx.Fatalf("Expected %q to be readable", newFile) }