Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Jérôme Pouiller" <jezz@sysmic.org>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH v4 next 0/5]  Improve silent builds
Date: Tue, 25 Nov 2014 11:42:29 +0100	[thread overview]
Message-ID: <6658443.V0IJTQaiAA@aquila> (raw)
In-Reply-To: <1416837422-1977-1-git-send-email-fabio.porcedda@gmail.com>

Hello Fabio,

If you are interested to keep quiet builds, you may be interested by
a tool called "reredirect"[1]. 

reredirect allows to redirect outputs of a running program. I use
it to redirect output of make process (and its children) to log files
(eg. build/busybox-1.22.1/busybox_extract.log, 
build/busybox-1.22.1/busybox_build.log, etc...).

To do this, I add this snippet in my local.mk :

define buildlog-silent
        $(call MESSAGE,$(2))
        if [ $(1) == start ]; then                                             \
                reredirect -m $(@D)/$(3)_$(2).log $$PPID > $(BUILD_DIR)/restore_$$PPID.cmd; \
        else                                                                   \
                sh $(BUILD_DIR)/restore_$$PPID.cmd;                            \
                rm $(BUILD_DIR)/restore_$$PPID.cmd;                            \
        fi
endef
GLOBAL_INSTRUMENTATION_HOOKS += buildlog-silent


With that, my build only display steps names and all build output is
redirected to log files. I have also a more complex snippet to redirect
output to log file and to console. In this case, I use a fifo and "tee"
in add of "reredirect".


Note 1: You may have to disable ptrace_scope in order to make reredirect work:
   echo 0 | sudo tee /proc/sys/kernel/yama/ptrace_scope    


[1] https://github.com/jerome-pouiller/reredirect


On Monday 24 November 2014 14:56:57 Fabio Porcedda wrote:
> This patch set improves silent builds.
> 
> Silent builds are nice when top-level parallel make is being used to
> reduce the output clutter.
> 
> The change logs are in each patch.
> 
> Best regards
> Fabio Porcedda (5):
>   support/download: silence git if it is a silent build
>   support/download: silence svn if it is a silent build
>   support/download: pass the quiet flag to the hg download helper
>   support/download: pass the quiet flag to the wget download helper
>   support/download: pass the quiet flag to the scp download helper
> 
>  package/pkg-download.mk | 21 +++++++++++++--------
>  support/download/git    | 14 ++++++++++----
>  support/download/hg     |  5 +++--
>  support/download/scp    |  3 ++-
>  support/download/svn    |  4 +++-
>  support/download/wget   |  3 ++-
>  6 files changed, 33 insertions(+), 17 deletions(-)

-- 
J?r?me Pouiller, Sysmic
Embedded Linux specialist
http://www.sysmic.fr

  parent reply	other threads:[~2014-11-25 10:42 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-24 13:56 [Buildroot] [PATCH v4 next 0/5] Improve silent builds Fabio Porcedda
2014-11-24 13:56 ` [Buildroot] [PATCH v4 next 1/5] support/download: silence git if it is a silent build Fabio Porcedda
2014-11-26 21:35   ` Yann E. MORIN
2014-11-26 21:38     ` Thomas Petazzoni
2014-11-26 21:44       ` Yann E. MORIN
2014-11-26 21:55         ` Thomas Petazzoni
2014-11-24 13:56 ` [Buildroot] [PATCH v4 next 2/5] support/download: silence svn " Fabio Porcedda
2014-11-24 13:57 ` [Buildroot] [PATCH v4 next 3/5] support/download: pass the quiet flag to the hg download helper Fabio Porcedda
2014-11-24 13:57 ` [Buildroot] [PATCH v4 next 4/5] support/download: pass the quiet flag to the wget " Fabio Porcedda
2014-11-24 13:57 ` [Buildroot] [PATCH v4 next 5/5] support/download: pass the quiet flag to the scp " Fabio Porcedda
2014-11-25 10:42 ` Jérôme Pouiller [this message]
2014-11-25 16:09   ` [Buildroot] [PATCH v4 next 0/5] Improve silent builds Jérôme Pouiller
2014-12-01 17:51   ` Fabio Porcedda
2014-12-07 21:51 ` Yann E. MORIN
2014-12-07 21:54   ` Fabio Porcedda
2014-12-07 22:03     ` Yann E. MORIN
2014-12-23  9:00       ` Fabio Porcedda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6658443.V0IJTQaiAA@aquila \
    --to=jezz@sysmic.org \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox