Skip to content

Commit ffd38df

Browse files
committed
Further just file clean up
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
1 parent 511529a commit ffd38df

2 files changed

Lines changed: 8 additions & 36 deletions

File tree

src/javascript_sandbox/Justfile

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,16 @@
11
set windows-shell := ["pwsh", "-NoLogo", "-Command"]
22
default-target := "debug"
33
repo-root := invocation_directory_native()
4+
rmrf := if os() == "windows" { "Remove-Item -Recurse -Force -ErrorAction SilentlyContinue" } else { "rm -rf" }
45

5-
# If cargo fingerprints exist but the runtime binary is missing, clean stale state
6-
# to force hyperlight-js's build script to re-run. This can happen when rust-cache
7-
# restores partial artifacts.
8-
[unix]
6+
# Clean stale hyperlight-js build artifacts (e.g. rust-cache restores
7+
# fingerprints but not the runtime binary).
98
_clean-stale:
10-
#!/usr/bin/env bash
11-
for profile in debug release; do
12-
if compgen -G "{{repo-root}}/target/$profile/build/hyperlight-js-*" > /dev/null && \
13-
[ ! -f "{{repo-root}}/target/hyperlight-js-runtime/x86_64-hyperlight-none/$profile/hyperlight-js-runtime" ]; then
14-
echo "Cleaning stale hyperlight-js $profile build artifacts..."
15-
rm -rf {{repo-root}}/target/hyperlight-js-runtime \
16-
{{repo-root}}/target/$profile/build/hyperlight-js-* \
17-
{{repo-root}}/target/$profile/.fingerprint/hyperlight-js-*
18-
fi
19-
done
20-
21-
[windows]
22-
_clean-stale:
23-
foreach ($profile in @('debug', 'release')) { \
24-
$bp = '{{repo-root}}/target/' + $profile + '/build'; \
25-
$rp = '{{repo-root}}/target/hyperlight-js-runtime/x86_64-hyperlight-none/' + $profile + '/hyperlight-js-runtime'; \
26-
if ((Get-ChildItem -Path $bp -Filter 'hyperlight-js-*' -ErrorAction SilentlyContinue) -and \
27-
-not (Test-Path $rp)) { \
28-
Write-Host ('Cleaning stale hyperlight-js ' + $profile + ' build artifacts...'); \
29-
Remove-Item -Recurse -Force '{{repo-root}}/target/hyperlight-js-runtime' -ErrorAction SilentlyContinue; \
30-
Get-ChildItem -Path $bp -Filter 'hyperlight-js-*' | Remove-Item -Recurse -Force; \
31-
$fp = '{{repo-root}}/target/' + $profile + '/.fingerprint'; \
32-
if (Test-Path $fp) { \
33-
Get-ChildItem -Path $fp -Filter 'hyperlight-js-*' | Remove-Item -Recurse -Force \
34-
} \
35-
} \
36-
}
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-*
3714

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

src/wasm_sandbox/Justfile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,10 @@ guest-compile-wit: ensure-tools
3434
# and SDKs will fail at runtime with "vector parameter missing length".
3535
invalidate-wit-caches:
3636
-{{rmrf}} {{repo-root}}/target/hyperlight-wasm-runtime
37-
-{{rmrf}} {{repo-root}}/target/hyperlight-js-runtime
3837
-{{rmrf}} {{repo-root}}/target/debug/build/hyperlight-wasm-*
3938
-{{rmrf}} {{repo-root}}/target/debug/.fingerprint/hyperlight-wasm-*
4039
-{{rmrf}} {{repo-root}}/target/release/build/hyperlight-wasm-*
4140
-{{rmrf}} {{repo-root}}/target/release/.fingerprint/hyperlight-wasm-*
42-
-{{rmrf}} {{repo-root}}/target/debug/build/hyperlight-js-*
43-
-{{rmrf}} {{repo-root}}/target/debug/.fingerprint/hyperlight-js-*
44-
-{{rmrf}} {{repo-root}}/target/release/build/hyperlight-js-*
45-
-{{rmrf}} {{repo-root}}/target/release/.fingerprint/hyperlight-js-*
4641
-{{rmrf}} {{repo-root}}/src/sdk/python/wasm_backend/target/hyperlight-wasm-runtime
4742
-{{rmrf}} {{repo-root}}/src/sdk/python/wasm_backend/target/debug/build/hyperlight-wasm-*
4843
-{{rmrf}} {{repo-root}}/src/sdk/python/wasm_backend/target/debug/.fingerprint/hyperlight-wasm-*

0 commit comments

Comments
 (0)