Allow boards to turn overriding commands into an error
Many board still have this problem, but if we can switch some over, we'll prevent global problems and have the ability to clean boards up one-by-one. Bug: 77611511 Test: lunch aosp_arm-eng; m nothing Test: lunch aosp_marlin-eng; m nothing Test: build_test on all downstream branches Change-Id: I78bee44adde2059d01188658b9050927748d2028
This commit is contained in:
@@ -48,6 +48,8 @@ type configImpl struct {
|
|||||||
ninjaArgs []string
|
ninjaArgs []string
|
||||||
katiSuffix string
|
katiSuffix string
|
||||||
targetDevice string
|
targetDevice string
|
||||||
|
|
||||||
|
brokenDupRules bool
|
||||||
}
|
}
|
||||||
|
|
||||||
const srcDirFileCheck = "build/soong/root.bp"
|
const srcDirFileCheck = "build/soong/root.bp"
|
||||||
@@ -556,3 +558,11 @@ func (c *configImpl) PrebuiltBuildTool(name string) string {
|
|||||||
}
|
}
|
||||||
return filepath.Join("prebuilts/build-tools", c.HostPrebuiltTag(), "bin", name)
|
return filepath.Join("prebuilts/build-tools", c.HostPrebuiltTag(), "bin", name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *configImpl) SetBuildBrokenDupRules(val bool) {
|
||||||
|
c.brokenDupRules = val
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *configImpl) BuildBrokenDupRules() bool {
|
||||||
|
return c.brokenDupRules
|
||||||
|
}
|
||||||
|
@@ -156,6 +156,9 @@ func runMakeProductConfig(ctx Context, config Config) {
|
|||||||
|
|
||||||
// To find target/product/<DEVICE>
|
// To find target/product/<DEVICE>
|
||||||
"TARGET_DEVICE",
|
"TARGET_DEVICE",
|
||||||
|
|
||||||
|
// Whether --werror_overriding_commands will work
|
||||||
|
"BUILD_BROKEN_DUP_RULES",
|
||||||
}, exportEnvVars...), BannerVars...)
|
}, exportEnvVars...), BannerVars...)
|
||||||
|
|
||||||
make_vars, err := dumpMakeVars(ctx, config, config.Arguments(), allVars, true)
|
make_vars, err := dumpMakeVars(ctx, config, config.Arguments(), allVars, true)
|
||||||
@@ -179,4 +182,6 @@ func runMakeProductConfig(ctx Context, config Config) {
|
|||||||
config.SetKatiArgs(strings.Fields(make_vars["KATI_GOALS"]))
|
config.SetKatiArgs(strings.Fields(make_vars["KATI_GOALS"]))
|
||||||
config.SetNinjaArgs(strings.Fields(make_vars["NINJA_GOALS"]))
|
config.SetNinjaArgs(strings.Fields(make_vars["NINJA_GOALS"]))
|
||||||
config.SetTargetDevice(make_vars["TARGET_DEVICE"])
|
config.SetTargetDevice(make_vars["TARGET_DEVICE"])
|
||||||
|
|
||||||
|
config.SetBuildBrokenDupRules(make_vars["BUILD_BROKEN_DUP_RULES"] != "false")
|
||||||
}
|
}
|
||||||
|
@@ -81,6 +81,10 @@ func runKati(ctx Context, config Config) {
|
|||||||
"-f", "build/make/core/main.mk",
|
"-f", "build/make/core/main.mk",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if !config.BuildBrokenDupRules() {
|
||||||
|
args = append(args, "--werror_overriding_commands")
|
||||||
|
}
|
||||||
|
|
||||||
if !config.Environment().IsFalse("KATI_EMULATE_FIND") {
|
if !config.Environment().IsFalse("KATI_EMULATE_FIND") {
|
||||||
args = append(args, "--use_find_emulator")
|
args = append(args, "--use_find_emulator")
|
||||||
}
|
}
|
||||||
@@ -190,6 +194,7 @@ func runKatiCleanSpec(ctx Context, config Config) {
|
|||||||
"--color_warnings",
|
"--color_warnings",
|
||||||
"--gen_all_targets",
|
"--gen_all_targets",
|
||||||
"--werror_find_emulator",
|
"--werror_find_emulator",
|
||||||
|
"--werror_overriding_commands",
|
||||||
"--use_find_emulator",
|
"--use_find_emulator",
|
||||||
"-f", "build/make/core/cleanbuild.mk",
|
"-f", "build/make/core/cleanbuild.mk",
|
||||||
"BUILDING_WITH_NINJA=true",
|
"BUILDING_WITH_NINJA=true",
|
||||||
|
Reference in New Issue
Block a user