Merge "Revert^2 "Enforce that output files are created in primary ninja execution"" into main
This commit is contained in:
@@ -99,9 +99,10 @@ type configImpl struct {
|
||||
// Autodetected
|
||||
totalRAM uint64
|
||||
|
||||
brokenDupRules bool
|
||||
brokenUsesNetwork bool
|
||||
brokenNinjaEnvVars []string
|
||||
brokenDupRules bool
|
||||
brokenUsesNetwork bool
|
||||
brokenNinjaEnvVars []string
|
||||
brokenMissingOutputs bool
|
||||
|
||||
pathReplaced bool
|
||||
|
||||
@@ -1608,6 +1609,14 @@ func (c *configImpl) BuildBrokenNinjaUsesEnvVars() []string {
|
||||
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
|
||||
}
|
||||
|
@@ -235,6 +235,11 @@ func runMakeProductConfig(ctx Context, config Config) {
|
||||
"BUILD_BROKEN_SRC_DIR_IS_WRITABLE",
|
||||
"BUILD_BROKEN_SRC_DIR_RW_ALLOWLIST",
|
||||
|
||||
// Whether missing outputs should be treated as warnings
|
||||
// instead of errors.
|
||||
// `true` will relegate missing outputs to warnings.
|
||||
"BUILD_BROKEN_MISSING_OUTPUTS",
|
||||
|
||||
// Not used, but useful to be in the soong.log
|
||||
"TARGET_BUILD_TYPE",
|
||||
"HOST_ARCH",
|
||||
@@ -301,4 +306,5 @@ func runMakeProductConfig(ctx Context, config Config) {
|
||||
config.SetBuildBrokenUsesNetwork(makeVars["BUILD_BROKEN_USES_NETWORK"] == "true")
|
||||
config.SetBuildBrokenNinjaUsesEnvVars(strings.Fields(makeVars["BUILD_BROKEN_NINJA_USES_ENV_VARS"]))
|
||||
config.SetSourceRootDirs(strings.Fields(makeVars["PRODUCT_SOURCE_ROOT_DIRS"]))
|
||||
config.SetBuildBrokenMissingOutputs(makeVars["BUILD_BROKEN_MISSING_OUTPUTS"] == "true")
|
||||
}
|
||||
|
@@ -77,6 +77,14 @@ func runNinjaForBuild(ctx Context, config Config) {
|
||||
"-w", "dupbuild=err",
|
||||
"-w", "missingdepfile=err")
|
||||
|
||||
if !config.BuildBrokenMissingOutputs() {
|
||||
// Missing outputs will be treated as errors.
|
||||
// BUILD_BROKEN_MISSING_OUTPUTS can be used to bypass this check.
|
||||
args = append(args,
|
||||
"-w", "missingoutfile=err",
|
||||
)
|
||||
}
|
||||
|
||||
cmd := Command(ctx, config, "ninja", executable, args...)
|
||||
|
||||
// Set up the nsjail sandbox Ninja runs in.
|
||||
|
Reference in New Issue
Block a user