Skip to content

Commit 10884f3

Browse files
committed
CI: install llvm-strip and verify bpf2go output is in sync
bpf2go shells out to llvm-strip to drop DWARF from the embedded .o; ubuntu-latest has clang but not llvm-strip on PATH. Install the llvm package alongside libbpf-dev / linux-libc-dev. Also add a git diff --exit-code guard after make probes-bpf so PRs that edit probe.bpf.c without committing the regenerated probe_bpfel.go fail Test instead of merging out of sync.
1 parent 43b80ef commit 10884f3

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/test.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,21 @@ jobs:
2424
# `probes/probe_bpfel.go` (bpf2go-generated) has `//go:embed
2525
# probe_bpfel.o`, so the package fails to compile without the .o on
2626
# disk. Regenerate it before tests; clang ships on ubuntu-latest, we
27-
# just need the libbpf + kernel UAPI headers.
27+
# need libbpf + kernel UAPI headers, plus `llvm` for the `llvm-strip`
28+
# that bpf2go runs to strip DWARF from the embedded .o.
2829
- name: Install BPF build dependencies
2930
run: |
3031
sudo apt-get update
31-
sudo apt-get install -y --no-install-recommends libbpf-dev linux-libc-dev
32+
sudo apt-get install -y --no-install-recommends libbpf-dev linux-libc-dev llvm
3233
3334
- name: Generate probes BPF object
3435
run: make probes-bpf
3536

37+
# Catch "edited probe.bpf.c but forgot to regenerate / commit
38+
# probe_bpfel.go" before merge — bpf2go output is deterministic, so
39+
# any drift surfaces here.
40+
- name: Verify generated bpf2go output is in sync
41+
run: git diff --exit-code probes/probe_bpfel.go
42+
3643
- name: Run Tests
3744
run: go test -race -v ./...

0 commit comments

Comments
 (0)