Skip to content

Support for hyperlight-libc#50

Merged
jprendes merged 1 commit intohyperlight-dev:mainfrom
jprendes:hl-libc
May 5, 2026
Merged

Support for hyperlight-libc#50
jprendes merged 1 commit intohyperlight-dev:mainfrom
jprendes:hl-libc

Conversation

@jprendes
Copy link
Copy Markdown
Contributor

@jprendes jprendes commented May 5, 2026

No description provided.

Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
@ludfjig ludfjig requested a review from Copilot May 5, 2026 21:17
@jprendes jprendes merged commit fc7814e into hyperlight-dev:main May 5, 2026
9 checks passed
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 either hyperlight-libc or hyperlight-guest-bin via cargo 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 thread src/toolchain.rs
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 thread src/toolchain.rs
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",
];
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.

3 participants