Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 936209

Summary: dev-util/bpftool: versioning is inconsistent with upstream
Product: Gentoo Linux Reporter: Holger Hoffstätte <holger>
Component: Current packagesAssignee: Gentoo Linux bug wranglers <bug-wranglers>
Status: RESOLVED FIXED    
Severity: normal CC: holger
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/37572
https://github.com/gentoo/gentoo/pull/37591
Whiteboard:
Package list:
Runtime testing required: ---

Description Holger Hoffstätte 2024-07-17 11:02:19 UTC
The ebuild for bpftool sets BPFTOOL_VERSION="${MY_PV}" which results in:

$bpftool --version
bpftool v6.9.2
using libbpf v1.4
features: llvm, skeletons

whereas a manually built bpftool from the 6.10 kernel tree says:

./bpftool --version
bpftool v7.5.0
using libbpf v1.5
features: llvm, skeletons

Apparently this causes confusion when other tools want to inspect the capabilities of bpftool, e.g. as in https://github.com/gentoo/gentoo/pull/37572


Reproducible: Always

Steps to Reproduce:
1. build bpftool via ebuild


Actual Results:  
Version mismatch compared to when manually built.

Expected Results:  
Consistent version information.
Comment 1 Holger Hoffstätte 2024-07-17 11:12:14 UTC
Upstream's motivation for having a version number != kernel version is described in:

https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/tools/bpf/bpftool?id=9910a74d6ebf6e35d7adfae665022674fb90ea78

Apparently this happened *after* bpftool was added to the tree and when it started to set BPFTOOL_VERSION="${MY_PV}" from the beginning.
Comment 2 Holger Hoffstätte 2024-07-17 11:25:45 UTC
It seems to me the easiest way to fix this is to remove the explicit BPFTOOL_VERSION and just use whatever version bpftool itself wants to advertise based on the built-in-tandem libbpf version, which is statically linked.

I'll prepare a PR.
Comment 3 Holger Hoffstätte 2024-07-17 11:34:59 UTC
(In reply to Holger Hoffstätte from comment #2)
> It seems to me the easiest way to fix this is to remove the explicit
> BPFTOOL_VERSION and just use whatever version bpftool itself wants to
> advertise based on the built-in-tandem libbpf version, which is statically
> linked.

There does not seem to be a good way to indicate changes to bpftool itself, since those are not represented in the version number. Open to suggestions how to represent these.
Comment 4 Larry the Git Cow gentoo-dev 2024-07-19 19:49:15 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=650e68c2211c27d4d9a12b1e750b6ceb2599220a

commit 650e68c2211c27d4d9a12b1e750b6ceb2599220a
Author:     Holger Hoffstätte <holger@applied-asynchrony.com>
AuthorDate: 2024-07-17 12:46:19 +0000
Commit:     Jakov Smolić <jsmolic@gentoo.org>
CommitDate: 2024-07-19 19:48:29 +0000

    dev-util/bpftool: add 7.5.0 from kernel 6.10, no longer set explicit version
    
    This avoids confusion wrt. bpftool's advertised capabilities via
    its --version output. The ebuild will no longer follow the kernel
    version.
    
    Closes: https://bugs.gentoo.org/936209
    Signed-off-by: Holger Hoffstätte <holger@applied-asynchrony.com>
    Closes: https://github.com/gentoo/gentoo/pull/37591
    Signed-off-by: Jakov Smolić <jsmolic@gentoo.org>

 dev-util/bpftool/Manifest             |   2 +
 dev-util/bpftool/bpftool-7.5.0.ebuild | 124 ++++++++++++++++++++++++++++++++++
 2 files changed, 126 insertions(+)