Conversation
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.
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.
No description provided.