Add CI workflow to run the test suite - #96
Merged
Conversation
varun-r-mallya
force-pushed
the
ci-test-runner
branch
from
August 30, 2026 14:54
6b5b4c8 to
8f709d9
Compare
Runs make test on every push/PR. 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 available. Also add ctypeslib2 to the test extra: make test now regenerates vmlinux.py via tools/vmlinux-gen.py, which needs clang2py.
linux-tools-generic's update-alternatives symlink for bpftool doesn't fire on GitHub-hosted runners, since their kernel version has no matching linux-tools-<version> package.
pip installs the latest 'clang' release by default, whose libclang API surface is newer than Ubuntu 24.04's apt libclang-16, causing a LibclangError about an undefined symbol. Older bindings against a newer libclang stay compatible, so pin the bindings low rather than the system library.
llvmlite>=0.49's ArgumentAttributes only recognizes the LLVM 19+ 'captures(none)' spelling of the renamed 'nocapture' attribute. Ubuntu noble's default llvm/clang packages are LLVM 18, whose llc can't parse that attribute in the emitted .ll text.
Verified on CI: LLVM 19's llc still rejects 'captures(none)' as a
parse error ('expected ) at end of argument list'). llvmlite 0.49
bundles LLVM 22.1.0 internally; match that generation instead.
Branches live in this repo, not forks, so a push to a branch with an open PR fired both push and pull_request for the same commit. push now only fires for master (a post-merge check); pull_request already covers every commit on a feature branch.
varun-r-mallya
force-pushed
the
ci-test-runner
branch
from
August 30, 2026 15:21
264cab5 to
7ea46e5
Compare
varun-r-mallya
added a commit
that referenced
this pull request
Aug 30, 2026
* widen bitfields whose declared width exceeds their base type clang2py can emit a bitfield typed as a smaller ctype than its own declared width (e.g. a 15-bit field typed ctypes.c_ubyte, which only has 8 bits) - ctypes rejects these with 'ValueError: number of bits invalid for bit field'. Surfaced by struct_vmbus_channel_offer_channel on a kernel with Hyper-V support enabled (not present locally, but present on GitHub Actions' Azure-hosted runners). Generalizes the existing c_bool-specific workaround to all integer ctypes, widening to the smallest standard type that fits. * fix ruff-format violation in vmlinux-gen.py * Add CI workflow to run the test suite (#96) * add CI workflow to run the test suite Runs make test on every push/PR. 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 available. Also add ctypeslib2 to the test extra: make test now regenerates vmlinux.py via tools/vmlinux-gen.py, which needs clang2py. * fix CI: bpftool is a virtual package on Ubuntu, install linux-tools instead * fix CI: locate bpftool binary and add it to PATH manually linux-tools-generic's update-alternatives symlink for bpftool doesn't fire on GitHub-hosted runners, since their kernel version has no matching linux-tools-<version> package. * pin clang bindings to 16.0.6 to match Ubuntu's default libclang pip installs the latest 'clang' release by default, whose libclang API surface is newer than Ubuntu 24.04's apt libclang-16, causing a LibclangError about an undefined symbol. Older bindings against a newer libclang stay compatible, so pin the bindings low rather than the system library. * DEBUG: dump struct_vmbus_channel_offer_channel on test failure * remove debug step now that the bitfield issue is fixed * fix CI: install LLVM 19 from apt.llvm.org, Ubuntu's default is too old llvmlite>=0.49's ArgumentAttributes only recognizes the LLVM 19+ 'captures(none)' spelling of the renamed 'nocapture' attribute. Ubuntu noble's default llvm/clang packages are LLVM 18, whose llc can't parse that attribute in the emitted .ll text. * DEBUG: show real llc stderr on failure * fix YAML syntax in debug step * fix CI: install LLVM 22 (matching llvmlite's bundled version), not 19 Verified on CI: LLVM 19's llc still rejects 'captures(none)' as a parse error ('expected ) at end of argument list'). llvmlite 0.49 bundles LLVM 22.1.0 internally; match that generation instead. * remove debug step, LLVM 22 fix confirmed working on CI * avoid running CI twice per push: scope push trigger to master Branches live in this repo, not forks, so a push to a branch with an open PR fired both push and pull_request for the same commit. push now only fires for master (a post-merge check); pull_request already covers every commit on a feature branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add CI and testing.