Skip to content

Add component model example and add test in CI #73

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 24, 2025

Conversation

jsturtevant
Copy link
Contributor

@jsturtevant jsturtevant commented Jun 20, 2025

partially address hyperlight-dev/hyperlight#645

fixes #652
fixes #74

This pull request introduces support for WASI (WebAssembly System Interface) samples in the project. The changes include adding new functionality for compiling and running WASI examples, updating dependencies, and modifying build scripts and documentation to reflect the new features.

Component model example Implementation:

  • New WASI Sample Module: Added a new wasi_samples module with necessary configurations in Cargo.toml, bindings, and implementation for WASI-specific functionality. This includes the example.wit interface defining adder and host functionalities, which are implemented in src/wasi_samples/src/lib.rs. [1] [2] [3]
  • Example Application: Created a new example application (wasi_examples/main.rs) demonstrating the use of WASI bindings and sandboxing. It includes host and guest function implementations for WASI.

Build System Updates:

  • Build Script Enhancements: Updated the Justfile to include commands for building and testing WASI examples (build-rust-wasi-examples, examples-wasi). This ensures proper handling of WASI imports and targets. [1] [2] [3]

Documentation Updates:

  • Prerequisites: Updated the README.md to include installation instructions for wasm-tools and cargo component, which are required for WASI support. [1] [2]

Bug fixes

fixes #74 issue when host function with no return type is invoked by making the return value optional

@jsturtevant jsturtevant added area/testing kind/enhancement New feature or request labels Jun 20, 2025
Copy link

@marosset marosset left a comment

Choose a reason for hiding this comment

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

LGTM except for some nits on naming and installing tools in the various just commands.

@jsturtevant jsturtevant changed the title Add wasi example for verification Add component model example and add test in CI Jun 24, 2025
Copy link

@marosset marosset left a comment

Choose a reason for hiding this comment

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

LGTM - thanks for making the changes to the just file!

@jsturtevant jsturtevant force-pushed the add-wasi-example branch 2 times, most recently from 11e7d97 to af74f30 Compare June 24, 2025 18:42
jsturtevant and others added 2 commits June 24, 2025 18:42
Signed-off-by: James Sturtevant <[email protected]>
Signed-off-by: James Sturtevant <[email protected]>
@jsturtevant jsturtevant merged commit fdb6ba4 into hyperlight-dev:main Jun 24, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/testing kind/enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

A imported host function with no return type errors out Add an example to hl-wasm for wasi
3 participants