[Buildroot] [RFC v2 1/1] utils/show-progress: add tool to show build progress at runtime

Vadim Kochan vadim4j at gmail.com
Tue Aug 6 08:54:55 UTC 2019


Yann,

On Sun, Aug 4, 2019 at 6:52 PM Yann E. MORIN <yann.morin.1998 at free.fr> wrote:
>
> Vadim, All,
>
> On 2019-07-18 10:32 +0300, Vadim Kochan spake thusly:
> > This might be useful to watch the amount of built and selected
> > packages and some progress about it. So added python script which
> > prints progress and build stats. The sample of output is:
> >
> > Press Ctrl-C to exit ...
> >
> > Building: output/qemu_x86_64
> >  ##################################------------------------------ [ 42.42% 14/33]
>
> With this defconfig:
>     BR2_arm=y
>     BR2_cortex_a7=y
>     BR2_TOOLCHAIN_EXTERNAL=y
>     # BR2_TARGET_ROOTFS_TAR is not set
>
> and building out-of-tree, the script never reaches 100%:
>
>     $ ../buildroot/utils/show-progress
>     Press Ctrl-C to exit ...
>
>     Building: .
>      #########################################################################------- [ 91.67% 11/12]
>
> Even though the build did finish...
>
> > Signed-off-by: Vadim Kochan <vadim4j at gmail.com>
> [--SNIP--]
> > diff --git a/utils/show-progress b/utils/show-progress
> > new file mode 100755
> > index 0000000000..ee1e1da289
> > --- /dev/null
> > +++ b/utils/show-progress
> > @@ -0,0 +1,91 @@
> > +#!/usr/bin/env python
>
> This is actually a python3 script, and is not a valid pyhon2 one.
>
> > +# Copyright (C) 2019 Vadim Kochan <vadim4j at gmail.com>
>
> There is no reason nowadays to add copyright notices. The copyright is
> defacto by the Bern convention. Furthermore, in an opensource project,
> this notice is wrong as ssoon as other contributors do substantial
> modification to the file.
>
> And the git log is a much better way to extract authroship of a file.
>
> [--SNIP--]
> > +def progress(ready, total):
> > +    perc = ready / total
> > +    fill = round(perc * 80)
> > +    print('\r', '#' * fill + '-' * (80 - fill), '[{:>7.2%} {}/{} ]'.format(perc, ready, total), end='')
>
> I've locally changed it to:
>
>     print('\r', '#' * fill + '-' * (80 - fill), '[{:>7.2%} {: >2d}/{}]'.format(perc, ready, total), end='')
>
> > +    print("Press Ctrl-C to exit ...\n")
> > +    print("Building: " + build_dir)
>
> This print '.' as the build directory when doing an out-of-tree build
> (see above). I've locally changed it to:
>
>     print("Building: " + os.path.realpath(build_dir))
>
> Regards,
> Yann E. MORIN.
>

Yes, sorry for wasting your time. It really does not work if there is
package which has no installation
for target but only installed to the staging. I will fix this case after
"install_" properties will be merged to the "show-info" make helper.

I forgot to mark this patch for ignoring.

Regards,
Vadim Kochan



More information about the buildroot mailing list