diff mbox series

[U-Boot] buildman: Avoid hanging when the config changes

Message ID 20180918055542.245909-1-sjg@chromium.org
State Accepted
Commit e62a24ce27ab86efc1b37d14112c29d3f2010238
Delegated to: Simon Glass
Headers show
Series [U-Boot] buildman: Avoid hanging when the config changes | expand

Commit Message

Simon Glass Sept. 18, 2018, 5:55 a.m. UTC
Something has changed in the last several month such that when buildman
builds U-Boot incrementally and a new CONFIG option has been added to the
Kconfig, the build hanges waiting for input:

    Test new config (NEW_CONFIG) [N/y/?] (NEW)

Since binamn does not connect the build's stdin to anything this waits on
stdin to the build thread, which never comes. Eventually I suspect all the
threads end up in this state and the build does not progress.

Fix this by passing /dev/null as input to the build. That way, if there is
a new CONFIG, the build will stop (and fail):

    Test new config (NEW_CONFIG) [N/y/?] (NEW)

    Error in reading or end of file.

Signed-off-by: Simon Glass <sjg@chromium.org>
---

 tools/buildman/builder.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Glass Oct. 2, 2018, 11:21 a.m. UTC | #1
On 17 September 2018 at 22:55, Simon Glass <sjg@chromium.org> wrote:
> Something has changed in the last several month such that when buildman
> builds U-Boot incrementally and a new CONFIG option has been added to the
> Kconfig, the build hanges waiting for input:
>
>     Test new config (NEW_CONFIG) [N/y/?] (NEW)
>
> Since binamn does not connect the build's stdin to anything this waits on
> stdin to the build thread, which never comes. Eventually I suspect all the
> threads end up in this state and the build does not progress.
>
> Fix this by passing /dev/null as input to the build. That way, if there is
> a new CONFIG, the build will stop (and fail):
>
>     Test new config (NEW_CONFIG) [N/y/?] (NEW)
>
>     Error in reading or end of file.
>
> Signed-off-by: Simon Glass <sjg@chromium.org>
> ---
>
>  tools/buildman/builder.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>

Applied to u-boot-dm, and now in mainline.
diff mbox series

Patch

diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index a5a2ffdfdf2..05f82995416 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -408,7 +408,7 @@  class Builder:
         """
         cmd = [self.gnu_make] + list(args)
         result = command.RunPipe([cmd], capture=True, capture_stderr=True,
-                cwd=cwd, raise_on_error=False, **kwargs)
+                cwd=cwd, raise_on_error=False, infile='/dev/null', **kwargs)
         if self.verbose_build:
             result.stdout = '%s\n' % (' '.join(cmd)) + result.stdout
             result.combined = '%s\n' % (' '.join(cmd)) + result.combined