Skip to content

Fix make test: regenerate vmlinux.py fixture and stop mis-collecting it - #95

Merged
varun-r-mallya merged 2 commits into
masterfrom
vmlinux-gen-fix
Aug 30, 2026
Merged

Fix make test: regenerate vmlinux.py fixture and stop mis-collecting it#95
varun-r-mallya merged 2 commits into
masterfrom
vmlinux-gen-fix

Conversation

@varun-r-mallya

Copy link
Copy Markdown
Member

Summary

  • tools/vmlinux-gen.py: disambiguate clang2py's generic anonymous-field names (_0, _1, ...) per struct/union, so promoted _anonymous_ members from different structs never collide on the same key when assigned to a shared ctypes type - this was crashing import vmlinux with AttributeError: type object 'c_ulong' has no attribute '_fields_' for some kernels.
  • Makefile: test/test-cov/test-verifier now depend on a vmlinux target that regenerates a single master vmlinux.py from the running kernel's BTF and symlinks it into every directory under tests/, replacing the eight stale, duplicated vmlinux.py fixtures that used to be committed there (they were untracked/gitignored already, just deleted from disk).
  • tests/framework/collector.py: skip the vmlinux.py filename when collecting BPF test cases - it's a fixture module the test files import, not a test program, and was being mis-collected and compiled as a bogus test case (the root cause of most of make test's prior failures).
  • pythonbpf/functions/functions_pass.py: llvmlite >=0.49 renamed the nocapture argument attribute to captures(none).

Test plan

Prevents ctypes _fields_ assignment collisions when multiple anonymous
struct/union members across different structs get the same generic
'_N' name from clang2py.
- make test/test-cov/test-verifier now depend on a 'vmlinux' target that
  regenerates vmlinux.py from the running kernel's BTF and symlinks it
  into every directory under tests/, replacing the stale, duplicated
  vmlinux.py fixtures that used to be committed there.
- collector.py now skips the 'vmlinux.py' filename when collecting BPF
  test cases, since it's a fixture module, not a test program - it was
  previously being mis-collected and compiled as a bogus test.
- functions_pass.py: llvmlite >=0.49 renamed the 'nocapture' argument
  attribute to 'captures(none)'.
@varun-r-mallya
varun-r-mallya merged commit 3c69ec3 into master Aug 30, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant