Skip to content

Maintenance: update libbpf to 1.7.0, fix CI, add Docker build/test#13

Merged
niclashedam merged 6 commits into
masterfrom
chore/maintenance
Jul 12, 2026
Merged

Maintenance: update libbpf to 1.7.0, fix CI, add Docker build/test#13
niclashedam merged 6 commits into
masterfrom
chore/maintenance

Conversation

@niclashedam

Copy link
Copy Markdown
Owner

Housekeeping pass to get the project building and testing again.

  • libbpf submodule bumped v1.2.0 → v1.7.0 (builds with no source changes)
  • CI moved off the retired ubuntu-20.04 runner → ubuntu-24.04, checkout@v2v4
  • Docker build/test environment added — docker run --rm --privileged ebpf-kill-example builds and runs the test with no local toolchain
  • Makefile now emits the BPF object in a single clang step (drops the legacy llc two-step) and finds headers portably across architectures
  • user.c sprintfsnprintf
  • README updated

Verified building and passing make test end-to-end in Docker.

Provide a reproducible container for building and running the example so it
no longer depends on a specific host setup. Verified to build and pass the
test end-to-end under Docker Desktop on both x86_64 and aarch64.

Two fixes were needed to make this work portably:

- src/Makefile: point clang's bpf target at the host multiarch include dir
  ($(uname -m)-linux-gnu) so headers like <asm/types.h> are found. Previously
  this relied on gcc-multilib, which is x86-only and unavailable on arm64.
- test/test.sh: invoke the loader directly instead of via sudo. The script
  already re-execs as root, so the extra sudo only broke root environments
  without sudo installed, such as containers.

Usage:
  docker build -t ebpf-kill-example .
  docker run --rm --privileged ebpf-kill-example

The entrypoint mounts tracefs (requires --privileged) so the kill tracepoint
is reachable at test time.
The ubuntu-20.04 runner was retired by GitHub (April 2025) so CI no longer
runs, and actions/checkout@v2 relies on a deprecated Node runtime. Move to
ubuntu-24.04 (GA; 26.04 is still preview) and actions/checkout@v4.
Bump the vendored libbpf from v1.2.0 to v1.7.0 (latest stable, Mar 2025).
The loader and eBPF program build unchanged against the new API, and the
test passes end-to-end (verified in Docker).

Also add zlib1g-dev to 'make deps', which newer libbpf requires at build
time.
Replace the legacy 'clang -emit-llvm | llc' two-step with a single
'clang -target bpf ... -c -o kern.o' invocation. This is the standard modern
way to build BPF objects, avoids llc version-skew issues, and removes the
intermediate kern.ll artifact. Verified building and passing tests in Docker.
Replace sprintf with snprintf bounded by sizeof(path) so an unusually long
argv[0] cannot overflow the PATH_MAX buffer.
Add a Docker section covering the reproducible build/test environment, note it
as the easiest path on non-Linux hosts and on arm64 (where gcc-multilib is
unavailable), and list zlib1g-dev among the dependencies.
@niclashedam niclashedam added the enhancement New feature or request label Jul 12, 2026
@niclashedam niclashedam merged commit c987aa7 into master Jul 12, 2026
1 check passed
@niclashedam niclashedam deleted the chore/maintenance branch July 13, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant