Skip to content

Fix cached runtime embedding across feature builds - #309

Merged
jprendes merged 1 commit into
hyperlight-dev:mainfrom
ludfjig:fix-runtime-embedding
Sep 21, 2026
Merged

jprendes merged 1 commit into
hyperlight-dev:mainfrom
ludfjig:fix-runtime-embedding

Conversation

@ludfjig

@ludfjig ludfjig commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Copy the selected runtime into OUT_DIR and use that copy for embedding.

Default and trace_guest builds share one runtime output path. A trace_guest build can overwrite that file while Cargo retains the default build script's cached output. A later default library compilation then embeds the trace-enabled runtime.

Each configuration's OUT_DIR copy preserves its runtime. The nested Cargo target directory remains shared to reuse compiled dependencies. Custom runtimes supplied through HYPERLIGHT_JS_RUNTIME_PATH retain their existing environment and source-file tracking.

Original Reproduction

cargo build --release -p hyperlight-js
cargo build --release -p hyperlight-js --features trace_guest
cargo build --release -p hyperlight-js

Before this fix, the third build embedded the trace-enabled runtime despite requesting default

Uses the same approach as in in hyperlight-dev/hyperlight-wasm#551.

Fixes #296

Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com>
@ludfjig ludfjig added the kind/bugfix Bug fix label Sep 16, 2026
@ludfjig
ludfjig requested a review from jprendes September 16, 2026 18:45
@jprendes

Copy link
Copy Markdown
Contributor

Could we instead copy it alongside the original runtime binary but appending a hash, something like hyperlight-wasm-runtime-xXxXxX, where we compute the hash from the features, profile, and crate source path?

@jprendes
jprendes merged commit 506f2f3 into hyperlight-dev:main Sep 21, 2026
15 of 16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Copy the generated JS runtime into OUT_DIR

2 participants