Skip to content

Move libc from hyperlight-guest-bin to hyperlight-libc#1437

Merged
jprendes merged 10 commits intohyperlight-dev:mainfrom
jprendes:libc-crate
May 6, 2026
Merged

Move libc from hyperlight-guest-bin to hyperlight-libc#1437
jprendes merged 10 commits intohyperlight-dev:mainfrom
jprendes:libc-crate

Conversation

@jprendes
Copy link
Copy Markdown
Contributor

@jprendes jprendes commented May 5, 2026

Fixes #1398
Requires a new release of cargo-hyperlight that includes hyperlight-dev/cargo-hyperlight#50

Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
@jprendes jprendes added the kind/refactor For PRs that restructure or remove code without adding new functionality. label May 5, 2026
ludfjig
ludfjig previously approved these changes May 5, 2026
@ludfjig ludfjig requested a review from Copilot May 5, 2026 21:19
Comment thread src/hyperlight_libc/.cargo/config.toml Outdated
Copy link
Copy Markdown
Contributor

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

Note

Copilot was unable to run its full agentic suite in this review.

Moves the picolibc/libc integration out of hyperlight-guest-bin into a new hyperlight-libc crate, updating repository references accordingly.

Changes:

  • Adds a new hyperlight-libc workspace crate intended to provide picolibc + generated Rust bindings.
  • Updates hyperlight-guest-bin to depend on and re-export hyperlight-libc behind the libc feature.
  • Updates docs, scripts, and submodule paths to reference src/hyperlight_libc/third_party/picolibc.

Reviewed changes

Copilot reviewed 13 out of 21 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/tests/c_guests/c_simpleguest/main.c Updates comment to reflect the new picolibc location.
src/hyperlight_libc/src/lib.rs Introduces the new hyperlight-libc crate API surface (bindings include).
src/hyperlight_libc/Cargo.toml Defines the new crate and its build dependencies for compiling/binding generation.
src/hyperlight_libc/.cargo/config.toml Sets a default target for building the new crate.
src/hyperlight_guest_bin/src/libc.rs Refactors guest libc stubs to consume types/constants from generated bindings.
src/hyperlight_guest_bin/src/lib.rs Switches guest-bin to re-export hyperlight-libc and renames the local module.
src/hyperlight_guest_bin/build.rs Modifies build logic to build libc and generate bindings (currently still located in guest-bin).
src/hyperlight_guest_bin/Cargo.toml Removes links and wires the libc feature to depend on hyperlight-libc.
docs/picolibc.md Updates documentation paths to the new picolibc location.
c.just Updates C include paths to point at the new picolibc/include locations.
NOTICE.txt Updates license notice path to the new picolibc submodule location.
Cargo.toml Adds hyperlight-libc to the workspace and workspace dependencies.
.gitmodules Moves the picolibc submodule path from guest-bin to hyperlight-libc.

Comment thread src/hyperlight_guest_bin/src/lib.rs
Comment thread src/hyperlight_guest_bin/Cargo.toml Outdated
Comment thread src/hyperlight_libc/src/lib.rs
Comment thread src/hyperlight_libc/src/lib.rs
Comment thread src/hyperlight_libc/Cargo.toml
Comment thread src/hyperlight_libc/.cargo/config.toml Outdated
jprendes added 2 commits May 6, 2026 09:30
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
andreiltd
andreiltd previously approved these changes May 6, 2026
Copy link
Copy Markdown
Member

@andreiltd andreiltd left a comment

Choose a reason for hiding this comment

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

I think this is great! One thing that would be nice is if we had README file in the new crate that documents what system interface or stubs the embedder needs to implement with the reference to the implementation in the guest_bin.

I think this is partially described in the picolibc.md file as well.

The picolibc documents it here: https://github.com/hyperlight-dev/picolibc-bsd/blob/main/doc/os.md

Comment thread docs/picolibc.md Outdated
jprendes added 4 commits May 6, 2026 11:14
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
jprendes added 2 commits May 6, 2026 11:17
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
Signed-off-by: Jorge Prendes <jorge.prendes@gmail.com>
@jprendes jprendes merged commit 58fcbef into hyperlight-dev:main May 6, 2026
40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/refactor For PRs that restructure or remove code without adding new functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider exposing the guest libc bindings as a rust crate or module

4 participants