Replace prebuilt custom runtime overrides with manifest-based cargo-hyperlight builds - #295
Open
simongdavies wants to merge 9 commits into
Open
simongdavies wants to merge 9 commits into
simongdavies wants to merge 9 commits into
Conversation
simongdavies
marked this pull request as ready for review
September 16, 2026 20:57
simongdavies
force-pushed
the
simongdavies-custom-guest-builds
branch
from
September 16, 2026 21:13
8b36dd0 to
5207db7
Compare
simongdavies
changed the base branch from
main
to
simongdavies-lint-before-build-in-ci
September 16, 2026 21:13
simongdavies
added this pull request to stack #311
September 16, 2026 21:14
ludfjig
previously approved these changes
Sep 17, 2026
simongdavies
dismissed
ludfjig’s stale review
September 28, 2026 19:37
The merge-base changed after approval.
simongdavies
force-pushed
the
simongdavies-custom-guest-builds
branch
2 times, most recently
from
September 29, 2026 07:50
a3b57e3 to
b73f680
Compare
simongdavies
added a commit
that referenced
this pull request
Sep 29, 2026
Upstream `hyperlight-host` 0.17.0 already ships the Hypervisor.framework driver, `virtual_machine/hvf/`, and `regs/aarch64/`. The remaining work is on the `hyperlight-js` side: platform wiring, an architecture-derived guest target, and CI/packaging. > **Stack:** this is the **bottom** layer of a planned stack. Layer 2 (npm `linux-arm64` packaging) follows, and #295 is intended to be rebased on top and appended retrospectively. Review/merge this one first. ## Notable Changes - Introduce cfg aliases (`kvm`, `mshv3`, `hvf`, `whp`, `crashdump`, `gdb`) in `build.rs`, mirroring upstream's semantics so platform code never tests a bare `feature = "..."` flag. Enable `hvf` by default; scope `libc` to `cfg(unix)`. - Gate `with_interrupt_retry_delay` on `any(kvm, mshv3, hvf)` rather than the Linux-only drivers. - Add a mach-based thread CPU-time backend for macOS. `js-host-api` enables `monitor-cpu-time` unconditionally, so this must compile on every host platform. - Add `src/hyperlight-js-runtime/include/math.h`. This is the one non-obvious change and it is what unblocks aarch64 guest builds: newlib guards its `__builtin_*` fast path with `… && !defined(__clang__)`. `cargo-hyperlight` drives clang, so `math.h` falls back to a `sizeof` dispatch whose never-taken `(long double)` branch is still code-generated. That is free on x86_64 (80-bit x87) but emits `__extenddftf2`/`__extendsftf2` soft-float libcalls on aarch64 (binary128), which fail to link against the guest sysroot. The shim uses `#include_next <math.h>` and restores the builtin path under clang. ## Pre-existing crashdump build failure `crashdump` builds are broken on `main` today — verified by checking out a clean `origin/main` into a temp worktree and reproducing the identical `E0596`. The snapshot helpers take `&self` but call `hyperlight-host` APIs requiring `&mut self`. Fixed at both call sites and gated on the new `crashdump` alias, which also restricts them to x86_64 in line with upstream. ## CI and packaging - `dep_build` matrix goes 6 → 10 jobs: macOS/hvf on the same self-hosted `["self-hosted","macos","arm64","hvf"]` runners hyperlight already uses, plus Linux aarch64 KVM. These run the **full test suite** - `npm-publish` gains an `aarch64-apple-darwin` binary on `macos-15`, with a new `darwin-arm64` npm package. --------- Signed-off-by: Simon Davies <[email protected]> Co-authored-by: Copilot App <[email protected]>
simongdavies
force-pushed
the
simongdavies-custom-guest-builds
branch
from
September 29, 2026 09:07
5be37a4 to
88ceffa
Compare
ludfjig
reviewed
Sep 30, 2026
ludfjig
left a comment
Contributor
There was a problem hiding this comment.
I don't really understand the reason for these changes? What's the motivation?
ludfjig
approved these changes
Sep 30, 2026
ludfjig
previously approved these changes
Sep 30, 2026
simongdavies
force-pushed
the
simongdavies-custom-guest-builds
branch
from
September 30, 2026 18:11
88ceffa to
e6c1dec
Compare
ludfjig
previously approved these changes
Oct 1, 2026
Build and embed custom runtimes from their Cargo manifests, keeping compiler configuration in the host build script. Remove the prebuilt runtime override and simplify the consumer documentation and test recipes. BREAKING CHANGE: HYPERLIGHT_JS_RUNTIME_PATH is no longer supported. Use HYPERLIGHT_JS_RUNTIME_MANIFEST_PATH to select a custom runtime crate. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Simon Davies <[email protected]>
Co-authored-by: Copilot App <[email protected]> Signed-off-by: Simon Davies <[email protected]>
Co-authored-by: Copilot App <[email protected]> Signed-off-by: Simon Davies <[email protected]>
Co-authored-by: Copilot App <[email protected]> Signed-off-by: Simon Davies <[email protected]>
…brary Co-authored-by: Copilot App <[email protected]> Signed-off-by: Simon Davies <[email protected]>
Co-authored-by: Copilot App <[email protected]> Signed-off-by: Simon Davies <[email protected]>
Use cargo rustc for custom guests so the clock wrapper flag is not inherited by cargo-hyperlight's native sysroot wrapper build. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Simon Davies <[email protected]>
Restore the selected runtime binding used when copying the built guest into the generated host resource. Co-authored-by: Copilot App <[email protected]> Signed-off-by: Simon Davies <[email protected]>
Co-authored-by: Copilot App <[email protected]> Signed-off-by: Simon Davies <[email protected]>
simongdavies
force-pushed
the
simongdavies-custom-guest-builds
branch
from
October 2, 2026 06:54
f23721a to
ec0baf0
Compare
ludfjig
approved these changes
Oct 2, 2026
This branch has not been deployed
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.
Summary
Build and embed a custom guest as part of the host build by setting
HYPERLIGHT_JS_RUNTIME_MANIFEST_PATHto itsCargo.toml. The Rust and Node.js host APIs remain unchanged.Breaking change / release notes
Prebuilt custom guest embedding through
HYPERLIGHT_JS_RUNTIME_PATHhas been removed. The variable is no longer read or tracked, and there is no compatibility check or migration error.Set
HYPERLIGHT_JS_RUNTIME_MANIFEST_PATHto the custom runtime crate's absoluteCargo.tomlpath and rebuild the host or Node.js addon from source. The runtime manifest must define exactly one binary target; the host build builds it with cargo-hyperlight and embeds it automatically.Without a custom manifest, the default runtime is built and embedded, even if the old variable is still set. Published Node.js addon binaries still contain the default runtime and must be replaced with a locally rebuilt addon to use custom modules.
This PR is labelled
breaking-changefor the generated release notes.