aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2017-10-06 17:45:07 -0700
committerColin Cross <ccross@android.com>2017-11-13 12:47:42 -0800
commit7709a057706b478c9687f1facaca115cb61cb169 (patch)
treea337ff92d6559a5770613b65076fff5b11c00653 /cmd
parenta0059915d17e629b6c11cee366497be8f3f41d5a (diff)
downloadbuild_soong-7709a057706b478c9687f1facaca115cb61cb169.tar.gz
build_soong-7709a057706b478c9687f1facaca115cb61cb169.tar.bz2
build_soong-7709a057706b478c9687f1facaca115cb61cb169.zip
Test for dangling rules in make checkbuild
Get a list of leaf nodes in the dependency graph from ninja, and make sure none of them are in the output directory. This ensures that there are no rules that depend on a file in the output directory that doesn't have rule to generate it. The check will catch a common set of build failures where a rule to generate a file is deleted (either by deleting a module in an Android.mk file, or by modifying the build system incorrectly). These failures are often not caught by a local incremental build because the previously built files are still present in the output directory. Bug: 36843214 Bug: 68062417 Test: manual Change-Id: I4933187e8b72f2ef0c32d18ffea756e2c6fa417c
Diffstat (limited to 'cmd')
-rw-r--r--cmd/soong_ui/main.go6
1 files changed, 5 insertions, 1 deletions
diff --git a/cmd/soong_ui/main.go b/cmd/soong_ui/main.go
index 0619b5ca..2ca7ebfa 100644
--- a/cmd/soong_ui/main.go
+++ b/cmd/soong_ui/main.go
@@ -114,7 +114,11 @@ func main() {
} else if os.Args[1] == "--dumpvars-mode" {
dumpVars(buildCtx, config, os.Args[2:])
} else {
- build.Build(buildCtx, config, build.BuildAll)
+ toBuild := build.BuildAll
+ if config.Checkbuild() {
+ toBuild |= build.RunBuildTests
+ }
+ build.Build(buildCtx, config, toBuild)
}
}