mirror of
https://github.com/varun-r-mallya/Python-BPF.git
synced 2026-12-06 01:48:35 +00:00
Runs make test on every push to master and every pull_request. Kernel verifier tests need passwordless sudo and a kernel with BTF/BPF enabled, which isn't guaranteed on every runner, so the workflow probes for working sudo first and only attempts them if it's there. Ubuntu's default apt packages need three adjustments to actually run this: bpftool is a virtual package provided by linux-tools-generic whose binary needs to be found and put on PATH manually; ctypeslib2's clang bindings default to the latest PyPI release, which doesn't match Ubuntu's libclang-16, so pin to clang==16.0.6 (older bindings stay forward-compatible with a newer system libclang); and llvmlite>=0.49 emits IR using the 'captures(none)' attribute spelling, matching the LLVM 22.1.0 it bundles internally, which Ubuntu's default LLVM 18 (and even 19) can't parse - install a matching-generation LLVM 22 from apt.llvm.org instead of the distro default. Also add ctypeslib2 and a pinned clang to the test extra: make test now regenerates vmlinux.py via tools/vmlinux-gen.py, which needs clang2py, and that dependency was previously only installed ad hoc in local dev venvs.