Skip to contentSkip to conversation

Handle verbosity in infrastructures

PATCH New Cédric Marie 2 participants 7 messages Sep 5, 2015 – Sep 7, 2015 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Handle verbosity in infrastructures

The verbosity of the build step is controlled in a different way for every type of infrastructure. It is not possible to export a variable that could be understood by all of them.

As a consequence, in root Makefile:
* 'VERBOSE' is removed.
* 'KBUILD_VERBOSE' and 'quiet' are also removed, because they are not used.
* 'Q' is kept because it is used by Buildroot.

Instead, each infrastructure should add a specific variable to export at build time, when V is set in the command line ('make V=1').

* CMake adds 'VERBOSE=1' when V=1
* Autotools forward 'V=0' and 'V=1'. The default behaviour depends on the package. It is kept unchanged, unless explicitly modified by 'make V=0' or 'make V=1'.

---
 Makefile                 | 18 +++---------------
 package/pkg-autotools.mk | 16 ++++++++++++++--
 package/pkg-cmake.mk     | 12 ++++++++++--
 3 files changed, 27 insertions(+), 19 deletions(-)
Makefile +3 -15
index 23e2ee6..4a6c9ef 100644
@@ -218,23 +218,11 @@ endif
 
 # To put more focus on warnings, be less verbose as default
 # Use 'make V=1' to see the full commands
+Q = @
 ifeq ("$(origin V)", "command line")
-  KBUILD_VERBOSE = $(V)
-endif
-ifndef KBUILD_VERBOSE
-  KBUILD_VERBOSE = 0
-endif
-
-ifeq ($(KBUILD_VERBOSE),1)
-  quiet =
+ifeq ($(V),1)
   Q =
-ifndef VERBOSE
-  VERBOSE = 1
 endif
-export VERBOSE
-else
-  quiet = quiet_
-  Q = @
 endif
 
 # we want bash as shell
@@ -245,7 +233,7 @@ SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
 # kconfig uses CONFIG_SHELL
 CONFIG_SHELL := $(SHELL)
 
-export SHELL CONFIG_SHELL quiet Q KBUILD_VERBOSE
+export SHELL CONFIG_SHELL Q
 
 ifndef HOSTAR
 HOSTAR := ar
package/pkg-autotools.mk +14 -2
index 4787914..18ab1ae 100644
@@ -94,6 +94,18 @@ define AUTORECONF_HOOK
 	$(Q)cd $($(PKG)_SRCDIR) && $($(PKG)_AUTORECONF_ENV) $(AUTORECONF) $($(PKG)_AUTORECONF_OPTS)
 endef
 
+# During build step:
+# 'make V=0' disables the verbose mode (if enabled by the package)
+# 'make V=1' enables the verbose mode (if not already enabled by the package)
+AUTOTOOLS_VERBOSE =
+ifeq ("$(origin V)", "command line")
+ifeq ($(V),0)
+  AUTOTOOLS_VERBOSE = V=0
+else ifeq ($(V),1)
+  AUTOTOOLS_VERBOSE = V=1
+endif
+endif
+
 ################################################################################
 # inner-autotools-package -- defines how the configuration, compilation and
 # installation of an autotools package should be done, implements a
@@ -271,11 +283,11 @@ endif
 ifndef $(2)_BUILD_CMDS
 ifeq ($(4),target)
 define $(2)_BUILD_CMDS
-	$$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_SRCDIR)
+	$$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_SRCDIR) $(AUTOTOOLS_VERBOSE)
 endef
 else
 define $(2)_BUILD_CMDS
-	$$(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_SRCDIR)
+	$$(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_SRCDIR) $(AUTOTOOLS_VERBOSE)
 endef
 endif
 endif
package/pkg-cmake.mk +10 -2
index 574eccc..8e57a9c 100644
@@ -35,6 +35,14 @@ ifneq ($(QUIET),)
 CMAKE_QUIET = -DCMAKE_RULE_MESSAGES=OFF -DCMAKE_INSTALL_MESSAGE=NEVER
 endif
 
+# 'make V=1' enables the verbose mode during build step
+CMAKE_VERBOSE =
+ifeq ("$(origin V)", "command line")
+ifeq ($(V),1)
+  CMAKE_VERBOSE = VERBOSE=1
+endif
+endif
+
 ################################################################################
 # inner-cmake-package -- defines how the configuration, compilation and
 # installation of a CMake package should be done, implements a few hooks to
@@ -159,11 +167,11 @@ $(2)_DEPENDENCIES += host-cmake
 ifndef $(2)_BUILD_CMDS
 ifeq ($(4),target)
 define $(2)_BUILD_CMDS
-	$$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_BUILDDIR)
+	$$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_BUILDDIR) $(CMAKE_VERBOSE)
 endef
 else
 define $(2)_BUILD_CMDS
-	$$(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_BUILDDIR)
+	$$(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_BUILDDIR) $(CMAKE_VERBOSE)
 endef
 endif
 endif
Signature · 1 line
2.5.1
#1 lore raw

PATCH 1/1 Handle verbosity in infrastructures

Hi C?dric,

Quoted 8 lines · C?dric Marie

The verbosity of the build step is controlled in a different way for every type of infrastructure. It is not possible to export a variable that could be understood by all of them.

As a consequence, in root Makefile:
* 'VERBOSE' is removed.
* 'KBUILD_VERBOSE' and 'quiet' are also removed, because they are not used.

Perhaps the removal of KBUILD_VERBOSE and quiet should be a separate patch,
since that's a change that shouldn't make any difference. The verbose-handling in cmake and autotools, on the other hand, do change the behaviour.

Quoted 61 lines

* 'Q' is kept because it is used by Buildroot.

Instead, each infrastructure should add a specific variable to export at build time, when V is set in the command line ('make V=1').

* CMake adds 'VERBOSE=1' when V=1
* Autotools forward 'V=0' and 'V=1'. The default behaviour depends on the package. It is kept unchanged, unless explicitly modified by 'make V=0' or 'make V=1'.

---
 Makefile                 | 18 +++---------------
 package/pkg-autotools.mk | 16 ++++++++++++++--
 package/pkg-cmake.mk     | 12 ++++++++++--
 3 files changed, 27 insertions(+), 19 deletions(-)
Makefile +3 -15
index 23e2ee6..4a6c9ef 100644
@@ -218,23 +218,11 @@ endif
 
 # To put more focus on warnings, be less verbose as default
 # Use 'make V=1' to see the full commands
+Q = @
 ifeq ("$(origin V)", "command line")
-  KBUILD_VERBOSE = $(V)
-endif
-ifndef KBUILD_VERBOSE
-  KBUILD_VERBOSE = 0
-endif
-
-ifeq ($(KBUILD_VERBOSE),1)
-  quiet =
+ifeq ($(V),1)
   Q =
-ifndef VERBOSE
-  VERBOSE = 1
 endif
-export VERBOSE
-else
-  quiet = quiet_
-  Q = @
 endif
 
 # we want bash as shell
@@ -245,7 +233,7 @@ SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \
 # kconfig uses CONFIG_SHELL
 CONFIG_SHELL := $(SHELL)
 
-export SHELL CONFIG_SHELL quiet Q KBUILD_VERBOSE
+export SHELL CONFIG_SHELL Q
 
 ifndef HOSTAR
 HOSTAR := ar
package/pkg-autotools.mk +0 -0
index 4787914..18ab1ae 100644

package/pkg-autotools.mk define AUTORECONF_HOOK · line 99

Quoted 6 lines
package/pkg-autotools.mk +3 -0
@@ -94,6 +94,18 @@ define AUTORECONF_HOOK
 	$(Q)cd $($(PKG)_SRCDIR) && $($(PKG)_AUTORECONF_ENV) $(AUTORECONF) $($(PKG)_AUTORECONF_OPTS)
 endef
 
+# During build step:
+# 'make V=0' disables the verbose mode (if enabled by the package)
+# 'make V=1' enables the verbose mode (if not already enabled by the package)

Add a comment here that we use the package's default unless V=0/1 was passed on
the command line.

package/pkg-autotools.mk define AUTORECONF_HOOK · line 100

Quoted 1 line
package/pkg-autotools.mk +1 -0
+AUTOTOOLS_VERBOSE =

Not needed to initialize it empty.

package/pkg-autotools.mk define AUTORECONF_HOOK · line 106

Quoted 6 lines
package/pkg-autotools.mk +6 -0
+ifeq ("$(origin V)", "command line")
+ifeq ($(V),0)
+  AUTOTOOLS_VERBOSE = V=0
+else ifeq ($(V),1)
+  AUTOTOOLS_VERBOSE = V=1
+endif

This can just be:
AUTOTOOLS_VERBOSE = V=$(V)

Also, no indentation inside make conditions.

I also don't really like that the $(origin V) condition is repeated, but the
alternatives don't look better either.

Quoted 24 lines
package/pkg-autotools.mk +4 -2
+endif
+
 ################################################################################
 # inner-autotools-package -- defines how the configuration, compilation and
 # installation of an autotools package should be done, implements a
@@ -271,11 +283,11 @@ endif
 ifndef $(2)_BUILD_CMDS
 ifeq ($(4),target)
 define $(2)_BUILD_CMDS
-	$$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_SRCDIR)
+	$$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_SRCDIR) $(AUTOTOOLS_VERBOSE)
 endef
 else
 define $(2)_BUILD_CMDS
-	$$(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_SRCDIR)
+	$$(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_SRCDIR) $(AUTOTOOLS_VERBOSE)
 endef
 endif
 endif
package/pkg-cmake.mk +0 -0
index 574eccc..8e57a9c 100644

package/pkg-cmake.mk ifneq ($(QUIET),) · line 39

Quoted 5 lines
package/pkg-cmake.mk +2 -0
@@ -35,6 +35,14 @@ ifneq ($(QUIET),)
 CMAKE_QUIET = -DCMAKE_RULE_MESSAGES=OFF -DCMAKE_INSTALL_MESSAGE=NEVER
 endif
 
+# 'make V=1' enables the verbose mode during build step
+CMAKE_VERBOSE =

Again, not needed to initialize it empty.

package/pkg-cmake.mk ifneq ($(QUIET),) · line 42

Quoted 3 lines
package/pkg-cmake.mk +3 -0
+ifeq ("$(origin V)", "command line")
+ifeq ($(V),1)
+  CMAKE_VERBOSE = VERBOSE=1

So no indentation here either.

Otherwise, looks good to me :-)

Regards,
Arnout

Quoted 21 lines
package/pkg-cmake.mk +5 -2
+endif
+endif
+
 ################################################################################
 # inner-cmake-package -- defines how the configuration, compilation and
 # installation of a CMake package should be done, implements a few hooks to
@@ -159,11 +167,11 @@ $(2)_DEPENDENCIES += host-cmake
 ifndef $(2)_BUILD_CMDS
 ifeq ($(4),target)
 define $(2)_BUILD_CMDS
-	$$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_BUILDDIR)
+	$$(TARGET_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_BUILDDIR) $(CMAKE_VERBOSE)
 endef
 else
 define $(2)_BUILD_CMDS
-	$$(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_BUILDDIR)
+	$$(HOST_MAKE_ENV) $$($$(PKG)_MAKE_ENV) $$($$(PKG)_MAKE) $$($$(PKG)_MAKE_OPTS) -C $$($$(PKG)_BUILDDIR) $(CMAKE_VERBOSE)
 endef
 endif
 endif
Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#2 lore raw

PATCH 1/1 Handle verbosity in infrastructures

Le 2015-09-06 23:50, Arnout Vandecappelle a ?crit?:

Quoted 5 lines

Perhaps the removal of KBUILD_VERBOSE and quiet should be a separate
patch,
since that's a change that shouldn't make any difference. The verbose-handling
in cmake and autotools, on the other hand, do change the behaviour.

OK for two patches.
By the way, I think that this part of code could be removed from support/scripts/mkmakefile:

if [ "${quiet}" != "silent_" ]; then

because quiet is currently never set to "silent_". And moreover I'm removing it.
But this code comes from the kernel I believe, so I'm not sure it's a good idea to simply change it.

Quoted 3 lines

Add a comment here that we use the package's default unless V=0/1 was
passed on
the command line.

Yes, I agree that it's not very clear.

Quoted 3 lines
Quoted 1 line

+AUTOTOOLS_VERBOSE =

Not needed to initialize it empty.

What if I export AUTOTOOLS_VERBOSE=1 in my shell? Not necessarily to hack Buildroot, but maybe because this variable has to be set in my shell environnement for another purpose.
Isn't it more robust if I prevent this kind of (very) particular use case?

Quoted 9 lines

package/pkg-autotools.mk define AUTORECONF_HOOK · line 106

Quoted 6 lines
package/pkg-autotools.mk +6 -0
+ifeq ("$(origin V)", "command line")
+ifeq ($(V),0)
+  AUTOTOOLS_VERBOSE = V=0
+else ifeq ($(V),1)
+  AUTOTOOLS_VERBOSE = V=1
+endif

This can just be:
AUTOTOOLS_VERBOSE = V=$(V)

Shouldn't we check that the value makes sense for autotools? What if I use make V=3, make V=zzz, or make V=

Quoted 1 line

Also, no indentation inside make conditions.

OK, I will change it, but this rule is not always respected :-) The code in root Makefile was indented this way, with 2 spaces.

Quoted 3 lines

I also don't really like that the $(origin V) condition is repeated,
but the
alternatives don't look better either.

What I don't like with this syntax, is that there is no way to check "if condition AND condition". That's why I initialize the variable with a value that may be changed a few lines below...
Using BR2_VERBOSE sounded nice to me, but I'm respecting your preferences :)

Quoted 3 lines
Quoted 1 line

+CMAKE_VERBOSE =

Again, not needed to initialize it empty.

Same remark as above.

Quoted 1 line

Otherwise, looks good to me :-)

Thanks :)

By the way, as mentioned in another mail (the initial discussion thread), shouldn't I modify docs/manual/make-tips.txt with the new V=0 possibility?
I said that V=0 was very specific to autotools, but in fact V=1 is already specific to cmake and some autotools packages (the ones that have support for this option).

Regards,

Signature · 1 line
C?dric
#3 lore raw

PATCH 1/1 Handle verbosity in infrastructures

Quoted 6 lines · C?dric Marie

Le 2015-09-06 23:50, Arnout Vandecappelle a ?crit :

Quoted 3 lines

Perhaps the removal of KBUILD_VERBOSE and quiet should be a separate patch,
since that's a change that shouldn't make any difference. The verbose-handling in cmake and autotools, on the other hand, do change the behaviour.

Quoted 7 lines

OK for two patches.
By the way, I think that this part of code could be removed from support/scripts/mkmakefile:

if [ "${quiet}" != "silent_" ]; then

because quiet is currently never set to "silent_". And moreover I'm removing it.

Correct! I did a git grep to verify, but there were so many hits in patches and
such that I proceeded to look only at .mk files, so this one slipped by.

Quoted 2 lines

But this code comes from the kernel I believe, so I'm not sure it's a good idea to simply change it.

Don't worry about that, we don't keep this file in sync with the kernel (same
for the top-level makefile). The only thing we do keep in sync is the kconfig infra.

Quoted 10 lines
Quoted 4 lines

Add a comment here that we use the package's default unless V=0/1 was passed on
the command line.

Yes, I agree that it's not very clear.

Quoted 2 lines
Quoted 1 line

+AUTOTOOLS_VERBOSE =

Quoted 7 lines
Quoted 1 line

Not needed to initialize it empty.

What if I export AUTOTOOLS_VERBOSE=1 in my shell? Not necessarily to hack Buildroot, but maybe because this variable has to be set in my shell environnement for another purpose.
Isn't it more robust if I prevent this kind of (very) particular use case?

Good point, you're right. Perhaps add a comment to clarify that.
# Override value passed in the environment

Quoted 13 lines
Quoted 12 lines

package/pkg-autotools.mk define AUTORECONF_HOOK · line 106

Quoted 9 lines
package/pkg-autotools.mk +6 -0
+ifeq ("$(origin V)", "command line")
+ifeq ($(V),0)
+  AUTOTOOLS_VERBOSE = V=0
+else ifeq ($(V),1)
+  AUTOTOOLS_VERBOSE = V=1
+endif

This can just be:
AUTOTOOLS_VERBOSE = V=$(V)

Quoted 2 lines

Shouldn't we check that the value makes sense for autotools? What if I use make V=3, make V=zzz, or make V=

Garbage in, garbage out :-) The documentation clearly states that it should be
V=1. In fact, V=0 is currently not documented, perhaps that could be added. But I don't see that as very important.

Quoted 4 lines
Quoted 1 line

Also, no indentation inside make conditions.

OK, I will change it, but this rule is not always respected :-) The code in root Makefile was indented this way, with 2 spaces.

If you do a git blame, you should see that all the lines with wrong indentation
are more than 2 years old. Lately we've been paying attention to consistent indentation, but nobody has bothered to update existing Makefiles.

Quoted 8 lines
Quoted 4 lines

I also don't really like that the $(origin V) condition is repeated, but the
alternatives don't look better either.

What I don't like with this syntax, is that there is no way to check "if condition AND condition". That's why I initialize the variable with a value that may be changed a few lines below...

Well, you can actually put the two conditions on a single line but it looks
even worse:

ifeq ("$(origin V)"$(V), "command line"1)

Quoted 1 line

Using BR2_VERBOSE sounded nice to me, but I'm respecting your preferences :)

I don't remember saying anything about BR2_VERBOSE, and I also can't find it in
the mails I sent (but I didn't check too carefully). I may have said something about exporting such a variable - since nobody uses it there's no point exporting it. Also, it doesn't match the naming convention: if it is a purely internal (non-exported) variable, it should be just VERBOSE; if it is an exported variable, it should be BR_VERBOSE because it is not user-visible or Kconfig related (only user-visible or Kconfig options should have the BR2_ prefix, all others should have a BR_ prefix).

Quoted 9 lines
Quoted 5 lines
Quoted 3 lines

+CMAKE_VERBOSE =

Again, not needed to initialize it empty.

Same remark as above.

Quoted 6 lines
Quoted 1 line

Otherwise, looks good to me :-)

Thanks :)

By the way, as mentioned in another mail (the initial discussion thread), shouldn't I modify docs/manual/make-tips.txt with the new V=0 possibility?

Exactly :-)

Quoted 3 lines

I said that V=0 was very specific to autotools, but in fact V=1 is already specific to cmake and some autotools packages (the ones that have support for this option).

Well, V=1 is specific to buildroot, and we also export it to autotools and
cmake packages. So indeed, that could be added to the documentation as well.

Documentation updates should probably be in a separate patch since it usually
gets some more discussion about wording etc. and that shouldn't stop the acceptance of the code change itself.

Regards,
Arnout

Quoted 3 lines

Regards,

Signature · 6 lines
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#4 lore raw

PATCH 1/1 Handle verbosity in infrastructures

Le 2015-09-07 14:09, Arnout Vandecappelle a ?crit?:

Quoted 2 lines

Good point, you're right. Perhaps add a comment to clarify that.
# Override value passed in the environment

OK. I'll add a comment.

Quoted 1 line

Garbage in, garbage out :-)

Yes, but the error will only occur when it comes to compiling an autotools package. It may be disturbing to be notified so late, that the option was not correct. Well, in my case, it is simply ignored, so we're not notified at all... that's no better.

make V=0/1 is Buildroot "API", and althought it is the same as autotools "API", I think we should "translate" it, and prevent Buildroot from forwarding invalid values. Just my opinion, and my experience in C language :-)

So maybe - if you agree that it should be checked - that should be done at the beginning, in root Makefile.

Quoted 5 lines

If you do a git blame, you should see that all the lines with wrong
indentation
are more than 2 years old. Lately we've been paying attention to consistent
indentation, but nobody has bothered to update existing Makefiles.

OK, I had noticed the two different kinds of indentation, but didn't git blame to check which one was the more recent.
I'll fix it.

Quoted 5 lines

Well, you can actually put the two conditions on a single line but it
looks
even worse:

ifeq ("$(origin V)"$(V), "command line"1)

In fact, I thought about it, but I didn't have the idea to exclude $(V) out of the "" (i.e. I thought of: ifeq ("$(origin V)$(V)", "command line1"). And I thought that exporting 'V=command line1' in the shell would "hack" the test and make it invalid. Yes, I know, I'm thinking about very particular use cases :-)

But I agree that - even with your method that fix this problem - it doesn't look very nice.

Quoted 3 lines

I don't remember saying anything about BR2_VERBOSE, and I also can't
find it in
the mails I sent (but I didn't check too carefully).

It was not very clear because I didn't write any code to explain what I meant, but I initially proposed to check $(origin V) and $(V) in the root Makefile, and export BR2_VERBOSE (0 or 1). Then, in infrastructures, it was not necessary to check $(origin V) anymore, but simply check BR2_VERBOSE value.

export BR2_VERBOSE=
ifeq ("$(origin V)", "command line")
ifeq ($(V),0)
BR2_VERBOSE=0
else ifeq ($(V),1)
BR2_VERBOSE=1
endif

Then, in pkg-cmake.mk:
ifeq ($(BR2_VERBOSE),1)
CMAKE_VERBOSE = VERBOSE=1
endif

Quoted 11 lines

I may have said something
about exporting such a variable - since nobody uses it there's no point exporting it. Also, it doesn't match the naming convention: if it is a purely
internal (non-exported) variable, it should be just VERBOSE; if it is an
exported variable, it should be BR_VERBOSE because it is not user-visible or
Kconfig related (only user-visible or Kconfig options should have the BR2_
prefix, all others should have a BR_ prefix).

OK, so I should use BR_VERBOSE.

Quoted 5 lines

Documentation updates should probably be in a separate patch since it
usually
gets some more discussion about wording etc. and that shouldn't stop the
acceptance of the code change itself.

OK. 3 patches so far :-)

Signature · 1 line
C?dric
#5 lore raw

PATCH 1/1 Handle verbosity in infrastructures

Quoted 13 lines · C?dric Marie

Le 2015-09-07 14:09, Arnout Vandecappelle a ?crit :

Quoted 2 lines

Good point, you're right. Perhaps add a comment to clarify that.
# Override value passed in the environment

OK. I'll add a comment.

Quoted 1 line

Garbage in, garbage out :-)

Yes, but the error will only occur when it comes to compiling an autotools package. It may be disturbing to be notified so late, that the option was not correct. Well, in my case, it is simply ignored, so we're not notified at all... that's no better.

Quoted 6 lines

make V=0/1 is Buildroot "API", and althought it is the same as autotools "API", I think we should "translate" it, and prevent Buildroot from forwarding invalid values. Just my opinion, and my experience in C language :-)

So maybe - if you agree that it should be checked - that should be done at the beginning, in root Makefile.

Sounds good to me.

[snip]

Quoted 10 lines
Quoted 2 lines

I don't remember saying anything about BR2_VERBOSE, and I also can't find it in
the mails I sent (but I didn't check too carefully).

It was not very clear because I didn't write any code to explain what I meant, but I initially proposed to check $(origin V) and $(V) in the root Makefile, and export BR2_VERBOSE (0 or 1). Then, in infrastructures, it was not necessary to check $(origin V) anymore, but simply check BR2_VERBOSE value.

export BR2_VERBOSE=

Yeah, this I remember. It's the export that I have a problem with. Nothing
(currently) uses this variable so there is no need to export it. I also don't see which scripts would ever use it, since most scripts already are verbose by default.

Quoted 21 lines

ifeq ("$(origin V)", "command line")
ifeq ($(V),0)
BR2_VERBOSE=0
else ifeq ($(V),1)
BR2_VERBOSE=1
endif

Then, in pkg-cmake.mk:
ifeq ($(BR2_VERBOSE),1)
CMAKE_VERBOSE = VERBOSE=1
endif

Quoted 7 lines

I may have said something
about exporting such a variable - since nobody uses it there's no point exporting it. Also, it doesn't match the naming convention: if it is a purely internal (non-exported) variable, it should be just VERBOSE; if it is an exported variable, it should be BR_VERBOSE because it is not user-visible or Kconfig related (only user-visible or Kconfig options should have the BR2_ prefix, all others should have a BR_ prefix).

Quoted 1 line

OK, so I should use BR_VERBOSE.

Well, no, because it shouldn't be exported so it's purely internal to the
makefiles so VERBOSE is enough.

Actually, the VERBOSE already existed and is in fact used in one case:
package/qt/qt.mk

Quoted 5 lines
Quoted 3 lines

Documentation updates should probably be in a separate patch since it usually
gets some more discussion about wording etc. and that shouldn't stop the acceptance of the code change itself.

OK. 3 patches so far :-)

Or maybe 4:

1. Remove KBUILD_VERBOSE and quiet (this one will be uncontroversial I think)
2. Define VERBOSE based on V= passed on command line
3. Use VERBOSE in autotools and cmake
4. Update documentation.

Regards,
Arnout

Signature · 6 lines
Arnout Vandecappelle      arnout dot vandecappelle at essensium dot com
Senior Embedded Software Architect . . . . . . +32-478-010353 (mobile)
Essensium, Mind division . . . . . . . . . . . . . . http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium . . . . . BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7493 020B C7E3 8618 8DEC 222C 82EB F404 F9AC 0DDF
#6 lore raw

PATCH 1/1 Handle verbosity in infrastructures

Le 2015-09-07 16:23, Arnout Vandecappelle a ?crit?:

Quoted 9 lines
Quoted 1 line

export BR2_VERBOSE=

Yeah, this I remember. It's the export that I have a problem with.
Nothing
(currently) uses this variable so there is no need to export it. I also don't
see which scripts would ever use it, since most scripts already are verbose by
default.

You're right. I should study the use of export more carefully!... I thought exporting was necessary for the variable to be visible in pkg-cmake.mk and pkg-autotools.mk.
But there is no recursive make, we're in the same make process, so there is no need to export it.

Quoted 3 lines

Well, no, because it shouldn't be exported so it's purely internal to
the
makefiles so VERBOSE is enough.

Yes, I should use VERBOSE.

Quoted 2 lines

Actually, the VERBOSE already existed and is in fact used in one case:
package/qt/qt.mk

OK, so I'll check that the compilation of Qt is kept unchanged with my modification.
With my initial patch, it was broken! :(

Quoted 7 lines

Or maybe 4:

1. Remove KBUILD_VERBOSE and quiet (this one will be uncontroversial I think)
2. Define VERBOSE based on V= passed on command line
3. Use VERBOSE in autotools and cmake
4. Update documentation.

OK.

Regards,

Signature · 1 line
C?dric