bpfcc-tools autotest failure when multiple linux-tools-<version> packages are installed

Bug #2061727 reported by Andrea Righi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
bpfcc (Ubuntu)
Fix Released
Undecided
Unassigned
Noble
Fix Released
Undecided
Unassigned

Bug Description

[Impact]

The autopkgtest for bpfcc-tools fails with the following error when multiple linux-tools packages (multiple kernels) are installed:

942s /usr/lib/linux-tools-6.8.0-22/bpftool /usr/lib/linux-tools-6.8.0-25/bpftool gen skeleton /tmp/autopkgtest.2W4dxr/build.Uhs/src/libbpf-tools/.output/bashreadline.bpf.o > /tmp/autopkgtest.2W4dxr/build.Uhs/src/libbpf-tools/.output/bashreadline.skel.h
942s Usage: bpftool [OPTIONS] OBJECT { COMMAND | help }
942s bpftool batch file FILE
942s bpftool version
942s
942s OBJECT := { prog | map | link | cgroup | perf | net | feature | btf | gen | struct_ops | iter }
942s OPTIONS := { {-j|--json} [{-p|--pretty}] | {-d|--debug} |
942s {-V|--version} }
942s make[2]: *** [Makefile:192: /tmp/autopkgtest.2W4dxr/build.Uhs/src/libbpf-tools/.output/bashreadline.skel.h] Error 255
942s make[2]: *** Deleting file '/tmp/autopkgtest.2W4dxr/build.Uhs/src/libbpf-tools/.output/bashreadline.skel.h'
942s make[2]: Leaving directory '/tmp/autopkgtest.2W4dxr/build.Uhs/src/libbpf-tools'
942s make[1]: *** [debian/rules:44: override_dh_auto_install] Error 2
942s make[1]: Leaving directory '/tmp/autopkgtest.2W4dxr/build.Uhs/src'

The reason is that in debian/rules we evaluate BPFTOOL assuming that only one kernel is installed, but we may have multiple kernels (therefore multiple linux-tools-<version>) installed.

[Test case]

Install multiple linux-tools-<version> and run the bpfcc-tools autopkgtest.

[Fix]

Evaluate BPFTOOL in debian/rules only taking the last bpftool listed in /usr/lib/linux-tools-*/bpftool.

[Regression potential]

This change affects only the autopkgtest and it allows to run the test correctly also when multiple kernels are installed, no regresssion is expected.

ProblemType: Bug
DistroRelease: Ubuntu 24.04
Package: bpfcc-tools 0.29.1+ds-1ubuntu6
ProcVersionSignature: User Name 6.8.0-22.22-generic 6.8.1
Uname: Linux 6.8.0-22-generic x86_64
ApportVersion: 2.28.0-0ubuntu1
Architecture: amd64
CasperMD5CheckResult: unknown
CloudArchitecture: x86_64
CloudBuildName: server
CloudID: nocloud
CloudName: unknown
CloudPlatform: nocloud
CloudSerial: 20240413
CloudSubPlatform: config-disk (/dev/vdb)
Date: Tue Apr 16 05:38:06 2024
PackageArchitecture: all
ProcEnviron:
 LANG=C.UTF-8
 PATH=(custom, no user)
 SHELL=/bin/bash
 TERM=xterm-256color
 XDG_RUNTIME_DIR=<set>
SourcePackage: bpfcc
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Andrea Righi (arighi) wrote :
Revision history for this message
Andrea Righi (arighi) wrote :

debdiff in attach allows to run the autopkgtest correctly also with multiple kernels installed.

Revision history for this message
Andrea Righi (arighi) wrote :

Test plan:

 - without this change:

/usr/lib/linux-tools-6.8.0-22/bpftool /usr/lib/linux-tools-6.8.0-25/bpftool gen skeleton /tmp/bpfcc-0.29.1+ds/libbpf-tools/.output/bashreadline.bpf.o > /tmp/bpfcc-0.29.1+ds/libbpf-tools/.output/bashreadline.skel.h
Usage: bpftool [OPTIONS] OBJECT { COMMAND | help }
       bpftool batch file FILE
       bpftool version

       OBJECT := { prog | map | link | cgroup | perf | net | feature | btf | gen | struct_ops | iter }
       OPTIONS := { {-j|--json} [{-p|--pretty}] | {-d|--debug} |
                    {-V|--version} }
make[2]: *** [Makefile:192: /tmp/bpfcc-0.29.1+ds/libbpf-tools/.output/bashreadline.skel.h] Error 255
make[2]: *** Deleting file '/tmp/bpfcc-0.29.1+ds/libbpf-tools/.output/bashreadline.skel.h'
make[2]: Leaving directory '/tmp/bpfcc-0.29.1+ds/libbpf-tools'

 - with this change applied:

100% tests passed, 0 tests failed out of 37

Total Test time (real) = 83.22 sec
make: Leaving directory '/tmp/autopkgtest.MOnsj0/tree/obj-x86_64-linux-gnu'
autopkgtest [06:43:12]: test command1: -----------------------]
autopkgtest [06:43:12]: test command1: - - - - - - - - - - results - - - - - - - - - -
command1 PASS
autopkgtest [06:43:12]: @@@@@@@@@@@@@@@@@@@@ summary
command1 PASS

tags: added: patch
Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading bpfcc_0.29.1+ds-1ubuntu7.dsc: done.
  Uploading bpfcc_0.29.1+ds-1ubuntu7.debian.tar.xz: done.
  Uploading bpfcc_0.29.1+ds-1ubuntu7_source.buildinfo: done.
  Uploading bpfcc_0.29.1+ds-1ubuntu7_source.changes: done.
Successfully uploaded packages.

Timo Aaltonen (tjaalton)
Changed in bpfcc (Ubuntu Noble):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bpfcc - 0.29.1+ds-1ubuntu7

---------------
bpfcc (0.29.1+ds-1ubuntu7) noble; urgency=medium

  * d/rules:
    - allow to run autopkgtest with multiple kernels installed (LP: #2061727)

 -- Andrea Righi <email address hidden> Tue, 16 Apr 2024 05:52:23 +0000

Changed in bpfcc (Ubuntu Noble):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.