Skip to content

Commit 95d7ead

Browse files
simongdaviesCopilot
andcommitted
fix: treat empty/whitespace HYPERLIGHT_JS_RUNTIME_PATH as unset
Previously an empty env var value would panic at canonicalize() with a confusing error. Now we treat empty/whitespace values the same as unset and fall through to build_js_runtime(). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent cd212f7 commit 95d7ead

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/hyperlight-js/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ fn bundle_runtime() {
200200
println!("cargo:rerun-if-env-changed=HYPERLIGHT_JS_RUNTIME_PATH");
201201

202202
let js_runtime_resource = match env::var("HYPERLIGHT_JS_RUNTIME_PATH") {
203-
Ok(path) => {
203+
Ok(path) if !path.trim().is_empty() => {
204204
let canonical = PathBuf::from(&path)
205205
.canonicalize()
206206
.expect("HYPERLIGHT_JS_RUNTIME_PATH must point to a valid file");
@@ -216,7 +216,7 @@ fn bundle_runtime() {
216216
println!("cargo:rerun-if-changed={}", canonical.display());
217217
canonical
218218
}
219-
Err(_) => build_js_runtime(),
219+
_ => build_js_runtime(),
220220
};
221221

222222
let out_dir = env::var_os("OUT_DIR").unwrap();

0 commit comments

Comments
 (0)