Commit 40e9f7a3 authored by Mitchell Hentges's avatar Mitchell Hentges
Browse files

Bug 1759585: Avoid hang in `./mach configure` r=firefox-build-system-reviewers,nalexander

Depending on the subprocesses created (such as if
`--with-ccache=sccache` is set), `./mach configure` may hang.

More details about why this is is documented in bug 1753797.

The workaround is to lean on the standard library to stream-and-format
output, rather than our existing `ProcessHandler` code.

Though this still streams both `stdout` and `stderr` in real-time, I saw
some ordering differences between the two streams locally. I don't yet
have a reason to believe that these differences are harmful or otherwise
incorrect.

Differential Revision: https://phabricator.services.mozilla.com/D141028
parent f885408c
Loading
Loading
Loading
Loading
+15 −5
Original line number Diff line number Diff line
@@ -1674,11 +1674,21 @@ class BuildDriver(MozbuildObject):
        if buildstatus_messages:
            line_handler("BUILDSTATUS TIERS configure")
            line_handler("BUILDSTATUS TIER_START configure")
        status = self._run_command_in_objdir(
            args=command,
            line_handler=line_handler,
            append_env=append_env,
        )

        env = os.environ.copy()
        env.update(append_env)

        with subprocess.Popen(
            command,
            cwd=self.topobjdir,
            env=env,
            stdout=subprocess.PIPE,
            stderr=subprocess.STDOUT,
            universal_newlines=True,
        ) as process:
            for line in process.stdout:
                line_handler(line.rstrip())
            status = process.wait()
        if buildstatus_messages:
            line_handler("BUILDSTATUS TIER_FINISH configure")
        if status: