Skip to content

Add experimental-build-runtime to hyperlight-wasm-aot - #574

Open
ludfjig wants to merge 1 commit into
hyperlight-0.18-capifrom
experimental-build-runtime
Open

ludfjig wants to merge 1 commit into
hyperlight-0.18-capifrom
experimental-build-runtime

Conversation

@ludfjig

@ludfjig ludfjig commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Using the C API or .NET packages needs a guest runtime built for the component's WIT world. That takes a hyperlight-wasm checkout, cargo-hyperlight and wasm-tools.

This adds hyperlight-wasm-aot experimental-build-runtime <wit> <output>. Installed from crates.io, the tool carries the runtime source and builds it with the cargo-hyperlight library, so users need only rustup and clang. The guest macro accepts a .wit file or directory in WIT_WORLD.

Hyperlight.Wasm.Build can run it during the build. With Runtime set on a HyperlightWit item, dotnet build creates the runtime, and HyperlightComponent items are precompiled to .aot. Both go in the output directory. This is opt-in because it needs Rust.

CI builds the .NET tests' runtime with the subcommand and ships it with the example modules, so the .NET tests run it. One test leg builds the runtime and component through Hyperlight.Wasm.Build instead. CI covers the checkout path. The installed path was verified manually.

Based on #564.

@ludfjig ludfjig added the kind/enhancement New feature or request label Nov 13, 2026
@ludfjig
ludfjig added this pull request to stack #576 November 13, 2026 00:42
@ludfjig
ludfjig force-pushed the experimental-build-runtime branch from 71e1b5a to 32aefd7 Compare November 13, 2026 00:55
@ludfjig
ludfjig force-pushed the experimental-build-runtime branch 2 times, most recently from efedd2e to 6d5e1ba Compare November 16, 2026 18:46
@ludfjig
ludfjig force-pushed the experimental-build-runtime branch 2 times, most recently from 5b62b8a to 4318aab Compare November 17, 2026 18:45
@ludfjig
ludfjig force-pushed the experimental-build-runtime branch from 4318aab to 00ead69 Compare November 17, 2026 19:33
@ludfjig
ludfjig force-pushed the experimental-build-runtime branch 2 times, most recently from 0aca748 to 1638a53 Compare November 17, 2026 21:39
Add an experimental hyperlight-wasm-aot subcommand that builds a guest
runtime for a WIT world. C API and .NET users can then build a runtime
without a hyperlight-wasm checkout and without cargo-hyperlight.
Installed from crates.io, the tool embeds the runtime source. In a
checkout it builds the workspace's runtime in place.

The guest macro accepts a .wit file or a directory of .wit files in
WIT_WORLD, so no wasm-tools step is needed.

Hyperlight.Wasm.Build runs the subcommand for HyperlightWit items with
Runtime set, and precompiles HyperlightComponent items, so dotnet build
creates both. This is opt-in, because it needs Rust.

CI builds the .NET tests' runtime with the subcommand in the examples
job, which already compiles hyperlight-wasm-aot, and ships it with the
modules. One test leg builds the runtime and component through
Hyperlight.Wasm.Build instead.

Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
@ludfjig
ludfjig force-pushed the experimental-build-runtime branch from 1638a53 to 21672fa Compare November 17, 2026 22:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant