Support for hyperlight-libc#50
Merged
jprendes merged 1 commit intohyperlight-dev:mainfrom May 5, 2026
Merged
Conversation
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
ludfjig
approved these changes
May 5, 2026
There was a problem hiding this comment.
Pull request overview
Adds support for sourcing libc headers from the new hyperlight-libc package (falling back to hyperlight-guest-bin) when constructing the sysroot include directory used by cargo-hyperlight.
Changes:
- Introduce
find_libc_dir()to locate eitherhyperlight-libcorhyperlight-guest-binviacargo metadata. - Update toolchain preparation to copy headers from the discovered libc directory.
- Bump crate version to
0.1.10.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/toolchain.rs |
Adds libc package discovery and adjusts header-copy logic to source includes from the located package directory. |
Cargo.toml |
Bumps cargo-hyperlight version to 0.1.10. |
Cargo.lock |
Updates locked version entry for cargo-hyperlight to 0.1.10. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
77
to
+83
| // Detect which libc variant is present: picolibc or legacy musl | ||
| let include_dirs: &[&str] = if hyperlight_guest_bin_dir | ||
| .join("third_party/musl/include") | ||
| .is_dir() | ||
| { | ||
| &[ | ||
| "third_party/printf/", | ||
| "third_party/musl/include", | ||
| "third_party/musl/arch/generic", | ||
| "third_party/musl/arch/x86_64", | ||
| "third_party/musl/src/internal", | ||
| ] | ||
| } else { | ||
| &[ | ||
| "third_party/picolibc/libc/include", | ||
| "third_party/picolibc/libc/stdio", | ||
| "include", | ||
| ] | ||
| }; | ||
| let include_dirs: &[&str] = &[ | ||
| // directories for musl | ||
| "third_party/printf/", | ||
| "third_party/musl/include", | ||
| "third_party/musl/arch/generic", | ||
| "third_party/musl/arch/x86_64", |
Comment on lines
+78
to
+89
| let include_dirs: &[&str] = &[ | ||
| // directories for musl | ||
| "third_party/printf/", | ||
| "third_party/musl/include", | ||
| "third_party/musl/arch/generic", | ||
| "third_party/musl/arch/x86_64", | ||
| "third_party/musl/src/internal", | ||
| // directories for picolibc | ||
| "third_party/picolibc/libc/include", | ||
| "third_party/picolibc/libc/stdio", | ||
| "include", | ||
| ]; |
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.