Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 11 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ repository = "https://github.com/hyperlight-dev/hyperlight-js"
readme = "README.md"

[workspace.dependencies]
hyperlight-guest-bin = { version = "0.17.0", features = ["libc"] }
hyperlight-host = { version = "0.17.0", default-features = false }
hyperlight-common = { version = "0.17.0", default-features = false }
hyperlight-guest = { version = "0.17.0" }
hyperlight-guest-bin = { git = "https://github.com/hyperlight-dev/hyperlight", rev = "fe19bf0645b9969752cf215669980fa9075dc953", features = ["libc"] }
hyperlight-host = { git = "https://github.com/hyperlight-dev/hyperlight", rev = "fe19bf0645b9969752cf215669980fa9075dc953", default-features = false }
hyperlight-common = { git = "https://github.com/hyperlight-dev/hyperlight", rev = "fe19bf0645b9969752cf215669980fa9075dc953", default-features = false }
hyperlight-guest = { git = "https://github.com/hyperlight-dev/hyperlight", rev = "fe19bf0645b9969752cf215669980fa9075dc953" }

hyperlight-js = { version = "0.4.0", path = "src/hyperlight-js" }
hyperlight-js-runtime = { version = "0.4.0", path = "src/hyperlight-js-runtime" }
Expand Down
7 changes: 7 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ build-rust-trace target=default-target features="":
build-js-host-api target=default-target features="": check-npm (build-rust target features)
cd src/js-host-api && npm install
cd src/js-host-api && npx napi build --platform {{ if target == "release" { "--release" } else { "" } }} {{ if features == "" { "" } else { "--features=" + features } }}
cd src/js-host-api && npm run normalize:types

build-all: (build "debug") (build "release")
@echo "✅ All builds complete!"
Expand All @@ -135,6 +136,8 @@ run-examples target=default-target features="": (build target)
cargo run --profile={{ if target == "debug" {"dev"} else { target } }} {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F function_call_metrics," + features } }} --example metrics
cargo run --profile={{ if target == "debug" {"dev"} else { target } }} {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F " + features } }} --example metrics
cargo run --profile={{ if target == "debug" {"dev"} else { target } }} {{ if features =="" {'--features guest-call-stats,monitor-wall-clock,monitor-cpu-time'} else if features=="no-default-features" {"--no-default-features -F guest-call-stats,monitor-wall-clock,monitor-cpu-time" } else {"--no-default-features -F guest-call-stats,monitor-wall-clock,monitor-cpu-time," + features } }} --example execution_stats
cargo run --profile={{ if target == "debug" {"dev"} else { target } }} {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F " + features } }} --example persistent_snapshot -- write target/persistent-rust-snapshot
cargo run --profile={{ if target == "debug" {"dev"} else { target } }} {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F " + features } }} --example persistent_snapshot -- read target/persistent-rust-snapshot

run-examples-tracing target=default-target features="": (build target)
cargo run --profile={{ if target == "debug" {"dev"} else { target } }} {{ if features =="" {'--features function_call_metrics'} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F " + features } }} --example tracing fmt
Expand Down Expand Up @@ -170,6 +173,7 @@ test-monitors target=default-target:
cd src/hyperlight-js && cargo test --features monitor-wall-clock,monitor-cpu-time --profile={{ if target == "debug" {"dev"} else { target } }} -- --include-ignored --skip test_metrics --skip custom_native_module --skip builtin_modules_work_with_custom --skip console_log_works_with_custom --skip custom_globals_and_host_clock

test-js-host-api target=default-target features="": (build-js-host-api target features)
cargo test --manifest-path src/js-host-api/Cargo.toml --profile={{ if target == "debug" {"dev"} else { target } }}
cd src/js-host-api && npm test

# Test custom native modules:
Expand Down Expand Up @@ -247,6 +251,9 @@ run-js-host-api-examples target=default-target features="": (build-js-host-api t
@echo ""
cd src/js-host-api && node examples/user-modules.js
@echo ""
cd src/js-host-api && node examples/persistent-snapshot.js write ../../target/persistent-node-snapshot
cd src/js-host-api && node examples/persistent-snapshot.js read ../../target/persistent-node-snapshot
@echo ""
@echo "✅ All examples completed successfully!"

test-all target=default-target features="": (test target features) (test-monitors target) (test-js-host-api target features)
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Provides a capability to run JavaScript inside of Hyperlight using quickjs as th
- [Custom guest runtimes](docs/extending-runtime.md) - Extend with native modules and build and embed a custom guest using cargo-hyperlight

- [Execution Monitors](docs/execution-monitors.md) - Timeout and resource limit enforcement for handler execution
- [Persistent snapshots](docs/persistent-snapshots.md) - Save and restore sandbox state across processes
- [Observability](docs/observability.md) - Metrics and tracing
- [Crashdumps](docs/create-and-analyse-guest-crashdumps.md) - Creating and analyzing guest crash dumps
- [Debugging the guest runtime](docs/guest-runtime-debugging.md) - Debugging the guest runtime using GDB or LLDB
Expand Down
Loading
Loading