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
diff --git a/ui/build/dumpvars.go b/ui/build/dumpvars.go
index a0e1eca..eb43ed6 100644
--- a/ui/build/dumpvars.go
+++ b/ui/build/dumpvars.go
@@ -156,6 +156,9 @@
 
 		// 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 @@
 	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")
 }