From 78bace769b910421098c7b669a0fec9dcaa1f074 Mon Sep 17 00:00:00 2001 From: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com> Date: Wed, 16 Sep 2026 11:27:22 -0700 Subject: [PATCH] Copy hyperlight-js-runtime binary to OUT_DIR Signed-off-by: Ludvig Liljenberg <4257730+ludfjig@users.noreply.github.com> --- src/hyperlight-js/build.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hyperlight-js/build.rs b/src/hyperlight-js/build.rs index 03abf368..7f1de0bd 100644 --- a/src/hyperlight-js/build.rs +++ b/src/hyperlight-js/build.rs @@ -216,7 +216,7 @@ fn bundle_runtime() { // which normalises a relative path to absolute and requires the target file // to already exist. An absolute path is recommended to avoid any ambiguity // about the base directory. - let js_runtime_resource = match env::var("HYPERLIGHT_JS_RUNTIME_PATH") { + let selected_runtime = match env::var("HYPERLIGHT_JS_RUNTIME_PATH") { Ok(path) if !path.trim().is_empty() => { let canonical = PathBuf::from(&path) .canonicalize() @@ -237,6 +237,9 @@ fn bundle_runtime() { }; let out_dir = env::var_os("OUT_DIR").unwrap(); + let js_runtime_resource = Path::new(&out_dir).join("hyperlight-js-runtime"); + fs::copy(&selected_runtime, &js_runtime_resource) + .expect("Failed to copy JS runtime to OUT_DIR"); let dest_path = Path::new(&out_dir).join("host_resource.rs"); let contents = format!("pub (super) static JSRUNTIME: &[u8] = include_bytes!({js_runtime_resource:?});");