diff options
author | 2025-02-05 18:50:09 -0800 | |
---|---|---|
committer | 2025-02-05 18:50:09 -0800 | |
commit | 917b0ec873a3bd50808378fe0c41ec9c20efa3b0 (patch) | |
tree | 65414b1f632a5c97783c46ae9648d5aebb3e40d5 | |
parent | 3fcc4ef8fe6a10ffd267586a49ec27261058ab7e (diff) | |
parent | ace33911e77a93cd822eacc475c4034154e8de08 (diff) |
Merge changes from topic "dangling_build_metadata_files" into main
* changes:
Introduce an environment var to run "Test for dangling rules"
Add build_* meta files to allowlist in Dangling rules check
-rw-r--r-- | ui/build/build.go | 3 | ||||
-rw-r--r-- | ui/build/test_build.go | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/ui/build/build.go b/ui/build/build.go index ea867826c..95d7831d2 100644 --- a/ui/build/build.go +++ b/ui/build/build.go @@ -427,6 +427,9 @@ func evaluateWhatToRun(config Config, verboseln func(v ...interface{})) int { if config.Checkbuild() { what |= RunBuildTests } + if value, ok := config.environ.Get("RUN_BUILD_TESTS"); ok && value == "true" { + what |= RunBuildTests + } if !config.SkipConfig() { what |= RunProductConfig } else { diff --git a/ui/build/test_build.go b/ui/build/test_build.go index 7a2fd1668..87bec93a2 100644 --- a/ui/build/test_build.go +++ b/ui/build/test_build.go @@ -76,8 +76,10 @@ 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" + // out/build_(date|hostname|number).txt is considered a "source file" buildDatetimeFilePath := filepath.Join(outDir, "build_date.txt") + buildHostnameFilePath := filepath.Join(outDir, "soong", "build_hostname.txt") + buildNumberFilePath := filepath.Join(outDir, "soong", "build_number.txt") // release-config files are generated from the initial lunch or Kati phase // before running soong and ninja. @@ -102,6 +104,8 @@ func testForDanglingRules(ctx Context, config Config) { line == extraVariablesFilePath || line == dexpreoptConfigFilePath || line == buildDatetimeFilePath || + line == buildHostnameFilePath || + line == buildNumberFilePath || strings.HasPrefix(line, releaseConfigDir) || buildFingerPrintFilePattern.MatchString(line) { // Leaf node is in one of Soong's bootstrap directories, which do not have |