Skip to content

fix: remove vmlinux crate dep#28

Merged
domcyrus merged 5 commits intomainfrom
fix-remove-vmlinux-crate
Oct 2, 2025
Merged

fix: remove vmlinux crate dep#28
domcyrus merged 5 commits intomainfrom
fix-remove-vmlinux-crate

Conversation

@domcyrus
Copy link
Owner

@domcyrus domcyrus commented Oct 1, 2025

No description provided.

Instead of using a git dependency (not allowed on crates.io), download the
architecture-specific vmlinux.h header at build time from the libbpf/vmlinux.h
repository. This approach:

- Removes git dependency from Cargo.toml (crates.io compatible)
- Downloads correct arch-specific header (x86, aarch64, arm)
- Caches downloaded headers in OUT_DIR (reuses between builds)
- Works with cargo install
- Supports cross-compilation for all architectures

The vmlinux.h file (~3-4MB per arch) is downloaded once per architecture
and cached, so subsequent builds are fast.
http_req depends on native-tls/openssl-sys which requires OpenSSL to be
installed in the cross-compilation containers. Switch to ureq with the
rustls backend which has no system dependencies and works in all
cross-compilation environments.
The vmlinux.h files in the libbpf/vmlinux.h repository are symlinks to
versioned files (e.g. vmlinux_6.14.h). When downloading via
raw.githubusercontent.com, we get the symlink content (just the target
filename) instead of the actual file.

Solution: Download the symlink first to get the target filename, then
download the actual versioned file. This ensures we get the full header
content instead of just the symlink text.
@domcyrus domcyrus merged commit e22c95f into main Oct 2, 2025
1 check passed
@domcyrus domcyrus deleted the fix-remove-vmlinux-crate branch October 2, 2025 06:49
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