Allow not buffering the output of soong_build .

This behavior is enabled by setting the environment variable
SOONG_UNBUFFERED_OUTPUT=1 .

This is not the default behavior because only one process can be running
in the console pool and this would thus result in a loss of parallelism
if multiple soong_build invocations are needed.

Changing the value of this environment variable does not result in a
rebuild, since it does not affect the build outputs.

Test: Presubmits.
Change-Id: I49d15eb145966bd805f0a47b46866285203b122a
This commit is contained in:
Lukacs T. Berki
2022-01-04 14:40:13 +01:00
parent 69e8731101
commit 2fad341beb

View File

@@ -187,6 +187,11 @@ func primaryBuilderInvocation(
Outputs: []string{output},
Args: allArgs,
Description: description,
// NB: Changing the value of this environment variable will not result in a
// rebuild. The bootstrap Ninja file will change, but apparently Ninja does
// not consider changing the pool specified in a statement a change that's
// worth rebuilding for.
Console: os.Getenv("SOONG_UNBUFFERED_OUTPUT") == "1",
}
}