Skip to content

Commit 24bc034

Browse files
committed
only invalidate if missing
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
1 parent ffd38df commit 24bc034

2 files changed

Lines changed: 21 additions & 8 deletions

File tree

src/javascript_sandbox/Justfile

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,27 @@ default-target := "debug"
33
repo-root := invocation_directory_native()
44
rmrf := if os() == "windows" { "Remove-Item -Recurse -Force -ErrorAction SilentlyContinue" } else { "rm -rf" }
55

6-
# Clean stale hyperlight-js build artifacts (e.g. rust-cache restores
7-
# fingerprints but not the runtime binary).
6+
# Only clean when rust-cache left stale state (fingerprints exist but runtime binary missing).
7+
[unix]
88
_clean-stale:
9-
-{{rmrf}} {{repo-root}}/target/hyperlight-js-runtime
10-
-{{rmrf}} {{repo-root}}/target/debug/build/hyperlight-js-*
11-
-{{rmrf}} {{repo-root}}/target/debug/.fingerprint/hyperlight-js-*
12-
-{{rmrf}} {{repo-root}}/target/release/build/hyperlight-js-*
13-
-{{rmrf}} {{repo-root}}/target/release/.fingerprint/hyperlight-js-*
9+
@if compgen -G "{{repo-root}}/target/*/build/hyperlight-js-*" > /dev/null 2>&1 && \
10+
! ls {{repo-root}}/target/hyperlight-js-runtime/x86_64-hyperlight-none/*/hyperlight-js-runtime > /dev/null 2>&1; then \
11+
echo "Cleaning stale hyperlight-js build artifacts..."; \
12+
rm -rf {{repo-root}}/target/hyperlight-js-runtime {{repo-root}}/target/hls \
13+
{{repo-root}}/target/*/build/hyperlight-js-* {{repo-root}}/target/*/.fingerprint/hyperlight-js-* \
14+
{{repo-root}}/target/*/build/hyperlight-host-* {{repo-root}}/target/*/.fingerprint/hyperlight-host-*; \
15+
fi
16+
17+
[windows]
18+
_clean-stale:
19+
$found = (Get-ChildItem -Path '{{repo-root}}/target/*/build' -Filter 'hyperlight-js-*' -ErrorAction SilentlyContinue); \
20+
$missing = -not (Get-ChildItem -Path '{{repo-root}}/target/hyperlight-js-runtime/x86_64-hyperlight-none/*/hyperlight-js-runtime' -ErrorAction SilentlyContinue); \
21+
if ($found -and $missing) { \
22+
Write-Host 'Cleaning stale hyperlight-js build artifacts...'; \
23+
Remove-Item -Recurse -Force -ErrorAction SilentlyContinue '{{repo-root}}/target/hyperlight-js-runtime','{{repo-root}}/target/hls'; \
24+
Get-ChildItem -Path '{{repo-root}}/target/*/build','{{repo-root}}/target/*/.fingerprint' -Filter 'hyperlight-js-*' -ErrorAction SilentlyContinue | Remove-Item -Recurse -Force; \
25+
Get-ChildItem -Path '{{repo-root}}/target/*/build','{{repo-root}}/target/*/.fingerprint' -Filter 'hyperlight-host-*' -ErrorAction SilentlyContinue | Remove-Item -Recurse -Force; \
26+
}
1427

1528
build target=default-target: _clean-stale
1629
cargo build --manifest-path {{repo-root}}/src/javascript_sandbox/Cargo.toml --profile={{ if target == "debug" {"dev"} else { target } }}

src/sdk/python/Justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ build: python-build
5151
#### DIST / PUBLISH ####
5252

5353
python-dist: python-sync-guest-resources
54-
{{rmrf}} {{dist-root}}
54+
-{{rmrf}} {{dist-root}}
5555
cd {{repo-root}}/src/sdk/python/core && uv run python -m build --outdir {{core-dist}}
5656
cd {{repo-root}}/src/sdk/python/wasm_backend && uv run maturin build --release --out {{wasm-wheels}}
5757
cd {{repo-root}}/src/sdk/python/hyperlight_js_backend && uv run maturin build --release --out {{hyperlight-js-wheels}}

0 commit comments

Comments
 (0)