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
This commit is contained in:
Spandan Das
2024-06-24 17:38:27 +00:00
parent d6352efd1a
commit 8d8253f525
3 changed files with 26 additions and 3 deletions

View File

@@ -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.