diff --git a/ui/build/test_build.go b/ui/build/test_build.go index 31646802e..41acc2618 100644 --- a/ui/build/test_build.go +++ b/ui/build/test_build.go @@ -68,6 +68,7 @@ func testForDanglingRules(ctx Context, config Config) { miniBootstrapDir := filepath.Join(outDir, "soong", ".minibootstrap") modulePathsDir := filepath.Join(outDir, ".module_paths") variablesFilePath := filepath.Join(outDir, "soong", "soong.variables") + // dexpreopt.config is an input to the soong_docs action, which runs the // soong_build primary builder. However, this file is created from $(shell) // invocation at Kati parse time, so it's not an explicit output of any @@ -75,6 +76,9 @@ func testForDanglingRules(ctx Context, config Config) { // treated as an source file. dexpreoptConfigFilePath := filepath.Join(outDir, "soong", "dexpreopt.config") + // out/build_date.txt is considered a "source file" + buildDatetimeFilePath := filepath.Join(outDir, "build_date.txt") + danglingRules := make(map[string]bool) scanner := bufio.NewScanner(stdout) @@ -88,7 +92,8 @@ func testForDanglingRules(ctx Context, config Config) { strings.HasPrefix(line, miniBootstrapDir) || strings.HasPrefix(line, modulePathsDir) || line == variablesFilePath || - line == dexpreoptConfigFilePath { + line == dexpreoptConfigFilePath || + line == buildDatetimeFilePath { // Leaf node is in one of Soong's bootstrap directories, which do not have // full build rules in the primary build.ninja file. continue