Enforce that output files are created in primary ninja execution

Missing output files in ninja execution will be treated as errors.
Products can bypass this using the newly introduced
BUILD_BROKEN_MISSING_OUTPUTS flag.

Test: m nothing # verified missingoutfile appears in out/soong.log
Test: checkbuild passes on presubmits

Change-Id: I4eebcd08aa57fc6ccf1688c32e0d1fe06d66ab9a
diff --git a/ui/build/config.go b/ui/build/config.go
index feded1c..3b2f2c5 100644
--- a/ui/build/config.go
+++ b/ui/build/config.go
@@ -98,9 +98,10 @@
 	// Autodetected
 	totalRAM uint64
 
-	brokenDupRules     bool
-	brokenUsesNetwork  bool
-	brokenNinjaEnvVars []string
+	brokenDupRules       bool
+	brokenUsesNetwork    bool
+	brokenNinjaEnvVars   []string
+	brokenMissingOutputs bool
 
 	pathReplaced bool
 
@@ -1591,6 +1592,14 @@
 	return c.brokenNinjaEnvVars
 }
 
+func (c *configImpl) SetBuildBrokenMissingOutputs(val bool) {
+	c.brokenMissingOutputs = val
+}
+
+func (c *configImpl) BuildBrokenMissingOutputs() bool {
+	return c.brokenMissingOutputs
+}
+
 func (c *configImpl) SetTargetDeviceDir(dir string) {
 	c.targetDeviceDir = dir
 }