Improve silent builds (branch yem/fabio/silent)
v8 cover Improve silent builds (branch yem/fabio/silent)
Hello All!
This patch set improves silent builds.
Silent builds are also nice when top-level parallel make is being used to reduce the output clutter.
Changes v7 -> v8:
- simply by just consigning stdout to oblivion (Yann)
Regards,
Yann E. MORIN.
The following changes since commit b7e7b417fa1210a7f9c4e76ee747238981dcd012:
wpa_supplicant: fix indentation and change file permissions (2015-01-01 11:31:14 +0100)
are available in the git repository at:
git://git.busybox.net/~ymorin/git/buildroot yem/fabio/silent
for you to fetch changes up to 70490271dbf1774e87cc5dab1a5e907105afeb62:
pkg-download: silence downloads if make is silent (2015-01-01 17:47:49 +0100)
----------------------------------------------------------------
Fabio Porcedda (2):
Makefile: improve detection of make "-s" flag
pkg-download: silence downloads if make is silent
Makefile | 2 +- package/pkg-download.mk | 8 ++++++++ support/download/dl-wrapper | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-)
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v8 1/2 Makefile: improve detection of make "-s" flag
From: Fabio Porcedda <[email protected]>
Because it's just checked the presence of the "s" character even a
make --warn-undefined-variables
is detected as a silent build so fix this by filtering out long options.
--- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Makefile +1 -1
@@ -304,7 +304,7 @@ GNU_HOST_NAME := $(shell support/gnuconfig/config.guess) TARGETS := # silent mode requested? -QUIET := $(if $(findstring s,$(MAKEFLAGS)),-q) +QUIET := $(if $(findstring s,$(filter-out --%,$(MAKEFLAGS))),-q) # Strip off the annoying quoting ARCH := $(call qstrip,$(BR2_ARCH))
Signature · 1 line
1.9.1
PATCH v8 2/2 pkg-download: silence downloads if make is silent
In reply to Yann E. MORINFrom: Fabio Porcedda <[email protected]>
If it is a silent build (make -s -> QUIET=-q) silence all downloads, as well as the check-hash. Only stdout is redirected, stderr is still visible, for errors and warning.
[yann.morin.1998 at free.fr: greatly simplify by simply consigning stdout
to oblivion]
--- package/pkg-download.mk | 8 ++++++++ support/download/dl-wrapper | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-)
package/pkg-download.mk +8 -0
@@ -88,6 +88,7 @@ define DOWNLOAD_GIT $(EXTRA_ENV) $(DL_WRAPPER) -b git \ -o $(DL_DIR)/$($(PKG)_SOURCE) \ -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \ + $(QUIET) \ -- \ $($(PKG)_SITE) \ $($(PKG)_DL_VERSION) \
@@ -109,6 +110,7 @@ define DOWNLOAD_BZR $(EXTRA_ENV) $(DL_WRAPPER) -b bzr \ -o $(DL_DIR)/$($(PKG)_SOURCE) \ -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \ + $(QUIET) \ -- \ $($(PKG)_SITE) \ $($(PKG)_DL_VERSION) \
@@ -127,6 +129,7 @@ define DOWNLOAD_CVS $(EXTRA_ENV) $(DL_WRAPPER) -b cvs \ -o $(DL_DIR)/$($(PKG)_SOURCE) \ -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \ + $(QUIET) \ -- \ $(call stripurischeme,$(call qstrip,$($(PKG)_SITE))) \ $($(PKG)_DL_VERSION) \
@@ -147,6 +150,7 @@ define DOWNLOAD_SVN $(EXTRA_ENV) $(DL_WRAPPER) -b svn \ -o $(DL_DIR)/$($(PKG)_SOURCE) \ -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \ + $(QUIET) \ -- \ $($(PKG)_SITE) \ $($(PKG)_DL_VERSION) \
@@ -168,6 +172,7 @@ define DOWNLOAD_SCP $(EXTRA_ENV) $(DL_WRAPPER) -b scp \ -o $(DL_DIR)/$(2) \ -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \ + $(QUIET) \ -- \ '$(call stripurischeme,$(call qstrip,$(1)))' endef
@@ -185,6 +190,7 @@ define DOWNLOAD_HG $(EXTRA_ENV) $(DL_WRAPPER) -b hg \ -o $(DL_DIR)/$($(PKG)_SOURCE) \ -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \ + $(QUIET) \ -- \ $($(PKG)_SITE) \ $($(PKG)_DL_VERSION) \
@@ -206,6 +212,7 @@ define DOWNLOAD_WGET $(EXTRA_ENV) $(DL_WRAPPER) -b wget \ -o $(DL_DIR)/$(2) \ -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \ + $(QUIET) \ -- \ '$(call qstrip,$(1))' endef
@@ -222,6 +229,7 @@ define DOWNLOAD_LOCALFILES $(EXTRA_ENV) $(DL_WRAPPER) -b cp \ -o $(DL_DIR)/$(2) \ -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \ + $(QUIET) \ -- \ $(call stripurischeme,$(call qstrip,$(1))) endef
support/download/dl-wrapper +2 -1
@@ -24,12 +24,13 @@ main() { local backend output hfile # Parse our options; anything after '--' is for the backend - while getopts :hb:o:H: OPT; do + while getopts :hb:o:H:q OPT; do case "${OPT}" in h) help; exit 0;; b) backend="${OPTARG}";; o) output="${OPTARG}";; H) hfile="${OPTARG}";; + q) exec >/dev/null;; :) error "option '%s' expects a mandatory argument\n" "${OPTARG}";; \?) error "unknown option '%s'\n" "${OPTARG}";; esac
Signature · 1 line
1.9.1
PATCH v8 2/2 pkg-download: silence downloads if make is silent
Quoted 5 lines · Yann E. MORIN
From: Fabio Porcedda <[email protected]>
If it is a silent build (make -s -> QUIET=-q) silence all downloads, as well as the check-hash. Only stdout is redirected, stderr is still visible, for errors and warning.
Hi Yann,
nice idea, i tried this patch but even if it works for check-hash and svn it does not works for the git backend (e.g. libubox) and the wget bakend (try it without the QUIET flags in the WGET variable).
I don't understand the reason for this behavior.
Do you have an idea for this strange behavior?
Quoted 99 lines
Signed-off-by Fabio Porcedda <[email protected]>[yann.morin.1998 at free.fr: greatly simplify by simply consigning stdout
to oblivion]Signed-off-by Yann E. MORIN <[email protected]>--- package/pkg-download.mk | 8 ++++++++ support/download/dl-wrapper | 3 ++- 2 files changed, 10 insertions(+), 1 deletion(-)package/pkg-download.mk +8
-0@@ -88,6 +88,7 @@ define DOWNLOAD_GIT $(EXTRA_ENV) $(DL_WRAPPER) -b git \ -o $(DL_DIR)/$($(PKG)_SOURCE) \ -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \ + $(QUIET) \ -- \ $($(PKG)_SITE) \ $($(PKG)_DL_VERSION) \@@ -109,6 +110,7 @@ define DOWNLOAD_BZR $(EXTRA_ENV) $(DL_WRAPPER) -b bzr \ -o $(DL_DIR)/$($(PKG)_SOURCE) \ -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \ + $(QUIET) \ -- \ $($(PKG)_SITE) \ $($(PKG)_DL_VERSION) \@@ -127,6 +129,7 @@ define DOWNLOAD_CVS $(EXTRA_ENV) $(DL_WRAPPER) -b cvs \ -o $(DL_DIR)/$($(PKG)_SOURCE) \ -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \ + $(QUIET) \ -- \ $(call stripurischeme,$(call qstrip,$($(PKG)_SITE))) \ $($(PKG)_DL_VERSION) \@@ -147,6 +150,7 @@ define DOWNLOAD_SVN $(EXTRA_ENV) $(DL_WRAPPER) -b svn \ -o $(DL_DIR)/$($(PKG)_SOURCE) \ -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \ + $(QUIET) \ -- \ $($(PKG)_SITE) \ $($(PKG)_DL_VERSION) \@@ -168,6 +172,7 @@ define DOWNLOAD_SCP $(EXTRA_ENV) $(DL_WRAPPER) -b scp \ -o $(DL_DIR)/$(2) \ -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \ + $(QUIET) \ -- \ '$(call stripurischeme,$(call qstrip,$(1)))' endef@@ -185,6 +190,7 @@ define DOWNLOAD_HG $(EXTRA_ENV) $(DL_WRAPPER) -b hg \ -o $(DL_DIR)/$($(PKG)_SOURCE) \ -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \ + $(QUIET) \ -- \ $($(PKG)_SITE) \ $($(PKG)_DL_VERSION) \@@ -206,6 +212,7 @@ define DOWNLOAD_WGET $(EXTRA_ENV) $(DL_WRAPPER) -b wget \ -o $(DL_DIR)/$(2) \ -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \ + $(QUIET) \ -- \ '$(call qstrip,$(1))' endef@@ -222,6 +229,7 @@ define DOWNLOAD_LOCALFILES $(EXTRA_ENV) $(DL_WRAPPER) -b cp \ -o $(DL_DIR)/$(2) \ -H $(PKGDIR)/$($(PKG)_RAWNAME).hash \ + $(QUIET) \ -- \ $(call stripurischeme,$(call qstrip,$(1))) endefsupport/download/dl-wrapper +2
-2@@ -24,12 +24,13 @@ main() { local backend output hfile # Parse our options; anything after '--' is for the backend - while getopts :hb:o:H: OPT; do + while getopts :hb:o:H:q OPT; do case "${OPT}" in h) help; exit 0;; b) backend="${OPTARG}";; o) output="${OPTARG}";; H) hfile="${OPTARG}";; + q) exec >/dev/null;; :) error "option '%s' expects a mandatory argument\n" "${OPTARG}";; \?) error "unknown option '%s'\n" "${OPTARG}";; esac --1.9.1
Signature · 1 line
Fabio Porcedda
PATCH v8 2/2 pkg-download: silence downloads if make is silent
Fabio, All,
On 2015-01-01 18:54 +0100, Fabio Porcedda spake thusly:
Quoted 7 lines · Yann E. MORIN
Quoted 5 lines
From: Fabio Porcedda <[email protected]>
If it is a silent build (make -s -> QUIET=-q) silence all downloads, as well as the check-hash. Only stdout is redirected, stderr is still visible, for errors and warning.
Quoted 7 lines
Hi Yann,
nice idea, i tried this patch but even if it works for check-hash and svn it does not works for the git backend (e.g. libubox) and the wget bakend (try it without the QUIET flags in the WGET variable).I don't understand the reason for this behavior.
Do you have an idea for this strange behavior?
Damn, no. I'll have look.
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v8 2/2 pkg-download: silence downloads if make is silent
Quoted 15 lines · Yann E. MORIN
Fabio, All,
On 2015-01-01 18:54 +0100, Fabio Porcedda spake thusly:
Quoted 12 lines · Yann E. MORIN
Quoted 5 lines
From: Fabio Porcedda <[email protected]>
If it is a silent build (make -s -> QUIET=-q) silence all downloads, as well as the check-hash. Only stdout is redirected, stderr is still visible, for errors and warning.
Hi Yann,
nice idea, i tried this patch but even if it works for check-hash and svn it does not works for the git backend (e.g. libubox) and the wget bakend (try it without the QUIET flags in the WGET variable).
Quoted 4 lines
Quoted 2 lines
I don't understand the reason for this behavior.
Do you have an idea for this strange behavior?Damn, no. I'll have look.
Thank, i think that it must works even when the QUIET variables is not added to the environment variables:
diff --git a/package/pkg-download.mk b/package/pkg-download.mk
index 9c782fe..5e74519 100644
package/pkg-download.mk +4 -4
@@ -8,14 +8,14 @@ ################################################################################ # Download method commands -export WGET := $(call qstrip,$(BR2_WGET)) $(QUIET) +export WGET := $(call qstrip,$(BR2_WGET)) export SVN := $(call qstrip,$(BR2_SVN)) export CVS := $(call qstrip,$(BR2_CVS)) export BZR := $(call qstrip,$(BR2_BZR)) export GIT := $(call qstrip,$(BR2_GIT)) -export HG := $(call qstrip,$(BR2_HG)) $(QUIET) -export SCP := $(call qstrip,$(BR2_SCP)) $(QUIET) -SSH := $(call qstrip,$(BR2_SSH)) $(QUIET) +export HG := $(call qstrip,$(BR2_HG)) +export SCP := $(call qstrip,$(BR2_SCP)) +SSH := $(call qstrip,$(BR2_SSH)) export LOCALFILES := $(call qstrip,$(BR2_LOCALFILES)) DL_WRAPPER = support/download/dl-wrapper
BR
Signature · 1 line
Fabio Porcedda
PATCH v8 2/2 pkg-download: silence downloads if make is silent
Fabio, All,
On 2015-01-01 19:03 +0100, Fabio Porcedda spake thusly:
Quoted 16 lines · Yann E. MORIN
Quoted 15 lines
Fabio, All,
On 2015-01-01 18:54 +0100, Fabio Porcedda spake thusly:
Quoted 12 lines · Yann E. MORIN
Quoted 5 lines
From: Fabio Porcedda <[email protected]>
If it is a silent build (make -s -> QUIET=-q) silence all downloads, as well as the check-hash. Only stdout is redirected, stderr is still visible, for errors and warning.
Hi Yann,
nice idea, i tried this patch but even if it works for check-hash and svn it does not works for the git backend (e.g. libubox) and the wget bakend (try it without the QUIET flags in the WGET variable).
Quoted 7 lines
Quoted 4 lines
Quoted 2 lines
I don't understand the reason for this behavior.
Do you have an idea for this strange behavior?Damn, no. I'll have look.
Thank, i think that it must works even when the QUIET variables is not added to the environment variables:
Yes, that's right.
Regards,
Yann E. MORIN.
Quoted 27 lines
diff --git
a/package/pkg-download.mkb/package/pkg-download.mk
index 9c782fe..5e74519 100644package/pkg-download.mk +4
-4@@ -8,14 +8,14 @@ ################################################################################ # Download method commands -export WGET := $(call qstrip,$(BR2_WGET)) $(QUIET) +export WGET := $(call qstrip,$(BR2_WGET)) export SVN := $(call qstrip,$(BR2_SVN)) export CVS := $(call qstrip,$(BR2_CVS)) export BZR := $(call qstrip,$(BR2_BZR)) export GIT := $(call qstrip,$(BR2_GIT)) -export HG := $(call qstrip,$(BR2_HG)) $(QUIET) -export SCP := $(call qstrip,$(BR2_SCP)) $(QUIET) -SSH := $(call qstrip,$(BR2_SSH)) $(QUIET) +export HG := $(call qstrip,$(BR2_HG)) +export SCP := $(call qstrip,$(BR2_SCP)) +SSH := $(call qstrip,$(BR2_SSH)) export LOCALFILES := $(call qstrip,$(BR2_LOCALFILES)) DL_WRAPPER = support/download/dl-wrapperBR
Signature · 1 line
Fabio Porcedda
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v8 2/2 pkg-download: silence downloads if make is silent
In reply to Fabio PorceddaFabio, All,
On 2015-01-01 18:54 +0100, Fabio Porcedda spake thusly:
Quoted 7 lines · Yann E. MORIN
Quoted 5 lines
From: Fabio Porcedda <[email protected]>
If it is a silent build (make -s -> QUIET=-q) silence all downloads, as well as the check-hash. Only stdout is redirected, stderr is still visible, for errors and warning.
Quoted 7 lines
Hi Yann,
nice idea, i tried this patch but even if it works for check-hash and svn it does not works for the git backend (e.g. libubox) and the wget bakend (try it without the QUIET flags in the WGET variable).I don't understand the reason for this behavior.
Do you have an idea for this strange behavior?
Ok, that's because git always sends its report status to stderr:
--quiet, -q
Operate quietly. Progress is not reported to the standard
error stream. [...]So, we need to pass -q to git. Sigh, fscking borked behaviour... stderr is for failures, not normal reporting... :-(
OK, so we need to pass -q to some backends.
However, what I did not like in your original patch was the fact that some backends were singled out in the wrapper script. We do not want that, we want the wrapper to be backend-agnostic (that's the whole point of having a wrapper and backends).
I'll rework that, then...
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'
PATCH v8 2/2 pkg-download: silence downloads if make is silent
Quoted 18 lines · Yann E. MORIN
Fabio, All,
On 2015-01-01 18:54 +0100, Fabio Porcedda spake thusly:
Quoted 7 lines · Yann E. MORIN
Quoted 5 lines
From: Fabio Porcedda <[email protected]>
If it is a silent build (make -s -> QUIET=-q) silence all downloads, as well as the check-hash. Only stdout is redirected, stderr is still visible, for errors and warning.
Quoted 7 lines
Hi Yann,
nice idea, i tried this patch but even if it works for check-hash and svn it does not works for the git backend (e.g. libubox) and the wget bakend (try it without the QUIET flags in the WGET variable).I don't understand the reason for this behavior.
Do you have an idea for this strange behavior?
Quoted 8 lines
Ok, that's because git always sends its report status to stderr:
--quiet, -q Operate quietly. Progress is not reported to the standard error stream. [...]So, we need to pass -q to git. Sigh, fscking borked behaviour... stderr is for failures, not normal reporting... :-(
So that's the reason...
Quoted 7 lines
OK, so we need to pass -q to some backends.
However, what I did not like in your original patch was the fact that some backends were singled out in the wrapper script. We do not want that, we want the wrapper to be backend-agnostic (that's the whole point of having a wrapper and backends).
Well that it's needed only until all backends support the "-q" flag, do you prefer a big patch to convert all backends so that check is not needed?
Quoted 1 line
I'll rework that, then...
BR
Signature · 1 line
Fabio Porcedda
PATCH v8 2/2 pkg-download: silence downloads if make is silent
Quoted 32 lines · Fabio Porcedda
Quoted 18 lines · Yann E. MORIN
Fabio, All,
On 2015-01-01 18:54 +0100, Fabio Porcedda spake thusly:
Quoted 7 lines · Yann E. MORIN
Quoted 5 lines
From: Fabio Porcedda <[email protected]>
If it is a silent build (make -s -> QUIET=-q) silence all downloads, as well as the check-hash. Only stdout is redirected, stderr is still visible, for errors and warning.
Quoted 7 lines
Hi Yann,
nice idea, i tried this patch but even if it works for check-hash and svn it does not works for the git backend (e.g. libubox) and the wget bakend (try it without the QUIET flags in the WGET variable).I don't understand the reason for this behavior.
Do you have an idea for this strange behavior?Quoted 8 lines
Ok, that's because git always sends its report status to stderr:
--quiet, -q Operate quietly. Progress is not reported to the standard error stream. [...]So, we need to pass -q to git. Sigh, fscking borked behaviour... stderr is for failures, not normal reporting... :-(
So that's the reason...
Quoted 3 lines
OK, so we need to pass -q to some backends.
Quoted 10 lines
Quoted 4 lines
However, what I did not like in your original patch was the fact that some backends were singled out in the wrapper script. We do not want that, we want the wrapper to be backend-agnostic (that's the whole point of having a wrapper and backends).
Well that it's needed only until all backends support the "-q" flag, do you prefer a big patch to convert all backends so that check is not needed?
Quoted 1 line
I'll rework that, then...
Even wget needs that flag, if it is fine for you i'll rework that patch set.
BR
Signature · 1 line
Fabio Porcedda
PATCH v8 2/2 pkg-download: silence downloads if make is silent
In reply to Fabio PorceddaFabio, All,
On 2015-01-01 19:14 +0100, Fabio Porcedda spake thusly:
Quoted 32 lines · Yann E. MORIN
Quoted 18 lines
Fabio, All,
On 2015-01-01 18:54 +0100, Fabio Porcedda spake thusly:
Quoted 7 lines · Yann E. MORIN
Quoted 5 lines
From: Fabio Porcedda <[email protected]>
If it is a silent build (make -s -> QUIET=-q) silence all downloads, as well as the check-hash. Only stdout is redirected, stderr is still visible, for errors and warning.
Quoted 7 lines
Hi Yann,
nice idea, i tried this patch but even if it works for check-hash and svn it does not works for the git backend (e.g. libubox) and the wget bakend (try it without the QUIET flags in the WGET variable).I don't understand the reason for this behavior.
Do you have an idea for this strange behavior?Quoted 8 lines
Ok, that's because git always sends its report status to stderr:
--quiet, -q Operate quietly. Progress is not reported to the standard error stream. [...]So, we need to pass -q to git. Sigh, fscking borked behaviour... stderr is for failures, not normal reporting... :-(
So that's the reason...
Quoted 3 lines
OK, so we need to pass -q to some backends.
Quoted 8 lines
Quoted 4 lines
However, what I did not like in your original patch was the fact that some backends were singled out in the wrapper script. We do not want that, we want the wrapper to be backend-agnostic (that's the whole point of having a wrapper and backends).
Well that it's needed only until all backends support the "-q" flag, do you prefer a big patch to convert all backends so that check is not needed?
I'm already on it... ;-)
Regards,
Yann E. MORIN.
Signature · 6 lines
.-----------------.--------------------.------------------.--------------------. | Yann E. MORIN | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: | | +33 662 376 056 | Software Designer | \ / CAMPAIGN | ___ | | +33 223 225 172 `------------.-------: X AGAINST | \e/ There is no | | http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL | v conspiracy. | '------------------------------^-------^------------------^--------------------'