Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e66a2c96 authored by Dan Willemsen's avatar Dan Willemsen Committed by android-build-merger
Browse files

Allow boards to turn overriding commands into an error am: 3d60b115

am: faf45ded

Change-Id: I06717df87681cb05a1fd0028ed1e9bb4f5b80557
parents ab4a214c faf45ded
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -48,6 +48,8 @@ type configImpl struct {
	ninjaArgs    []string
	katiSuffix   string
	targetDevice string

	brokenDupRules bool
}

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)
}

func (c *configImpl) SetBuildBrokenDupRules(val bool) {
	c.brokenDupRules = val
}

func (c *configImpl) BuildBrokenDupRules() bool {
	return c.brokenDupRules
}
+5 −0
Original line number Diff line number Diff line
@@ -156,6 +156,9 @@ func runMakeProductConfig(ctx Context, config Config) {

		// To find target/product/<DEVICE>
		"TARGET_DEVICE",

		// Whether --werror_overriding_commands will work
		"BUILD_BROKEN_DUP_RULES",
	}, exportEnvVars...), BannerVars...)

	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.SetNinjaArgs(strings.Fields(make_vars["NINJA_GOALS"]))
	config.SetTargetDevice(make_vars["TARGET_DEVICE"])

	config.SetBuildBrokenDupRules(make_vars["BUILD_BROKEN_DUP_RULES"] != "false")
}
+5 −0
Original line number Diff line number Diff line
@@ -81,6 +81,10 @@ func runKati(ctx Context, config Config) {
		"-f", "build/make/core/main.mk",
	}

	if !config.BuildBrokenDupRules() {
		args = append(args, "--werror_overriding_commands")
	}

	if !config.Environment().IsFalse("KATI_EMULATE_FIND") {
		args = append(args, "--use_find_emulator")
	}
@@ -190,6 +194,7 @@ func runKatiCleanSpec(ctx Context, config Config) {
		"--color_warnings",
		"--gen_all_targets",
		"--werror_find_emulator",
		"--werror_overriding_commands",
		"--use_find_emulator",
		"-f", "build/make/core/cleanbuild.mk",
		"BUILDING_WITH_NINJA=true",