Bug 2310159 - Review Request: bpftool - Management of eBPF programs and maps
Summary: Review Request: bpftool - Management of eBPF programs and maps
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Neal Gompa
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-09-05 08:50 UTC by Viktor Malik
Modified: 2024-11-27 12:57 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-11-27 12:57:30 UTC
Type: ---
Embargoed:
ngompa13: fedora-review+


Attachments (Terms of Use)

Description Viktor Malik 2024-09-05 08:50:03 UTC
Spec URL: https://vmalik.fedorapeople.org/bpftool.spec
SRPM URL: https://vmalik.fedorapeople.org/bpftool-7.4.0-1.fc42.src.rpm
Description: This package contains the bpftool, which allows inspection and simple manipulation of eBPF programs and maps.
Fedora Account System Username: vmalik

bpftool is not a new package, it is currently built as a part of kernel RPM build (because its source files are a part of the kernel source tree). This is a request to move it to a separate package which will be built from the official GitHub mirror [1].

There are two main reasons for this change:
1. bpftool version is independent of the kernel and having it in the kernel spec causes all kinds of problems,
2. bpftool is loosely coupled to the libbpf library which is also packaged separately [2].

This change is accompanied by removing bpftool package build from kernel specfile [3].

[1] https://github.com/libbpf/bpftool
[2] https://packages.fedoraproject.org/pkgs/libbpf/libbpf/
[3] https://gitlab.com/cki-project/kernel-ark/-/merge_requests/3338

Comment 1 Neal Gompa 2024-09-09 21:45:27 UTC
Taking this review.

Comment 2 Viktor Malik 2024-11-20 13:46:21 UTC
Hi @ngompa13, any update on this? Thanks!

Comment 3 Neal Gompa 2024-11-20 17:29:00 UTC
Initial review notes:

> BuildRequires:  gcc make
> BuildRequires:  binutils-devel elfutils-libelf-devel libcap-devel llvm-devel clang
> BuildRequires:  python3-docutils
> BuildRequires:  kernel-devel

Can you please reformulate this so it's one per line? That way it's nicer on diffs and such.

> %make_install -C src/ prefix=%{_prefix} bash_compdir=%{_sysconfdir}/bash_completion.d/ mandir=%{_mandir} doc-install

"bash_compdir=" should be set to "%{bash_completions_dir}" (like so: "bash_compdir=%{bash_completions_dir}")

> %{_sysconfdir}/bash_completion.d/bpftool

This needs updating to "%{bash_completions_dir}/bpftool"

> %{_mandir}/man8/bpftool-cgroup.8.gz
> %{_mandir}/man8/bpftool-gen.8.gz
> %{_mandir}/man8/bpftool-iter.8.gz
> %{_mandir}/man8/bpftool-link.8.gz
> %{_mandir}/man8/bpftool-map.8.gz
> %{_mandir}/man8/bpftool-prog.8.gz
> %{_mandir}/man8/bpftool-perf.8.gz
> %{_mandir}/man8/bpftool.8.gz
> %{_mandir}/man8/bpftool-net.8.gz
> %{_mandir}/man8/bpftool-feature.8.gz
> %{_mandir}/man8/bpftool-btf.8.gz
> %{_mandir}/man8/bpftool-struct_ops.8.gz

This should be simplified to "%{_mandir}/man8/bpftool*.8*".

Comment 4 Viktor Malik 2024-11-21 07:45:41 UTC
Thanks for the review! I updated the specfile.

In the meantime, there was also a new bpftool release (7.5.0) so I updated to it which allowed to drop the manual patch.

Spec URL: https://vmalik.fedorapeople.org/bpftool.spec
SRPM URL: https://vmalik.fedorapeople.org/bpftool-7.5.0-1.fc42.src.rpm

Comment 5 Neal Gompa 2024-11-21 14:52:23 UTC
Package Review
==============

Legend:
[x] = Pass, [!] = Fail, [-] = Not applicable, [?] = Not evaluated



===== MUST items =====

C/C++:
[x]: Package does not contain kernel modules.
[x]: If your application is a C or C++ application you must list a
     BuildRequires against gcc, gcc-c++ or clang.
[x]: Package does not contain any libtool archives (.la)
[x]: Package contains no static executables.
[x]: Rpath absent or only used for internal libs.

Generic:
[x]: Package is licensed with an open-source compatible license and meets
     other legal requirements as defined in the legal section of Packaging
     Guidelines.
[x]: If (and only if) the source package includes the text of the
     license(s) in its own file, then that file, containing the text of the
     license(s) for the package is included in %license.
[!]: License field in the package spec file matches the actual license.
     Note: Checking patched sources after %prep for licenses. Licenses
     found: "Unknown or generated", "*No copyright* BSD 2-Clause License",
     "GNU General Public License, Version 2", "*No copyright* GNU General
     Public License, Version 2", "BSD 2-Clause License", "GNU Lesser
     General Public License, Version 2.1", "*No copyright* Creative Commons
     Attribution 4.0", "*No copyright* GNU Lesser General Public License,
     Version 2.1". 197 files have unknown license. Detailed output of
     licensecheck in /home/ngompa/2310159-bpftool/licensecheck.txt
[!]: If the package is under multiple licenses, the licensing breakdown
     must be documented in the spec.
[x]: %build honors applicable compiler flags or justifies otherwise.
[x]: Package contains no bundled libraries without FPC exception.
[x]: Changelog in prescribed format.
[x]: Sources contain only permissible code or content.
[-]: Package contains desktop file if it is a GUI application.
[-]: Development files must be in a -devel package
[x]: Package uses nothing in %doc for runtime.
[x]: Package consistently uses macros (instead of hard-coded directory
     names).
[x]: Package is named according to the Package Naming Guidelines.
[x]: Package does not generate any conflict.
[x]: Package obeys FHS, except libexecdir and /usr/target.
[-]: If the package is a rename of another package, proper Obsoletes and
     Provides are present.
[x]: Requires correct, justified where necessary.
[x]: Spec file is legible and written in American English.
[-]: Package contains systemd file(s) if in need.
[x]: Useful -debuginfo package or justification otherwise.
[x]: Package is not known to require an ExcludeArch tag.
[x]: Package complies to the Packaging Guidelines
[x]: Package successfully compiles and builds into binary rpms on at least
     one supported primary architecture.
[x]: Package installs properly.
[x]: Rpmlint is run on all rpms the build produces.
     Note: There are rpmlint messages (see attachment).
[x]: The License field must be a valid SPDX expression.
[x]: Package requires other packages for directories it uses.
[x]: Package must own all directories that it creates.
[x]: Package does not own files or directories owned by other packages.
[x]: Package uses either %{buildroot} or $RPM_BUILD_ROOT
[x]: Package does not run rm -rf %{buildroot} (or $RPM_BUILD_ROOT) at the
     beginning of %install.
[x]: Macros in Summary, %description expandable at SRPM build time.
[x]: Dist tag is present.
[x]: Package does not contain duplicates in %files.
[x]: Permissions on files are set properly.
[x]: Package must not depend on deprecated() packages.
[x]: Package use %makeinstall only when make install DESTDIR=... doesn't
     work.
[x]: Package is named using only allowed ASCII characters.
[x]: Package does not use a name that already exists.
[x]: Package is not relocatable.
[x]: Sources used to build the package match the upstream source, as
     provided in the spec URL.
[x]: Spec file name must match the spec package %{name}, in the format
     %{name}.spec.
[x]: File names are valid UTF-8.
[x]: Large documentation must go in a -doc subpackage. Large could be size
     (~1MB) or number of files.
     Note: Documentation size is 0 bytes in 0 files.
[x]: Packages must not store files under /srv, /opt or /usr/local

===== SHOULD items =====

Generic:
[x]: If the source package does not include license text(s) as a separate
     file from upstream, the packager SHOULD query upstream to include it.
[x]: Final provides and requires are sane (see attachments).
[x]: Package functions as described.
[x]: Latest version is packaged.
[x]: Package does not include license text files separate from upstream.
[-]: Sources are verified with gpgverify first in %prep if upstream
     publishes signatures.
     Note: gpgverify is not used.
[x]: Package should compile and build into binary rpms on all supported
     architectures.
[!]: %check is present and all tests pass.
[x]: Packages should try to preserve timestamps of original installed
     files.
[x]: Spec use %global instead of %define unless justified.
     Note: %define requiring justification: %define kernel_version %(rpm -q
     --qf "%%{VERSION}-%%{RELEASE}.%%{ARCH}" kernel-devel)
[x]: Reviewer should test that the package builds in mock.
[x]: Buildroot is not present
[x]: Package has no %clean section with rm -rf %{buildroot} (or
     $RPM_BUILD_ROOT)
[x]: No file requires outside of /etc, /bin, /sbin, /usr/bin, /usr/sbin.
[x]: Packager, Vendor, PreReq, Copyright tags should not be in spec file
[x]: Sources can be downloaded from URI in Source: tag
[x]: SourceX is a working URL.

===== EXTRA items =====

Generic:
[x]: Rpmlint is run on debuginfo package(s).
     Note: There are rpmlint messages (see attachment).
[x]: Rpmlint is run on all installed packages.
     Note: There are rpmlint messages (see attachment).
[x]: Large data in /usr/share should live in a noarch subpackage if package
     is arched.
[x]: Spec file according to URL is the same as in SRPM.


Rpmlint
-------
Checking: bpftool-7.5.0-1.fc42.x86_64.rpm
          bpftool-7.5.0-1.fc42.src.rpm
============================ rpmlint session starts ============================
rpmlint: 2.5.0
configuration:
    /usr/lib/python3.13/site-packages/rpmlint/configdefaults.toml
    /etc/xdg/rpmlint/fedora-legacy-licenses.toml
    /etc/xdg/rpmlint/fedora-spdx-licenses.toml
    /etc/xdg/rpmlint/fedora.toml
    /etc/xdg/rpmlint/scoring.toml
    /etc/xdg/rpmlint/users-groups.toml
    /etc/xdg/rpmlint/warn-on-functions.toml
rpmlintrc: [PosixPath('/tmp/tmpe10rby6w')]
checks: 32, packages: 2

bpftool.src: E: spelling-error ('eBPF', 'Summary(en_US) eBPF -> Feb')
bpftool.src: E: spelling-error ('eBPF', '%description -l en_US eBPF -> Feb')
bpftool.x86_64: E: spelling-error ('eBPF', 'Summary(en_US) eBPF -> Feb')
bpftool.x86_64: E: spelling-error ('eBPF', '%description -l en_US eBPF -> Feb')
bpftool.x86_64: W: incoherent-version-in-changelog 7.4.0-1 ['7.5.0-1.fc42', '7.5.0-1']
 2 packages and 0 specfiles checked; 4 errors, 1 warnings, 7 filtered, 4 badness; has taken 0.2 s 




Rpmlint (debuginfo)
-------------------
Cannot parse rpmlint output:



Rpmlint (installed packages)
----------------------------
Cannot parse rpmlint output:


Source checksums
----------------
https://github.com/libbpf/bpftool/releases/download/v7.5.0/bpftool-libbpf-v7.5.0-sources.tar.gz :
  CHECKSUM(SHA256) this package     : 1468d3fb8c70698359a6593d8828f0e0a56b72244cb8632c6e1947e11b3520b9
  CHECKSUM(SHA256) upstream package : 1468d3fb8c70698359a6593d8828f0e0a56b72244cb8632c6e1947e11b3520b9


Requires
--------
bpftool (rpmlib, GLIBC filtered):
    libLLVM.so.19.1()(64bit)
    libLLVM.so.19.1(LLVM_19.1)(64bit)
    libc.so.6()(64bit)
    libcap.so.2()(64bit)
    libelf.so.1()(64bit)
    libelf.so.1(ELFUTILS_1.0)(64bit)
    libelf.so.1(ELFUTILS_1.3)(64bit)
    libelf.so.1(ELFUTILS_1.5)(64bit)
    libelf.so.1(ELFUTILS_1.6)(64bit)
    libz.so.1()(64bit)
    libz.so.1(ZLIB_1.2.3.3)(64bit)
    rtld(GNU_HASH)



Provides
--------
bpftool:
    bpftool
    bpftool(x86-64)



Generated by fedora-review 0.10.0 (e79b66b) last change: 2023-07-24
Command line :/usr/bin/fedora-review -b 2310159 -m fedora-rawhide-x86_64
Buildroot used: fedora-rawhide-x86_64
Active plugins: Shell-api, Generic, C/C++
Disabled plugins: SugarActivity, Java, Perl, Haskell, fonts, R, PHP, Python, Ocaml
Disabled flags: EXARCH, EPEL6, EPEL7, DISTTAG, BATCH

Comment 6 Neal Gompa 2024-11-21 14:56:42 UTC
(In reply to Neal Gompa from comment #5)
>
> [!]: License field in the package spec file matches the actual license.
>      Note: Checking patched sources after %prep for licenses. Licenses
>      found: "Unknown or generated", "*No copyright* BSD 2-Clause License",
>      "GNU General Public License, Version 2", "*No copyright* GNU General
>      Public License, Version 2", "BSD 2-Clause License", "GNU Lesser
>      General Public License, Version 2.1", "*No copyright* Creative Commons
>      Attribution 4.0", "*No copyright* GNU Lesser General Public License,
>      Version 2.1". 197 files have unknown license. Detailed output of
>      licensecheck in /home/ngompa/2310159-bpftool/licensecheck.txt
> [!]: If the package is under multiple licenses, the licensing breakdown
>      must be documented in the spec.

On second review, it looks like the LGPL reference is from parsing documentation text. So this is fine.

> [!]: %check is present and all tests pass.

Are there tests to run in the %check section? If so, can we run them?

> bpftool.x86_64: W: incoherent-version-in-changelog 7.4.0-1 ['7.5.0-1.fc42',
> '7.5.0-1']

Changelog entry needs the version to be fixed to 7.5.0-1 instead.

Comment 7 Neal Gompa 2024-11-23 12:07:22 UTC
(In reply to Neal Gompa from comment #6)
> (In reply to Neal Gompa from comment #5)
> >
> > [!]: %check is present and all tests pass.
> 
> Are there tests to run in the %check section? If so, can we run them?
> 

Looks like the answer to this is no. At this point, I guess this package is ready to go...

> > bpftool.x86_64: W: incoherent-version-in-changelog 7.4.0-1 ['7.5.0-1.fc42',
> > '7.5.0-1']
> 
> Changelog entry needs the version to be fixed to 7.5.0-1 instead.

Please fix this on import.

Now...

PACKAGE APPROVED.

Comment 8 Viktor Malik 2024-11-25 08:53:42 UTC
(In reply to Neal Gompa from comment #7)
> (In reply to Neal Gompa from comment #6)
> > (In reply to Neal Gompa from comment #5)
> > >
> > > [!]: %check is present and all tests pass.
> > 
> > Are there tests to run in the %check section? If so, can we run them?
> > 
> 
> Looks like the answer to this is no. At this point, I guess this package is
> ready to go...

That's correct, there are no tests available at the moment which we could use.

> 
> > > bpftool.x86_64: W: incoherent-version-in-changelog 7.4.0-1 ['7.5.0-1.fc42',
> > > '7.5.0-1']
> > 
> > Changelog entry needs the version to be fixed to 7.5.0-1 instead.
> 
> Please fix this on import.

Will do.

> 
> Now...
> 
> PACKAGE APPROVED.

Thank you!

Comment 9 Fedora Admin user for bugzilla script actions 2024-11-25 09:22:35 UTC
The Pagure repository was created at https://src.fedoraproject.org/rpms/bpftool

Comment 10 Viktor Malik 2024-11-27 12:57:30 UTC
The package is now published:

https://packages.fedoraproject.org/pkgs/bpftool/bpftool/


Note You need to log in before you can comment on or make changes to this bug.