* [PATCH] bpftool: Fix version string in recursive builds
@ 2020-08-13 23:58 Ben Hutchings
2020-08-14 15:43 ` Yonghong Song
0 siblings, 1 reply; 4+ messages in thread
From: Ben Hutchings @ 2020-08-13 23:58 UTC (permalink / raw)
To: Alexei Starovoitov, Daniel Borkmann; +Cc: bpf, debian-kernel
[-- Attachment #1: Type: text/plain, Size: 1164 bytes --]
When bpftool is built as part of a Debian package build, which itself
uses make, "bpftool version" shows:
bpftool vmake[4]: Entering directory /build/linux-5.8/tools/bpf/bpftool 5.8.8.0 make[4]: Leaving directory /build/linux-5.8
Although we pass the "--no-print-directory" option, this is overridden
by the environment variable "MAKEFLAGS=w". Clear MAKEFLAGS for the
"make kernelversion" command.
I have no explanation for the doubled ".8" in the version string, but
this seems to fix that as well.
Signed-off-by: Ben Hutchings <benh@debian.org>
---
tools/bpf/bpftool/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
index 9e85f101be85..7fbad8cbd171 100644
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -25,7 +25,7 @@ endif
LIBBPF = $(LIBBPF_PATH)libbpf.a
-BPFTOOL_VERSION := $(shell make -rR --no-print-directory -sC ../../.. kernelversion)
+BPFTOOL_VERSION := $(shell MAKEFLAGS= make -rR --no-print-directory -sC ../../.. kernelversion)
$(LIBBPF): FORCE
$(if $(LIBBPF_OUTPUT),@mkdir -p $(LIBBPF_OUTPUT))
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] bpftool: Fix version string in recursive builds
2020-08-13 23:58 [PATCH] bpftool: Fix version string in recursive builds Ben Hutchings
@ 2020-08-14 15:43 ` Yonghong Song
2020-08-14 22:17 ` Ben Hutchings
0 siblings, 1 reply; 4+ messages in thread
From: Yonghong Song @ 2020-08-14 15:43 UTC (permalink / raw)
To: Ben Hutchings, Alexei Starovoitov, Daniel Borkmann; +Cc: bpf, debian-kernel
On 8/13/20 4:58 PM, Ben Hutchings wrote:
> When bpftool is built as part of a Debian package build, which itself
> uses make, "bpftool version" shows:
>
> bpftool vmake[4]: Entering directory /build/linux-5.8/tools/bpf/bpftool 5.8.8.0 make[4]: Leaving directory /build/linux-5.8
>
> Although we pass the "--no-print-directory" option, this is overridden
> by the environment variable "MAKEFLAGS=w". Clear MAKEFLAGS for the
> "make kernelversion" command.
>
> I have no explanation for the doubled ".8" in the version string, but
> this seems to fix that as well.
>
> Signed-off-by: Ben Hutchings <benh@debian.org>
> ---
> tools/bpf/bpftool/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/bpf/bpftool/Makefile b/tools/bpf/bpftool/Makefile
> index 9e85f101be85..7fbad8cbd171 100644
> --- a/tools/bpf/bpftool/Makefile
> +++ b/tools/bpf/bpftool/Makefile
> @@ -25,7 +25,7 @@ endif
>
> LIBBPF = $(LIBBPF_PATH)libbpf.a
>
> -BPFTOOL_VERSION := $(shell make -rR --no-print-directory -sC ../../.. kernelversion)
> +BPFTOOL_VERSION := $(shell MAKEFLAGS= make -rR --no-print-directory -sC ../../.. kernelversion)
I tried the following
--- a/tools/bpf/bpftool/Makefile
+++ b/tools/bpf/bpftool/Makefile
@@ -25,7 +25,7 @@ endif
LIBBPF = $(LIBBPF_PATH)libbpf.a
-BPFTOOL_VERSION := $(shell make -rR --no-print-directory -sC ../../..
kernelversion)
+BPFTOOL_VERSION := $(shell MAKEFLAGS=w make -rR --no-print-directory
-sC ../../.. kernelversion)
-bash-4.4$ ./bpftool version
./bpftool v5.8.0
I set env variable MAKEFLAGS=w, and build bpftool it works fine too.
Maybe I miss something or debian changed top level Makefile?
I am testing against latest bpf tree.
>
> $(LIBBPF): FORCE
> $(if $(LIBBPF_OUTPUT),@mkdir -p $(LIBBPF_OUTPUT))
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] bpftool: Fix version string in recursive builds
2020-08-14 15:43 ` Yonghong Song
@ 2020-08-14 22:17 ` Ben Hutchings
2020-08-14 22:55 ` Yonghong Song
0 siblings, 1 reply; 4+ messages in thread
From: Ben Hutchings @ 2020-08-14 22:17 UTC (permalink / raw)
To: Yonghong Song, Alexei Starovoitov, Daniel Borkmann; +Cc: bpf, debian-kernel
[-- Attachment #1: Type: text/plain, Size: 1060 bytes --]
On Fri, 2020-08-14 at 08:43 -0700, Yonghong Song wrote:
[...]
> I tried the following
>
> --- a/tools/bpf/bpftool/Makefile
> +++ b/tools/bpf/bpftool/Makefile
> @@ -25,7 +25,7 @@ endif
>
> LIBBPF = $(LIBBPF_PATH)libbpf.a
>
> -BPFTOOL_VERSION := $(shell make -rR --no-print-directory -sC ../../..
> kernelversion)
> +BPFTOOL_VERSION := $(shell MAKEFLAGS=w make -rR --no-print-directory
> -sC ../../.. kernelversion)
>
> -bash-4.4$ ./bpftool version
> ./bpftool v5.8.0
>
> I set env variable MAKEFLAGS=w, and build bpftool it works fine too.
> Maybe I miss something or debian changed top level Makefile?
Yes, but we don't change MAKEFLAGS or any of the logic around quietness
or verbosity.
I assume there are other factors involved, as I've also been unable to
construct a simple reproducer.
Ben.
> I am testing against latest bpf tree.
>
> >
> > $(LIBBPF): FORCE
> > $(if $(LIBBPF_OUTPUT),@mkdir -p $(LIBBPF_OUTPUT))
> >
--
Ben Hutchings - Debian developer, member of kernel, installer and LTS teams
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] bpftool: Fix version string in recursive builds
2020-08-14 22:17 ` Ben Hutchings
@ 2020-08-14 22:55 ` Yonghong Song
0 siblings, 0 replies; 4+ messages in thread
From: Yonghong Song @ 2020-08-14 22:55 UTC (permalink / raw)
To: Ben Hutchings, Alexei Starovoitov, Daniel Borkmann; +Cc: bpf, debian-kernel
On 8/14/20 3:17 PM, Ben Hutchings wrote:
> On Fri, 2020-08-14 at 08:43 -0700, Yonghong Song wrote:
> [...]
>> I tried the following
>>
>> --- a/tools/bpf/bpftool/Makefile
>> +++ b/tools/bpf/bpftool/Makefile
>> @@ -25,7 +25,7 @@ endif
>>
>> LIBBPF = $(LIBBPF_PATH)libbpf.a
>>
>> -BPFTOOL_VERSION := $(shell make -rR --no-print-directory -sC ../../..
>> kernelversion)
>> +BPFTOOL_VERSION := $(shell MAKEFLAGS=w make -rR --no-print-directory
>> -sC ../../.. kernelversion)
>>
>> -bash-4.4$ ./bpftool version
>> ./bpftool v5.8.0
>>
>> I set env variable MAKEFLAGS=w, and build bpftool it works fine too.
>> Maybe I miss something or debian changed top level Makefile?
>
> Yes, but we don't change MAKEFLAGS or any of the logic around quietness
> or verbosity.
>
> I assume there are other factors involved, as I've also been unable to
> construct a simple reproducer.
It would be good to know what is the exact problem, and then we can
decide whether this patch is the most appropriate fix or not.
>
> Ben.
>
>> I am testing against latest bpf tree.
>>
>>>
>>> $(LIBBPF): FORCE
>>> $(if $(LIBBPF_OUTPUT),@mkdir -p $(LIBBPF_OUTPUT))
>>>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-08-14 22:56 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-13 23:58 [PATCH] bpftool: Fix version string in recursive builds Ben Hutchings
2020-08-14 15:43 ` Yonghong Song
2020-08-14 22:17 ` Ben Hutchings
2020-08-14 22:55 ` Yonghong Song
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).