* [dpdk-dev] [PATCH 1/1] devtools: rename build test verbosity variables
@ 2020-11-12 16:39 Thomas Monjalon
2020-11-12 16:42 ` Bruce Richardson
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Thomas Monjalon @ 2020-11-12 16:39 UTC (permalink / raw)
To: dev; +Cc: david.marchand, bruce.richardson
For consistency with other variables which can be set from the env,
TEST_MESON_BUILD_VERBOSE and TEST_MESON_BUILD_VERY_VERBOSE
are renamed
DPDK_BUILD_TEST_VERBOSE and DPDK_BUILD_TEST_VERY_VERBOSE.
The handling of the verbosity level is also moved upper in the script,
closer to other initializations.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
devtools/test-meson-builds.sh | 36 +++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 3ce49368cf..d3122fbc73 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -43,6 +43,22 @@ default_cflags=$CFLAGS
default_ldflags=$LDFLAGS
default_meson_options=$DPDK_MESON_OPTIONS
+if [ "$1" = "-vv" ] ; then
+ DPDK_BUILD_TEST_VERY_VERBOSE=1
+ DPDK_BUILD_TEST_VERBOSE=1
+elif [ "$1" = "-v" ] ; then
+ DPDK_BUILD_TEST_VERBOSE=1
+fi
+# we can't use plain verbose when we don't have pipefail option so up-level
+if [ -z "$PIPEFAIL" -a -n "$DPDK_BUILD_TEST_VERBOSE" ] ; then
+ echo "# Missing pipefail shell option, changing VERBOSE to VERY_VERBOSE"
+ DPDK_BUILD_TEST_VERY_VERBOSE=1
+fi
+[ -n "$DPDK_BUILD_TEST_VERBOSE" ] && exec 8>&1 || exec 8>/dev/null
+verbose=8
+[ -n "$DPDK_BUILD_TEST_VERY_VERBOSE" ] && exec 9>&1 || exec 9>/dev/null
+veryverbose=9
+
check_cc_flags () # <flag to check> <flag2> ...
{
echo 'int main(void) { return 0; }' |
@@ -108,11 +124,11 @@ config () # <dir> <builddir> <meson options>
compile () # <builddir>
{
builddir=$1
- if [ -n "$TEST_MESON_BUILD_VERY_VERBOSE" ] ; then
+ if [ -n "$DPDK_BUILD_TEST_VERY_VERBOSE" ] ; then
# for full output from ninja use "-v"
echo "$ninja_cmd -v -C $builddir"
$ninja_cmd -v -C $builddir
- elif [ -n "$TEST_MESON_BUILD_VERBOSE" ] ; then
+ elif [ -n "$DPDK_BUILD_TEST_VERBOSE" ] ; then
# for keeping the history of short cmds, pipe through cat
echo "$ninja_cmd -C $builddir | cat"
$ninja_cmd -C $builddir | cat
@@ -180,22 +196,6 @@ build () # <directory> <target compiler | cross file> <meson options>
fi
}
-if [ "$1" = "-vv" ] ; then
- TEST_MESON_BUILD_VERY_VERBOSE=1
- TEST_MESON_BUILD_VERBOSE=1
-elif [ "$1" = "-v" ] ; then
- TEST_MESON_BUILD_VERBOSE=1
-fi
-# we can't use plain verbose when we don't have pipefail option so up-level
-if [ -z "$PIPEFAIL" -a -n "$TEST_MESON_BUILD_VERBOSE" ] ; then
- echo "# Missing pipefail shell option, changing VERBOSE to VERY_VERBOSE"
- TEST_MESON_BUILD_VERY_VERBOSE=1
-fi
-[ -n "$TEST_MESON_BUILD_VERBOSE" ] && exec 8>&1 || exec 8>/dev/null
-verbose=8
-[ -n "$TEST_MESON_BUILD_VERY_VERBOSE" ] && exec 9>&1 || exec 9>/dev/null
-veryverbose=9
-
# shared and static linked builds with gcc and clang
for c in gcc clang ; do
command -v $c >/dev/null 2>&1 || continue
--
2.28.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH 1/1] devtools: rename build test verbosity variables
2020-11-12 16:39 [dpdk-dev] [PATCH 1/1] devtools: rename build test verbosity variables Thomas Monjalon
@ 2020-11-12 16:42 ` Bruce Richardson
2020-11-16 14:27 ` David Marchand
2020-11-17 10:38 ` [dpdk-dev] [PATCH v2 " Thomas Monjalon
2 siblings, 0 replies; 8+ messages in thread
From: Bruce Richardson @ 2020-11-12 16:42 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, david.marchand
On Thu, Nov 12, 2020 at 05:39:01PM +0100, Thomas Monjalon wrote:
> For consistency with other variables which can be set from the env,
> TEST_MESON_BUILD_VERBOSE and TEST_MESON_BUILD_VERY_VERBOSE
> are renamed
> DPDK_BUILD_TEST_VERBOSE and DPDK_BUILD_TEST_VERY_VERBOSE.
>
> The handling of the verbosity level is also moved upper in the script,
> closer to other initializations.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
No objection to increased consistency.
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH 1/1] devtools: rename build test verbosity variables
2020-11-12 16:39 [dpdk-dev] [PATCH 1/1] devtools: rename build test verbosity variables Thomas Monjalon
2020-11-12 16:42 ` Bruce Richardson
@ 2020-11-16 14:27 ` David Marchand
2020-11-16 14:44 ` Thomas Monjalon
2020-11-17 10:38 ` [dpdk-dev] [PATCH v2 " Thomas Monjalon
2 siblings, 1 reply; 8+ messages in thread
From: David Marchand @ 2020-11-16 14:27 UTC (permalink / raw)
To: Thomas Monjalon, Bruce Richardson; +Cc: dev
On Thu, Nov 12, 2020 at 5:39 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> For consistency with other variables which can be set from the env,
> TEST_MESON_BUILD_VERBOSE and TEST_MESON_BUILD_VERY_VERBOSE
> are renamed
> DPDK_BUILD_TEST_VERBOSE and DPDK_BUILD_TEST_VERY_VERBOSE.
It seems a bit odd to take inputs from both the script parameters and
the env to control something.
Those TEST_MESON_BUILD* vars seem internal stuff that should not be exposed.
--
David Marchand
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH 1/1] devtools: rename build test verbosity variables
2020-11-16 14:27 ` David Marchand
@ 2020-11-16 14:44 ` Thomas Monjalon
2020-11-16 15:30 ` Bruce Richardson
0 siblings, 1 reply; 8+ messages in thread
From: Thomas Monjalon @ 2020-11-16 14:44 UTC (permalink / raw)
To: Bruce Richardson, David Marchand; +Cc: dev
16/11/2020 15:27, David Marchand:
> On Thu, Nov 12, 2020 at 5:39 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> >
> > For consistency with other variables which can be set from the env,
> > TEST_MESON_BUILD_VERBOSE and TEST_MESON_BUILD_VERY_VERBOSE
> > are renamed
> > DPDK_BUILD_TEST_VERBOSE and DPDK_BUILD_TEST_VERY_VERBOSE.
>
> It seems a bit odd to take inputs from both the script parameters and
> the env to control something.
> Those TEST_MESON_BUILD* vars seem internal stuff that should not be exposed.
I have the same opinion.
I cannot find a good reason for controlling verbosity
with environment variables instead of parameters.
Bruce is there a reason we are missing?
See the commit 4bcb9b7686043f:
"
When running ninja, the commands are, by default, always printed on top of
each other. For those who want more detail in the output, two levels of
verbose output has been added to the test-meson-builds script. When "-v" is
passed, or the "TEST_MESON_BUILD_VERBOSE" flag is set in the environment,
then the output of ninja is passed through "cat" to prevent each line
overwriting the next. If "-vv" is passed, or
"TEST_MESON_BUILD_VERY_VERBOSE" is set in the environment, then ninja is
called with the "-v" flag to print out each command in full as it is
executing.
"
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH 1/1] devtools: rename build test verbosity variables
2020-11-16 14:44 ` Thomas Monjalon
@ 2020-11-16 15:30 ` Bruce Richardson
0 siblings, 0 replies; 8+ messages in thread
From: Bruce Richardson @ 2020-11-16 15:30 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: David Marchand, dev
On Mon, Nov 16, 2020 at 03:44:33PM +0100, Thomas Monjalon wrote:
> 16/11/2020 15:27, David Marchand:
> > On Thu, Nov 12, 2020 at 5:39 PM Thomas Monjalon <thomas@monjalon.net> wrote:
> > >
> > > For consistency with other variables which can be set from the env,
> > > TEST_MESON_BUILD_VERBOSE and TEST_MESON_BUILD_VERY_VERBOSE
> > > are renamed
> > > DPDK_BUILD_TEST_VERBOSE and DPDK_BUILD_TEST_VERY_VERBOSE.
> >
> > It seems a bit odd to take inputs from both the script parameters and
> > the env to control something.
> > Those TEST_MESON_BUILD* vars seem internal stuff that should not be exposed.
>
> I have the same opinion.
> I cannot find a good reason for controlling verbosity
> with environment variables instead of parameters.
>
> Bruce is there a reason we are missing?
>
> See the commit 4bcb9b7686043f:
> "
> When running ninja, the commands are, by default, always printed on top of
> each other. For those who want more detail in the output, two levels of
> verbose output has been added to the test-meson-builds script. When "-v" is
> passed, or the "TEST_MESON_BUILD_VERBOSE" flag is set in the environment,
> then the output of ninja is passed through "cat" to prevent each line
> overwriting the next. If "-vv" is passed, or
> "TEST_MESON_BUILD_VERY_VERBOSE" is set in the environment, then ninja is
> called with the "-v" flag to print out each command in full as it is
> executing.
> "
No particular reason, it was just that many other things seemed to be
controlled by env variables (or read from config into environment), so I
added that as an option too. Feel free to just drop it in favour of the
flags if you like.
/Bruce
^ permalink raw reply [flat|nested] 8+ messages in thread
* [dpdk-dev] [PATCH v2 1/1] devtools: rename build test verbosity variables
2020-11-12 16:39 [dpdk-dev] [PATCH 1/1] devtools: rename build test verbosity variables Thomas Monjalon
2020-11-12 16:42 ` Bruce Richardson
2020-11-16 14:27 ` David Marchand
@ 2020-11-17 10:38 ` Thomas Monjalon
2020-11-18 10:56 ` David Marchand
2 siblings, 1 reply; 8+ messages in thread
From: Thomas Monjalon @ 2020-11-17 10:38 UTC (permalink / raw)
To: dev; +Cc: david.marchand, bruce.richardson
The verbosity was meant to be set with options -v and -vv,
or possibly with the environment variables TEST_MESON_BUILD_VERBOSE
and TEST_MESON_BUILD_VERY_VERBOSE.
It is decided to keep only the options -v and -vv,
so the variables are renamed with lower case, marking them as privates.
The handling of the verbosity level is also moved upper in the script,
closer to other initializations.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
v2: make the variables private to the script
---
devtools/test-meson-builds.sh | 38 ++++++++++++++++++-----------------
1 file changed, 20 insertions(+), 18 deletions(-)
diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
index 3ce49368cf..7280b7a93d 100755
--- a/devtools/test-meson-builds.sh
+++ b/devtools/test-meson-builds.sh
@@ -43,6 +43,24 @@ default_cflags=$CFLAGS
default_ldflags=$LDFLAGS
default_meson_options=$DPDK_MESON_OPTIONS
+opt_verbose=
+opt_vverbose=
+if [ "$1" = "-v" ] ; then
+ opt_verbose=y
+elif [ "$1" = "-vv" ] ; then
+ opt_verbose=y
+ opt_vverbose=y
+fi
+# we can't use plain verbose when we don't have pipefail option so up-level
+if [ -z "$PIPEFAIL" -a -n "$opt_verbose" ] ; then
+ echo "# Missing pipefail shell option, changing VERBOSE to VERY_VERBOSE"
+ opt_vverbose=y
+fi
+[ -n "$opt_verbose" ] && exec 8>&1 || exec 8>/dev/null
+verbose=8
+[ -n "$opt_vverbose" ] && exec 9>&1 || exec 9>/dev/null
+veryverbose=9
+
check_cc_flags () # <flag to check> <flag2> ...
{
echo 'int main(void) { return 0; }' |
@@ -108,11 +126,11 @@ config () # <dir> <builddir> <meson options>
compile () # <builddir>
{
builddir=$1
- if [ -n "$TEST_MESON_BUILD_VERY_VERBOSE" ] ; then
+ if [ -n "$opt_vverbose" ] ; then
# for full output from ninja use "-v"
echo "$ninja_cmd -v -C $builddir"
$ninja_cmd -v -C $builddir
- elif [ -n "$TEST_MESON_BUILD_VERBOSE" ] ; then
+ elif [ -n "$opt_verbose" ] ; then
# for keeping the history of short cmds, pipe through cat
echo "$ninja_cmd -C $builddir | cat"
$ninja_cmd -C $builddir | cat
@@ -180,22 +198,6 @@ build () # <directory> <target compiler | cross file> <meson options>
fi
}
-if [ "$1" = "-vv" ] ; then
- TEST_MESON_BUILD_VERY_VERBOSE=1
- TEST_MESON_BUILD_VERBOSE=1
-elif [ "$1" = "-v" ] ; then
- TEST_MESON_BUILD_VERBOSE=1
-fi
-# we can't use plain verbose when we don't have pipefail option so up-level
-if [ -z "$PIPEFAIL" -a -n "$TEST_MESON_BUILD_VERBOSE" ] ; then
- echo "# Missing pipefail shell option, changing VERBOSE to VERY_VERBOSE"
- TEST_MESON_BUILD_VERY_VERBOSE=1
-fi
-[ -n "$TEST_MESON_BUILD_VERBOSE" ] && exec 8>&1 || exec 8>/dev/null
-verbose=8
-[ -n "$TEST_MESON_BUILD_VERY_VERBOSE" ] && exec 9>&1 || exec 9>/dev/null
-veryverbose=9
-
# shared and static linked builds with gcc and clang
for c in gcc clang ; do
command -v $c >/dev/null 2>&1 || continue
--
2.28.0
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/1] devtools: rename build test verbosity variables
2020-11-17 10:38 ` [dpdk-dev] [PATCH v2 " Thomas Monjalon
@ 2020-11-18 10:56 ` David Marchand
2020-11-20 15:13 ` David Marchand
0 siblings, 1 reply; 8+ messages in thread
From: David Marchand @ 2020-11-18 10:56 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, Bruce Richardson
On Tue, Nov 17, 2020 at 11:38 AM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> The verbosity was meant to be set with options -v and -vv,
> or possibly with the environment variables TEST_MESON_BUILD_VERBOSE
> and TEST_MESON_BUILD_VERY_VERBOSE.
>
> It is decided to keep only the options -v and -vv,
> so the variables are renamed with lower case, marking them as privates.
>
> The handling of the verbosity level is also moved upper in the script,
> closer to other initializations.
>
> Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> ---
> v2: make the variables private to the script
> ---
> devtools/test-meson-builds.sh | 38 ++++++++++++++++++-----------------
> 1 file changed, 20 insertions(+), 18 deletions(-)
>
> diff --git a/devtools/test-meson-builds.sh b/devtools/test-meson-builds.sh
> index 3ce49368cf..7280b7a93d 100755
> --- a/devtools/test-meson-builds.sh
> +++ b/devtools/test-meson-builds.sh
> @@ -43,6 +43,24 @@ default_cflags=$CFLAGS
> default_ldflags=$LDFLAGS
> default_meson_options=$DPDK_MESON_OPTIONS
>
> +opt_verbose=
> +opt_vverbose=
> +if [ "$1" = "-v" ] ; then
> + opt_verbose=y
> +elif [ "$1" = "-vv" ] ; then
> + opt_verbose=y
> + opt_vverbose=y
> +fi
> +# we can't use plain verbose when we don't have pipefail option so up-level
> +if [ -z "$PIPEFAIL" -a -n "$opt_verbose" ] ; then
> + echo "# Missing pipefail shell option, changing VERBOSE to VERY_VERBOSE"
> + opt_vverbose=y
> +fi
> +[ -n "$opt_verbose" ] && exec 8>&1 || exec 8>/dev/null
> +verbose=8
> +[ -n "$opt_vverbose" ] && exec 9>&1 || exec 9>/dev/null
> +veryverbose=9
> +
> check_cc_flags () # <flag to check> <flag2> ...
> {
> echo 'int main(void) { return 0; }' |
> @@ -108,11 +126,11 @@ config () # <dir> <builddir> <meson options>
> compile () # <builddir>
> {
> builddir=$1
> - if [ -n "$TEST_MESON_BUILD_VERY_VERBOSE" ] ; then
> + if [ -n "$opt_vverbose" ] ; then
> # for full output from ninja use "-v"
> echo "$ninja_cmd -v -C $builddir"
> $ninja_cmd -v -C $builddir
> - elif [ -n "$TEST_MESON_BUILD_VERBOSE" ] ; then
> + elif [ -n "$opt_verbose" ] ; then
> # for keeping the history of short cmds, pipe through cat
> echo "$ninja_cmd -C $builddir | cat"
> $ninja_cmd -C $builddir | cat
> @@ -180,22 +198,6 @@ build () # <directory> <target compiler | cross file> <meson options>
> fi
> }
>
> -if [ "$1" = "-vv" ] ; then
> - TEST_MESON_BUILD_VERY_VERBOSE=1
> - TEST_MESON_BUILD_VERBOSE=1
> -elif [ "$1" = "-v" ] ; then
> - TEST_MESON_BUILD_VERBOSE=1
> -fi
> -# we can't use plain verbose when we don't have pipefail option so up-level
> -if [ -z "$PIPEFAIL" -a -n "$TEST_MESON_BUILD_VERBOSE" ] ; then
> - echo "# Missing pipefail shell option, changing VERBOSE to VERY_VERBOSE"
> - TEST_MESON_BUILD_VERY_VERBOSE=1
> -fi
> -[ -n "$TEST_MESON_BUILD_VERBOSE" ] && exec 8>&1 || exec 8>/dev/null
> -verbose=8
> -[ -n "$TEST_MESON_BUILD_VERY_VERBOSE" ] && exec 9>&1 || exec 9>/dev/null
> -veryverbose=9
> -
> # shared and static linked builds with gcc and clang
> for c in gcc clang ; do
> command -v $c >/dev/null 2>&1 || continue
> --
> 2.28.0
>
Reviewed-by: David Marchand <david.marchand@redhat.com>
--
David Marchand
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [dpdk-dev] [PATCH v2 1/1] devtools: rename build test verbosity variables
2020-11-18 10:56 ` David Marchand
@ 2020-11-20 15:13 ` David Marchand
0 siblings, 0 replies; 8+ messages in thread
From: David Marchand @ 2020-11-20 15:13 UTC (permalink / raw)
To: Thomas Monjalon; +Cc: dev, Bruce Richardson
On Wed, Nov 18, 2020 at 11:56 AM David Marchand
<david.marchand@redhat.com> wrote:
> On Tue, Nov 17, 2020 at 11:38 AM Thomas Monjalon <thomas@monjalon.net> wrote:
> >
> > The verbosity was meant to be set with options -v and -vv,
> > or possibly with the environment variables TEST_MESON_BUILD_VERBOSE
> > and TEST_MESON_BUILD_VERY_VERBOSE.
> >
> > It is decided to keep only the options -v and -vv,
> > so the variables are renamed with lower case, marking them as privates.
> >
> > The handling of the verbosity level is also moved upper in the script,
> > closer to other initializations.
> >
> > Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
> Reviewed-by: David Marchand <david.marchand@redhat.com>
Applied, thanks.
--
David Marchand
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2020-11-20 15:13 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-12 16:39 [dpdk-dev] [PATCH 1/1] devtools: rename build test verbosity variables Thomas Monjalon
2020-11-12 16:42 ` Bruce Richardson
2020-11-16 14:27 ` David Marchand
2020-11-16 14:44 ` Thomas Monjalon
2020-11-16 15:30 ` Bruce Richardson
2020-11-17 10:38 ` [dpdk-dev] [PATCH v2 " Thomas Monjalon
2020-11-18 10:56 ` David Marchand
2020-11-20 15:13 ` David Marchand
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).