Pass --writable to kati

These warnings are usually hit in one of the two conditions:

1. Targets that should be marked .PHONY, but are not.
2. Attempts to define output files in the source tree.

See https://android.googlesource.com/platform/build/+/master/Changes.md#phony_targets
for more information.

Test: multiproduct_kati in all downstream branches
Change-Id: Ibe37cce320612825c22987e94d0740e8c0565b6f
This commit is contained in:
Dan Willemsen 2018-08-31 20:25:32 -07:00
parent e944600978
commit 25a56186d9
2 changed files with 8 additions and 3 deletions

View File

@ -369,14 +369,14 @@ func (c *configImpl) Arguments() []string {
func (c *configImpl) OutDir() string {
if outDir, ok := c.environ.Get("OUT_DIR"); ok {
return outDir
return filepath.Clean(outDir)
}
return "out"
}
func (c *configImpl) DistDir() string {
if distDir, ok := c.environ.Get("DIST_DIR"); ok {
return distDir
return filepath.Clean(distDir)
}
return filepath.Join(c.OutDir(), "dist")
}

View File

@ -81,6 +81,8 @@ func runKati(ctx Context, config Config) {
"--warn_real_to_phony",
"--warn_phony_looks_real",
"--kati_stats",
"--writable", config.OutDir() + "/",
"--writable", config.DistDir() + "/",
"-f", "build/make/core/main.mk",
}
@ -94,7 +96,10 @@ func runKati(ctx Context, config Config) {
}
if !config.BuildBrokenPhonyTargets() {
args = append(args, "--werror_real_to_phony", "--werror_phony_looks_real")
args = append(args,
"--werror_real_to_phony",
"--werror_phony_looks_real",
"--werror_writable")
}
if !config.Environment().IsFalse("KATI_EMULATE_FIND") {