Add dependency checker special case for out/build_date.txt.

Test: Future TH presubmit.
Change-Id: I4f80cf12be4aa1a3040b38ac7c6bed593aefd65e
This commit is contained in:
Rupert Shuttleworth 2020-12-08 13:28:38 +00:00
parent 78b340f375
commit 0bc9a9ad6b

View file

@ -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