Build-tools fails if changes are made to BPF selftests
For MR !2317, the c9s_64k_merge_request pipeline fails at the
build-tools stage. It fails to build bpf selftests because of the
missing vmlinux.h which is expected to be found in $DevelDir
(${RPM_BUILD_ROOT}/usr/src/kernels/%{KVERREL}${Variant:++${Variant}}
)
AFAICT, this is because the kernel built was of the 64k variant, but the pipeline is looking for the plain variant. From build-tools.yml:
# Extract vmlinux.h from the kernel-devel, if available. This is needed to compile
# bpftool and selftests.
kernel_version="$(kcidb_checkout get misc/kernel_version)"
vmlinux_path="/usr/src/kernels/${kernel_version}.${ARCH_CONFIG}"
cd /
# Run the cpio command from the root directory so it's placed into the right spot right away
# because we can't get rid of the leading "./"
rpm2cpio "${ARTIFACTS_DIR}/${package_name}-devel-${kernel_version}.${ARCH_CONFIG}.rpm" \
| cpio -idmv ".${vmlinux_path}/vmlinux.h"
cd "${CI_PROJECT_DIR}"
Please note that while the kernel is build with the --with arm64_64k
option, but the tools are build with --without arm64_64k
. So if I'm
not mistaken, the vmlinux should be copied from the 64k variant of
the kernel-devel package, but copied to the plain variant path.
Also please note that the bpf samples also fails to build on all MRs because of the missing vmlinux.h, but this doesn't prevent the build to finish:
00:04:43 samples/bpf/Makefile:362: *** Cannot find a vmlinux for VMLINUX_BTF at any of " /tmp/rpmbuild/BUILD/kernel-5.14.0-292.2254_820097417.el9/linux-5.14.0-292.2254_820097417.el9.aarch64/vmlinux", build the kernel or set VMLINUX_BTF or VMLINUX_H variable. Stop.
00:04:43 make[1]: *** Waiting for unfinished jobs....
00:04:43 make: *** [Makefile:1922: samples/bpf] Error 2
Thanks, Jerome