diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index b271b4d..0c9cbce 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -28,7 +28,7 @@ RUN wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-${WA && mv /wasi-sdk-${WASI_SDK_VERSION_FULL} /opt/wasi-sdk USER $USER -ARG RUST_TOOLCHAIN=1.82.0 +ARG RUST_TOOLCHAIN=1.85.0 # Install rust and component tools RUN rustup default ${RUST_TOOLCHAIN} \ diff --git a/.github/workflows/Benchmarks.yml b/.github/workflows/Benchmarks.yml index 02219f3..69c009f 100644 --- a/.github/workflows/Benchmarks.yml +++ b/.github/workflows/Benchmarks.yml @@ -36,13 +36,13 @@ jobs: - uses: hyperlight-dev/ci-setup-workflow@v1.4.0 with: - rust-toolchain: "1.82.0" + rust-toolchain: "1.85.0" - name: Build Wasm Runtime Binary working-directory: ./src/hyperlight_wasm run: just build-wasm-runtime ${{ matrix.config }} - - uses: dtolnay/rust-toolchain@1.82.0 + - uses: dtolnay/rust-toolchain@1.85.0 with: components: clippy, rustfmt diff --git a/.github/workflows/CargoAudit.yml b/.github/workflows/CargoAudit.yml index 6e40555..662fba6 100644 --- a/.github/workflows/CargoAudit.yml +++ b/.github/workflows/CargoAudit.yml @@ -18,7 +18,7 @@ jobs: # We are not using the common workflow here because it installs a lot of tools we don't need - uses: dtolnay/rust-toolchain@master with: - toolchain: "1.82.0" + toolchain: "1.85.0" - uses: extractions/setup-just@v3 with: diff --git a/.github/workflows/CreateDevcontainerImage.yml b/.github/workflows/CreateDevcontainerImage.yml index 2193d7c..aad47ab 100644 --- a/.github/workflows/CreateDevcontainerImage.yml +++ b/.github/workflows/CreateDevcontainerImage.yml @@ -16,7 +16,7 @@ env: USER: vscode GROUP: vscode LLVM_VERSION: 17 - RUST_TOOLCHAIN_DEFAULT: 1.82.0 + RUST_TOOLCHAIN_DEFAULT: 1.85.0 RUST_TOOLCHAIN_FILE: rust-toolchain.toml WASI_SDK_VERSION_FULL: "20.0" GCC_VERSION: "12" diff --git a/.github/workflows/CreateRelease.yml b/.github/workflows/CreateRelease.yml index 3c6e001..738e94f 100644 --- a/.github/workflows/CreateRelease.yml +++ b/.github/workflows/CreateRelease.yml @@ -30,7 +30,7 @@ jobs: - name: Hyperlight setup uses: hyperlight-dev/ci-setup-workflow@v1.4.0 with: - rust-toolchain: "1.82.0" + rust-toolchain: "1.85.0" - name: Install minver_rs run: | cargo install minver_rs diff --git a/.github/workflows/dep_build_wasm_examples.yml b/.github/workflows/dep_build_wasm_examples.yml index b6302cb..b162fae 100644 --- a/.github/workflows/dep_build_wasm_examples.yml +++ b/.github/workflows/dep_build_wasm_examples.yml @@ -33,7 +33,7 @@ jobs: - name: Hyperlight setup workflow uses: hyperlight-dev/ci-setup-workflow@v1.4.0 with: - rust-toolchain: "1.82.0" + rust-toolchain: "1.85.0" - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 - name: Login to Registry diff --git a/.github/workflows/dep_cargo_publish.yml b/.github/workflows/dep_cargo_publish.yml index d89fdc8..b4e51e4 100644 --- a/.github/workflows/dep_cargo_publish.yml +++ b/.github/workflows/dep_cargo_publish.yml @@ -22,7 +22,7 @@ jobs: - name: Hyperlight setup uses: hyperlight-dev/ci-setup-workflow@v1.4.0 with: - rust-toolchain: "1.82.0" + rust-toolchain: "1.85.0" - name: Download Wasm Host (debug) uses: actions/download-artifact@v4 diff --git a/.github/workflows/dep_rust.yml b/.github/workflows/dep_rust.yml index b6dc929..6b9d99e 100644 --- a/.github/workflows/dep_rust.yml +++ b/.github/workflows/dep_rust.yml @@ -52,7 +52,7 @@ jobs: - name: Hyperlight setup uses: hyperlight-dev/ci-setup-workflow@v1.4.0 with: - rust-toolchain: "1.82.0" + rust-toolchain: "1.85.0" - name: Add Nightly Rust run: | diff --git a/Cargo.lock b/Cargo.lock index de40b99..fee0a96 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,6 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "addr2line" @@ -13,20 +13,20 @@ dependencies = [ [[package]] name = "adler2" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ "cfg-if", "once_cell", "version_check", - "zerocopy 0.7.35", + "zerocopy 0.8.25", ] [[package]] @@ -67,9 +67,9 @@ checksum = "4b46cbb362ab8752921c97e041f5e366ee6297bd428a31275b9fcf1e380f7299" [[package]] name = "anstream" -version = "0.6.18" +version = "0.6.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8acc5369981196006228e28809f761875c0327210a891e941f4c683b3a99529b" +checksum = "301af1932e46185686725e0fad2f8f2aa7da69dd70bf6ecc44d6b703844a3933" dependencies = [ "anstyle", "anstyle-parse", @@ -82,36 +82,36 @@ dependencies = [ [[package]] name = "anstyle" -version = "1.0.10" +version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55cc3b69f167a1ef2e161439aa98aed94e6028e5f9a59be9a6ffb47aef1651f9" +checksum = "862ed96ca487e809f1c8e5a8447f6ee2cf102f846893800b20cebdf541fc6bbd" [[package]] name = "anstyle-parse" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b2d16507662817a6a20a9ea92df6652ee4f94f914589377d69f3b21bc5798a9" +checksum = "4e7644824f0aa2c7b9384579234ef10eb7efb6a0deb83f9630a49594dd9c15c2" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79947af37f4177cfead1110013d678905c37501914fba0efea834c3fe9a8d60c" +checksum = "6c8bdeb6047d8983be085bab0ba1472e6dc604e7041dbf6fcd5e71523014fae9" dependencies = [ "windows-sys 0.59.0", ] [[package]] name = "anstyle-wincon" -version = "3.0.7" +version = "3.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" +checksum = "403f75924867bb1033c59fbf0797484329750cfbe3c4325cd33127941fabc882" dependencies = [ "anstyle", - "once_cell", + "once_cell_polyfill", "windows-sys 0.59.0", ] @@ -141,9 +141,9 @@ checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" [[package]] name = "async-trait" -version = "0.1.86" +version = "0.1.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "644dd749086bf3771a2fbc5f256fdb982d53f011c7d5d560304eafeecebce79d" +checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" dependencies = [ "proc-macro2", "quote", @@ -164,9 +164,9 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "aws-lc-rs" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b756939cb2f8dc900aa6dcd505e6e2428e9cae7ff7b028c49e3946efa70878" +checksum = "93fcc8f365936c834db5514fc45aee5b1202d677e6b40e48468aaaa8183ca8c7" dependencies = [ "aws-lc-sys", "zeroize", @@ -174,9 +174,9 @@ dependencies = [ [[package]] name = "aws-lc-sys" -version = "0.28.2" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa9b6986f250236c27e5a204062434a773a13243d2ffc2955f37bdba4c5c6a1" +checksum = "61b1d86e7705efe1be1b569bab41d4fa1e14e220b60a160f78de2db687add079" dependencies = [ "bindgen", "cc", @@ -187,9 +187,9 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.74" +version = "0.3.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" dependencies = [ "addr2line", "cfg-if", @@ -212,7 +212,7 @@ version = "0.69.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" dependencies = [ - "bitflags 2.9.0", + "bitflags 2.9.1", "cexpr", "clang-sys", "itertools 0.12.1", @@ -237,9 +237,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "blake3" @@ -265,24 +265,14 @@ dependencies = [ [[package]] name = "bstr" -version = "1.11.3" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "531a9155a481e2ee699d4f98f43c0ca4ff8ee1bfd55c31e9e98fb29d2b176fe0" +checksum = "234113d19d0d7d613b40e86fb654acf958910802bcceab913a4f9e7cda03b1a4" dependencies = [ "memchr", "serde", ] -[[package]] -name = "built" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ed6191a7e78c36abdb16ab65341eefd73d64d303fffccdbb00d51e4205967b" -dependencies = [ - "chrono", - "git2", -] - [[package]] name = "built" version = "0.8.0" @@ -295,9 +285,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.17.0" +version = "3.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" +checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee" dependencies = [ "allocator-api2", ] @@ -310,15 +300,15 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f61dac84819c6588b558454b194026eb1f09c293b9036ae9b159e74e73ab6cf9" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "camino" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +checksum = "0da45bc31171d8d6960122e222a67740df867c1dd53b4d51caa297084c185cab" dependencies = [ "serde", ] @@ -354,9 +344,9 @@ checksum = "37b2a672a2cb129a2e41c10b1224bb368f9f37a2b16b612598138befd7b37eb5" [[package]] name = "cc" -version = "1.2.13" +version = "1.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7777341816418c02e033934a09f20dc0ccaf65a5201ef8a450ae0105a573fda" +checksum = "956a5e21988b87f372569b66183b78babf23ebc2e744b733e4350a752c4dafac" dependencies = [ "jobserver", "libc", @@ -438,18 +428,18 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.39" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd60e63e9be68e5fb56422e397cf9baddded06dae1d2e523401542383bc72a9f" +checksum = "40b6887a1d8685cebccf115538db5c0efe625ccac9696ad45c409d96566e910f" dependencies = [ "clap_builder", ] [[package]] name = "clap_builder" -version = "4.5.39" +version = "4.5.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89cc6392a1f72bbeb820d71f32108f61fdaf18bc526e1d23954168a67759ef51" +checksum = "e0c66c08ce9f0c698cbce5c0279d0bb6ac936d8674174fe48f736533b964f59e" dependencies = [ "anstream", "anstyle", @@ -459,9 +449,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.4" +version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" +checksum = "b94f61472cee1439c0b966b47e3aca9ae07e45d070759512cd390ea2bebc6675" [[package]] name = "cmake" @@ -480,9 +470,9 @@ checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" [[package]] name = "colorchoice" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" +checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" [[package]] name = "constant_time_eq" @@ -492,9 +482,9 @@ checksum = "7c74b8349d32d297c9134b8c88677813a227df8f779daa29bfc29c183fe3dca6" [[package]] name = "core-foundation" -version = "0.10.0" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" dependencies = [ "core-foundation-sys", "libc", @@ -767,23 +757,23 @@ dependencies = [ [[package]] name = "dirs" -version = "5.0.1" +version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +checksum = "c3e8aa94d75141228480295a7d0e7feb620b1a5ad9f12bc40be62411e38cce4e" dependencies = [ "dirs-sys", ] [[package]] name = "dirs-sys" -version = "0.4.1" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +checksum = "e01a3366d27ee9890022452ee61b2b63a67e6f13f58900b651ff5665f0bb1fab" dependencies = [ "libc", "option-ext", "redox_users", - "windows-sys 0.48.0", + "windows-sys 0.60.2", ] [[package]] @@ -805,9 +795,9 @@ checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] name = "embedded-io" @@ -838,15 +828,15 @@ checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.10" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18" dependencies = [ "libc", "windows-sys 0.59.0", @@ -877,7 +867,7 @@ version = "25.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1045398c1bfd89168b5fd3f1fc11f6e70b34f6f66300c87d44d3de849463abf1" dependencies = [ - "bitflags 2.9.0", + "bitflags 2.9.1", "rustc_version", ] @@ -889,9 +879,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foldhash" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0d2fde1f7b3d48b8395d5f2de76c18a528bd6a9cdde438df747bfcba3e05d6f" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "form_urlencoded" @@ -959,25 +949,25 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", ] [[package]] name = "getrandom" -version = "0.3.1" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", "libc", - "wasi 0.13.3+wasi-0.2.2", - "windows-targets 0.52.6", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", ] [[package]] @@ -993,11 +983,11 @@ dependencies = [ [[package]] name = "git2" -version = "0.20.0" +version = "0.20.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fda788993cc341f69012feba8bf45c0ba4f3291fcc08e214b4d5a7332d88aff" +checksum = "2deb07a133b1520dc1a5690e9bd08950108873d7ed5de38dcc74d3b5ebffa110" dependencies = [ - "bitflags 2.9.0", + "bitflags 2.9.1", "libc", "libgit2-sys", "log", @@ -1012,9 +1002,9 @@ checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "globset" -version = "0.4.15" +version = "0.4.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15f1ce686646e7f1e19bf7d5533fe443a45dbfb990e00629110797578b42fb19" +checksum = "54a1028dfc5f5df5da8a56a73e6c153c9a9708ec57232470703592a3f18e49f5" dependencies = [ "aho-corasick", "bstr", @@ -1031,14 +1021,25 @@ checksum = "daa0a64d21a7eb230583b4c5f4e23b7e4e57974f96620f42a7e75e08ae66d745" dependencies = [ "log", "plain", - "scroll", + "scroll 0.12.0", +] + +[[package]] +name = "goblin" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e961b33649994dcf69303af6b3a332c1228549e604d455d61ec5d2ab5e68d3a" +dependencies = [ + "log", + "plain", + "scroll 0.13.0", ] [[package]] name = "h2" -version = "0.4.9" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75249d144030531f8dee69fe9cea04d3edf809a017ae445e2abdff6629e86633" +checksum = "a9421a676d1b147b16b82c9225157dc629087ef8ec4d5e2960f9437a90dac0a5" dependencies = [ "atomic-waker", "bytes", @@ -1055,9 +1056,9 @@ dependencies = [ [[package]] name = "half" -version = "2.4.1" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6dd08c532ae367adf81c312a4580bc67f1d0fe8bc9c460520283f4c0ff277888" +checksum = "459196ed295495a68f7d7fe1d84f6c4b7ff0e21fe3017b2f283c6fac3ad803c9" dependencies = [ "cfg-if", "crunchy", @@ -1065,9 +1066,9 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" dependencies = [ "foldhash", "serde", @@ -1163,11 +1164,10 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.5" +version = "0.27.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" dependencies = [ - "futures-util", "http", "hyper", "hyper-util", @@ -1181,12 +1181,13 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.11" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497bbc33a26fdd4af9ed9c70d63f61cf56a938375fbb32df34db9b1cd6d643f2" +checksum = "dc2fdfdbff08affe55bb779f33b053aa1fe5dd5b54c257343c17edfa55711bdb" dependencies = [ "bytes", "futures-channel", + "futures-core", "futures-util", "http", "http-body", @@ -1201,53 +1202,48 @@ dependencies = [ [[package]] name = "hyperlight-common" -version = "0.2.0" -source = "git+https://github.com/hyperlight-dev/hyperlight?branch=hyperlight-component-macro#1f40391d1ffdd6e89657437af0127b40523f4e49" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "102b63aa5b49a5b22d8b50bdedaad54a9f89ecdd4bf71442e859444429fbbc87" dependencies = [ "anyhow", "flatbuffers", "log", "spin", - "strum", "tracing", ] [[package]] name = "hyperlight-host" -version = "0.2.0" -source = "git+https://github.com/hyperlight-dev/hyperlight?branch=hyperlight-component-macro#1f40391d1ffdd6e89657437af0127b40523f4e49" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728f6adb638cca498eb4f3db748257f19065d062ec95e3327690c7d9b3f29c23" dependencies = [ "anyhow", - "bitflags 2.9.0", - "built 0.7.7", + "bitflags 2.9.1", "cfg-if", "cfg_aliases", "crossbeam", "crossbeam-channel", "flatbuffers", - "goblin", + "goblin 0.10.0", "hyperlight-common", "kvm-bindings", "kvm-ioctls", "lazy_static", "libc", "log", + "metrics", "mshv-bindings 0.2.1", "mshv-bindings 0.3.2", "mshv-ioctls 0.2.1", "mshv-ioctls 0.3.2", - "once_cell", "page_size", - "paste", - "prometheus", "rand", "rust-embed", "seccompiler", - "serde", "serde_json", - "serde_yaml", "sha256", - "strum", "tempfile", "termcolor", "thiserror 2.0.12", @@ -1255,7 +1251,7 @@ dependencies = [ "tracing-core", "tracing-log", "vmm-sys-util", - "windows 0.60.0", + "windows", "windows-result", "windows-sys 0.59.0", "windows-version", @@ -1267,13 +1263,13 @@ version = "0.1.0" dependencies = [ "anyhow", "blake3", - "built 0.8.0", + "built", "cfg-if", "chrono", "criterion", "crossbeam-queue", "examples_common", - "goblin", + "goblin 0.9.3", "hyperlight-host", "libc", "log", @@ -1284,7 +1280,7 @@ dependencies = [ "page_size", "toml", "tracing", - "windows 0.61.3", + "windows", ] [[package]] @@ -1298,16 +1294,17 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", - "windows-core 0.52.0", + "windows-core", ] [[package]] @@ -1321,21 +1318,22 @@ dependencies = [ [[package]] name = "icu_collections" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" dependencies = [ "displaydoc", + "potential_utf", "yoke", "zerofrom", "zerovec", ] [[package]] -name = "icu_locid" -version = "1.5.0" +name = "icu_locale_core" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" dependencies = [ "displaydoc", "litemap", @@ -1344,31 +1342,11 @@ dependencies = [ "zerovec", ] -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - [[package]] name = "icu_normalizer" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" dependencies = [ "displaydoc", "icu_collections", @@ -1376,67 +1354,54 @@ dependencies = [ "icu_properties", "icu_provider", "smallvec", - "utf16_iter", - "utf8_iter", - "write16", "zerovec", ] [[package]] name = "icu_normalizer_data" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" [[package]] name = "icu_properties" -version = "1.5.1" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" dependencies = [ "displaydoc", "icu_collections", - "icu_locid_transform", + "icu_locale_core", "icu_properties_data", "icu_provider", - "tinystr", + "potential_utf", + "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" -version = "1.5.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" [[package]] name = "icu_provider" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" dependencies = [ "displaydoc", - "icu_locid", - "icu_provider_macros", + "icu_locale_core", "stable_deref_trait", "tinystr", "writeable", "yoke", "zerofrom", + "zerotrie", "zerovec", ] -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "id-arena" version = "2.2.1" @@ -1456,9 +1421,9 @@ dependencies = [ [[package]] name = "idna_adapter" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" dependencies = [ "icu_normalizer", "icu_properties", @@ -1466,9 +1431,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.7.1" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9c992b02b5b4c94ea26e32fe5bccb7aa7d9f390ab5c1221ff895bc7ea8b652" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", "hashbrown", @@ -1516,16 +1481,17 @@ dependencies = [ [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" [[package]] name = "jobserver" -version = "0.1.32" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48d1dbcbbeb6a7fec7e059840aa538bd62aaccf972c7346c4d9d2059312853d0" +checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" dependencies = [ + "getrandom 0.3.3", "libc", ] @@ -1541,20 +1507,20 @@ dependencies = [ [[package]] name = "kvm-bindings" -version = "0.11.0" +version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "501bc0717c6a9fc409f29047ebeb6040a4d304344698abb268c4c6a440e6a09a" +checksum = "d4b153a59bb3ca930ff8148655b2ef68c34259a623ae08cf2fb9b570b2e45363" dependencies = [ "vmm-sys-util", ] [[package]] name = "kvm-ioctls" -version = "0.21.0" +version = "0.22.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "083c460d5a272c2f22205973e319147b791d92a288d7d7a8d4c6194f95229440" +checksum = "b702df98508cb63ad89dd9beb9f6409761b30edca10d48e57941d3f11513a006" dependencies = [ - "bitflags 2.9.0", + "bitflags 2.9.1", "kvm-bindings", "libc", "vmm-sys-util", @@ -1586,9 +1552,9 @@ checksum = "d8cfeafaffdbc32176b64fb251369d52ea9f0a8fbc6f8759edffef7b525d64bb" [[package]] name = "libgit2-sys" -version = "0.18.0+1.9.0" +version = "0.18.1+1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1a117465e7e1597e8febea8bb0c410f1c7fb93b1e1cddf34363f8390367ffec" +checksum = "e1dcb20f84ffcdd825c7a311ae347cce604a6f084a767dec4a4929829645290e" dependencies = [ "cc", "libc", @@ -1598,19 +1564,19 @@ dependencies = [ [[package]] name = "libloading" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" dependencies = [ "cfg-if", - "windows-targets 0.52.6", + "windows-targets 0.53.2", ] [[package]] name = "libm" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" [[package]] name = "libredox" @@ -1618,15 +1584,15 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" dependencies = [ - "bitflags 2.9.0", + "bitflags 2.9.1", "libc", ] [[package]] name = "libz-sys" -version = "1.1.21" +version = "1.1.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df9b68e50e6e0b26f672573834882eb57759f6db9b3be2ea3c35c91188bb4eaa" +checksum = "8b70e7a7df205e92a1a4cd9aaae7898dac0aa555503cc0a649494d0d60e7651d" dependencies = [ "cc", "libc", @@ -1642,21 +1608,21 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "linux-raw-sys" -version = "0.9.3" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe7db12097d22ec582439daf8618b8fdd1a7bef6270e9af3b1ebcd30893cf413" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "litemap" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -1679,9 +1645,9 @@ dependencies = [ [[package]] name = "memchr" -version = "2.7.4" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "memfd" @@ -1751,22 +1717,22 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" [[package]] name = "miniz_oxide" -version = "0.8.4" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3b1c9bd4fe1f0f8b387f6eb9eb3b4a1aa26185e5750efb9140301703f62cd1b" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", ] [[package]] name = "mio" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.52.0", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.59.0", ] [[package]] @@ -1790,7 +1756,7 @@ dependencies = [ "libc", "num_enum", "vmm-sys-util", - "zerocopy 0.8.17", + "zerocopy 0.8.25", ] [[package]] @@ -1883,11 +1849,17 @@ version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" +[[package]] +name = "once_cell_polyfill" +version = "1.70.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4895175b425cb1f87721b59f0f286c2092bd4af812243672510e1ac53e2e0ad" + [[package]] name = "oorandom" -version = "11.1.4" +version = "11.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b410bbe7e14ab526a0e86877eb47c6996a2bd7746f027ba551028c925390e4e9" +checksum = "d6790f58c7ff633d8771f42965289203411a5e5c68388703c06e14f24770b41e" [[package]] name = "openssl-probe" @@ -1920,29 +1892,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "parking_lot" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bf18183cf54e8d6059647fc3063646a1801cf30896933ec2311622cc4b9a27" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e401f977ab385c9e4e3ab30627d6f26d00e2c73eef317493c4ec6d468726cf8" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall", - "smallvec", - "windows-targets 0.52.6", -] - [[package]] name = "paste" version = "1.0.15" @@ -1969,9 +1918,9 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "plain" @@ -2009,9 +1958,9 @@ dependencies = [ [[package]] name = "portable-atomic" -version = "1.11.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" +checksum = "f84267b20a16ea918e43c6a88433c2d54fa145c92a811b5b047ccbe153674483" [[package]] name = "postcard" @@ -2025,20 +1974,29 @@ dependencies = [ "serde", ] +[[package]] +name = "potential_utf" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +dependencies = [ + "zerovec", +] + [[package]] name = "ppv-lite86" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ - "zerocopy 0.7.35", + "zerocopy 0.8.25", ] [[package]] name = "prettyplease" -version = "0.2.32" +version = "0.2.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "664ec5419c51e34154eec046ebcba56312d5a2fc3b09a06da188e1ad21afadf6" +checksum = "6837b9e10d61f45f987d50808f83d1ee3d206c66acf650c3e4ae2e1f6ddedf55" dependencies = [ "proc-macro2", "syn", @@ -2046,39 +2004,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.93" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60946a68e5f9d28b0dc1c21bb8a97ee7d018a8b322fa57838ba31cc878e22d99" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] -[[package]] -name = "prometheus" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3d33c28a30771f7f96db69893f78b857f7450d7e0237e9c8fc6427a81bae7ed1" -dependencies = [ - "cfg-if", - "fnv", - "lazy_static", - "memchr", - "parking_lot", - "protobuf", - "thiserror 1.0.69", -] - -[[package]] -name = "protobuf" -version = "2.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" - [[package]] name = "psm" -version = "0.1.24" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "200b9ff220857e53e184257720a14553b2f4aa02577d2ed9842d45d4b9654810" +checksum = "6e944464ec8536cd1beb0bbfd96987eb5e3b72f2ecdafdc5c769a37f1fa2ae1f" dependencies = [ "cc", ] @@ -2096,28 +2033,34 @@ dependencies = [ [[package]] name = "quanta" -version = "0.12.5" +version = "0.12.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bd1fe6824cea6538803de3ff1bc0cf3949024db3d43c9643024bfb33a807c0e" +checksum = "f3ab5a9d756f0d97bdc89019bd2e4ea098cf9cde50ee7564dde6b81ccc8f06c7" dependencies = [ "crossbeam-utils", "libc", "once_cell", "raw-cpuid", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", "web-sys", "winapi", ] [[package]] name = "quote" -version = "1.0.38" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + [[package]] name = "radix_trie" version = "0.2.1" @@ -2130,13 +2073,12 @@ dependencies = [ [[package]] name = "rand" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" dependencies = [ "rand_chacha", "rand_core", - "zerocopy 0.8.17", ] [[package]] @@ -2151,12 +2093,11 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.9.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b08f3c9802962f7e1b25113931d94f43ed9725bebc59db9d0c3e9a23b67e15ff" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ - "getrandom 0.3.1", - "zerocopy 0.8.17", + "getrandom 0.3.3", ] [[package]] @@ -2174,7 +2115,7 @@ version = "11.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6df7ab838ed27997ba19a4664507e6f82b41fe6e20be42929332156e5e85146" dependencies = [ - "bitflags 2.9.0", + "bitflags 2.9.1", ] [[package]] @@ -2197,31 +2138,22 @@ dependencies = [ "crossbeam-utils", ] -[[package]] -name = "redox_syscall" -version = "0.5.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" -dependencies = [ - "bitflags 2.9.0", -] - [[package]] name = "redox_users" -version = "0.4.6" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" +checksum = "dd6f9d3d47bdd2ad6945c5015a226ec6155d0bcdfd8f7cd29f86b71f8de99d2b" dependencies = [ - "getrandom 0.2.15", + "getrandom 0.2.16", "libredox", - "thiserror 1.0.69", + "thiserror 2.0.12", ] [[package]] name = "regalloc2" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145c1c267e14f20fb0f88aa76a1c5ffec42d592c1d28b3cd9148ae35916158d3" +checksum = "dc06e6b318142614e4a48bc725abbf08ff166694835c43c9dae5a9009704639a" dependencies = [ "allocator-api2", "bumpalo", @@ -2268,7 +2200,7 @@ checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.15", + "getrandom 0.2.16", "libc", "untrusted", "windows-sys 0.52.0", @@ -2276,9 +2208,9 @@ dependencies = [ [[package]] name = "rust-embed" -version = "8.6.0" +version = "8.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b3aba5104622db5c9fc61098de54708feb732e7763d7faa2fa625899f00bf6f" +checksum = "025908b8682a26ba8d12f6f2d66b987584a4a87bc024abc5bbc12553a8cd178a" dependencies = [ "rust-embed-impl", "rust-embed-utils", @@ -2287,9 +2219,9 @@ dependencies = [ [[package]] name = "rust-embed-impl" -version = "8.6.0" +version = "8.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f198c73be048d2c5aa8e12f7960ad08443e56fd39cc26336719fdb4ea0ebaae" +checksum = "6065f1a4392b71819ec1ea1df1120673418bf386f50de1d6f54204d836d4349c" dependencies = [ "proc-macro2", "quote", @@ -2301,9 +2233,9 @@ dependencies = [ [[package]] name = "rust-embed-utils" -version = "8.6.0" +version = "8.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a2fcdc9f40c8dc2922842ca9add611ad19f332227fc651d015881ad1552bd9a" +checksum = "f6cc0c81648b20b70c491ff8cce00c1c3b223bb8ed2b5d41f0e54c6c4c0a3594" dependencies = [ "globset", "sha2", @@ -2312,9 +2244,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" [[package]] name = "rustc-hash" @@ -2343,7 +2275,7 @@ version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.9.0", + "bitflags 2.9.1", "errno", "libc", "linux-raw-sys 0.4.15", @@ -2352,22 +2284,22 @@ dependencies = [ [[package]] name = "rustix" -version = "1.0.3" +version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e56a18552996ac8d29ecc3b190b4fdbb2d91ca4ec396de7bbffaf43f3d637e96" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" dependencies = [ - "bitflags 2.9.0", + "bitflags 2.9.1", "errno", "libc", - "linux-raw-sys 0.9.3", - "windows-sys 0.59.0", + "linux-raw-sys 0.9.4", + "windows-sys 0.52.0", ] [[package]] name = "rustls" -version = "0.23.26" +version = "0.23.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df51b5869f3a441595eac5e8ff14d486ff285f7b8c0df8770e49c3b56351f0f0" +checksum = "730944ca083c1c233a75c09f199e973ca499344a2b7ba9e755c457e86fb4a321" dependencies = [ "aws-lc-rs", "once_cell", @@ -2391,15 +2323,18 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" +checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" +dependencies = [ + "zeroize", +] [[package]] name = "rustls-webpki" -version = "0.103.1" +version = "0.103.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fef8b8769aaccf73098557a87cd1816b4f9c7c16811c9c77142aa695c16f2c03" +checksum = "e4a72fe2bcf7a6ac6fd7d0b9e5cb68aeb7d4c0a0271730218b3e92d43b4eb435" dependencies = [ "aws-lc-rs", "ring", @@ -2409,15 +2344,15 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.19" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" [[package]] name = "ryu" -version = "1.0.19" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ea1a2d0a644769cc99faa24c3ad26b379b786fe7c36fd3c546254801650e6dd" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" [[package]] name = "same-file" @@ -2449,14 +2384,34 @@ version = "0.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ab8598aa408498679922eff7fa985c25d58a90771bd6be794434c5277eab1a6" dependencies = [ - "scroll_derive", + "scroll_derive 0.12.1", +] + +[[package]] +name = "scroll" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1257cd4248b4132760d6524d6dda4e053bc648c9070b960929bf50cfb1e7add" +dependencies = [ + "scroll_derive 0.13.0", ] [[package]] name = "scroll_derive" -version = "0.12.0" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1783eabc414609e28a5ba76aee5ddd52199f7107a0b24c2e9746a1ecc34a683d" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "scroll_derive" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f81c2fde025af7e69b1d1420531c8a8811ca898919db177141a85313b1cb932" +checksum = "22fc4f90c27b57691bbaf11d8ecc7cfbfe98a4da6dbe60226115d322aa80c06e" dependencies = [ "proc-macro2", "quote", @@ -2478,7 +2433,7 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" dependencies = [ - "bitflags 2.9.0", + "bitflags 2.9.1", "core-foundation", "core-foundation-sys", "libc", @@ -2497,27 +2452,27 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.25" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f79dfe2d285b0488816f30e700a7438c5a73d816b5b7d3ac72fbc48b0d185e03" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" dependencies = [ "serde", ] [[package]] name = "serde" -version = "1.0.217" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.217" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", @@ -2526,9 +2481,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.138" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d434192e7da787e94a6ea7e9670b26a036d0ca41e0b7efb2676dd32bae872949" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", "memchr", @@ -2545,24 +2500,11 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_yaml" -version = "0.9.34+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" -dependencies = [ - "indexmap", - "itoa", - "ryu", - "serde", - "unsafe-libyaml", -] - [[package]] name = "sha2" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", "cpufeatures", @@ -2584,9 +2526,9 @@ dependencies = [ [[package]] name = "shellexpand" -version = "3.1.0" +version = "3.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da03fa3b94cc19e3ebfc88c4229c49d8f08cdbd1228870a45f0ffdf84988e14b" +checksum = "8b1fdf65dd6331831494dd616b30351c38e96e45921a27745cf98490458b90bb" dependencies = [ "dirs", ] @@ -2614,18 +2556,18 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" dependencies = [ "serde", ] [[package]] name = "socket2" -version = "0.5.9" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" dependencies = [ "libc", "windows-sys 0.52.0", @@ -2633,9 +2575,9 @@ dependencies = [ [[package]] name = "spin" -version = "0.9.8" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +checksum = "d5fe4ccb98d9c292d56fec89a5e07da7fc4cf0dc11e156b41793132775d3e591" dependencies = [ "lock_api", ] @@ -2658,28 +2600,6 @@ version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" -[[package]] -name = "strum" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn", -] - [[package]] name = "subtle" version = "2.6.1" @@ -2688,9 +2608,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.98" +version = "2.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36147f1a48ae0ec2b5b3bc5b537d267457555a10dc06f3dbc8cb11ba3006d3b1" +checksum = "e4307e30089d6fd6aff212f2da3a1f9e32f3223b1f010fb09b7c95f90f3ca1e8" dependencies = [ "proc-macro2", "quote", @@ -2699,9 +2619,9 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", @@ -2716,15 +2636,15 @@ checksum = "e502f78cdbb8ba4718f566c418c52bc729126ffd16baee5baa718cf25dd5a69a" [[package]] name = "tempfile" -version = "3.19.1" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ "fastrand", - "getrandom 0.3.1", + "getrandom 0.3.3", "once_cell", - "rustix 1.0.3", - "windows-sys 0.59.0", + "rustix 1.0.7", + "windows-sys 0.52.0", ] [[package]] @@ -2778,9 +2698,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.7.6" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" dependencies = [ "displaydoc", "zerovec", @@ -2798,9 +2718,9 @@ dependencies = [ [[package]] name = "tokio" -version = "1.45.0" +version = "1.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2513ca694ef9ede0fb23fe71a4ee4107cb102b9dc1930f6d0fd77aae068ae165" +checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779" dependencies = [ "backtrace", "bytes", @@ -2823,9 +2743,9 @@ dependencies = [ [[package]] name = "tokio-util" -version = "0.7.14" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b9590b93e6fcc1739458317cccd391ad3955e2bde8913edf6f95f9e65a8f034" +checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" dependencies = [ "bytes", "futures-core", @@ -2895,9 +2815,9 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.28" +version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" +checksum = "1b1ffbcf9c6f6b99d386e7444eb608ba646ae452a36b39737deb9663b610f662" dependencies = [ "proc-macro2", "quote", @@ -2906,9 +2826,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.33" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", "valuable", @@ -2933,15 +2853,15 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" [[package]] name = "unicode-ident" -version = "1.0.16" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a210d160f08b701c8721ba1c726c11662f877ea6b7094007e1ca9a1041945034" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-xid" @@ -2949,12 +2869,6 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" -[[package]] -name = "unsafe-libyaml" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" - [[package]] name = "untrusted" version = "0.9.0" @@ -2972,12 +2886,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - [[package]] name = "utf8_iter" version = "1.0.4" @@ -3010,9 +2918,9 @@ checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" [[package]] name = "vmm-sys-util" -version = "0.12.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1435039746e20da4f8d507a72ee1b916f7b4b05af7a91c093d2c6561934ede" +checksum = "d21f366bf22bfba3e868349978766a965cbe628c323d58e026be80b8357ab789" dependencies = [ "bitflags 1.3.2", "libc", @@ -3039,15 +2947,15 @@ dependencies = [ [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" -version = "0.13.3+wasi-0.2.2" +version = "0.14.2+wasi-0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" dependencies = [ "wit-bindgen-rt", ] @@ -3126,7 +3034,7 @@ version = "0.224.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04f17a5917c2ddd3819e84c661fae0d6ba29d7b9c1f0e96c708c65a9c4188e11" dependencies = [ - "bitflags 2.9.0", + "bitflags 2.9.1", "hashbrown", "indexmap", "semver", @@ -3152,7 +3060,7 @@ checksum = "809cc8780708f1deed0a7c3fcab46954f0e8c08a6fe0252772481fbc88fcf946" dependencies = [ "addr2line", "anyhow", - "bitflags 2.9.0", + "bitflags 2.9.1", "bumpalo", "cc", "cfg-if", @@ -3425,39 +3333,17 @@ dependencies = [ "wasmtime-environ", ] -[[package]] -name = "windows" -version = "0.60.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddf874e74c7a99773e62b1c671427abf01a425e77c3d3fb9fb1e4883ea934529" -dependencies = [ - "windows-collections 0.1.1", - "windows-core 0.60.1", - "windows-future 0.1.1", - "windows-link", - "windows-numerics 0.1.1", -] - [[package]] name = "windows" version = "0.61.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" dependencies = [ - "windows-collections 0.2.0", - "windows-core 0.61.2", - "windows-future 0.2.1", + "windows-collections", + "windows-core", + "windows-future", "windows-link", - "windows-numerics 0.2.0", -] - -[[package]] -name = "windows-collections" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5467f79cc1ba3f52ebb2ed41dbb459b8e7db636cc3429458d9a852e15bc24dec" -dependencies = [ - "windows-core 0.60.1", + "windows-numerics", ] [[package]] @@ -3466,29 +3352,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" dependencies = [ - "windows-core 0.61.2", -] - -[[package]] -name = "windows-core" -version = "0.52.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" -dependencies = [ - "windows-targets 0.52.6", -] - -[[package]] -name = "windows-core" -version = "0.60.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca21a92a9cae9bf4ccae5cf8368dce0837100ddf6e6d57936749e85f152f6247" -dependencies = [ - "windows-implement 0.59.0", - "windows-interface", - "windows-link", - "windows-result", - "windows-strings 0.3.1", + "windows-core", ] [[package]] @@ -3497,21 +3361,11 @@ version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ - "windows-implement 0.60.0", + "windows-implement", "windows-interface", "windows-link", "windows-result", - "windows-strings 0.4.2", -] - -[[package]] -name = "windows-future" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a787db4595e7eb80239b74ce8babfb1363d8e343ab072f2ffe901400c03349f0" -dependencies = [ - "windows-core 0.60.1", - "windows-link", + "windows-strings", ] [[package]] @@ -3520,22 +3374,11 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" dependencies = [ - "windows-core 0.61.2", + "windows-core", "windows-link", "windows-threading", ] -[[package]] -name = "windows-implement" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83577b051e2f49a058c308f17f273b570a6a758386fc291b5f6a934dd84e48c1" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "windows-implement" version = "0.60.0" @@ -3564,23 +3407,13 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" -[[package]] -name = "windows-numerics" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "005dea54e2f6499f2cee279b8f703b3cf3b5734a2d8d21867c8f44003182eeed" -dependencies = [ - "windows-core 0.60.1", - "windows-link", -] - [[package]] name = "windows-numerics" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" dependencies = [ - "windows-core 0.61.2", + "windows-core", "windows-link", ] @@ -3593,15 +3426,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "windows-strings" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" -dependencies = [ - "windows-link", -] - [[package]] name = "windows-strings" version = "0.4.2" @@ -3611,15 +3435,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "windows-sys" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets 0.48.5", -] - [[package]] name = "windows-sys" version = "0.52.0" @@ -3639,18 +3454,12 @@ dependencies = [ ] [[package]] -name = "windows-targets" -version = "0.48.5" +name = "windows-sys" +version = "0.60.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" +checksum = "f2f500e4d28234f72040990ec9d39e3a6b950f9f22d3dba18416c35882612bcb" dependencies = [ - "windows_aarch64_gnullvm 0.48.5", - "windows_aarch64_msvc 0.48.5", - "windows_i686_gnu 0.48.5", - "windows_i686_msvc 0.48.5", - "windows_x86_64_gnu 0.48.5", - "windows_x86_64_gnullvm 0.48.5", - "windows_x86_64_msvc 0.48.5", + "windows-targets 0.53.2", ] [[package]] @@ -3671,9 +3480,9 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.53.0" +version = "0.53.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" dependencies = [ "windows_aarch64_gnullvm 0.53.0", "windows_aarch64_msvc 0.53.0", @@ -3696,19 +3505,13 @@ dependencies = [ [[package]] name = "windows-version" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c12476c23a74725c539b24eae8bfc0dac4029c39cdb561d9f23616accd4ae26d" +checksum = "e04a5c6627e310a23ad2358483286c7df260c964eb2d003d8efd6d0f4e79265c" dependencies = [ - "windows-targets 0.53.0", + "windows-link", ] -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" - [[package]] name = "windows_aarch64_gnullvm" version = "0.52.6" @@ -3721,12 +3524,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" -[[package]] -name = "windows_aarch64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" @@ -3739,12 +3536,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" -[[package]] -name = "windows_i686_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" - [[package]] name = "windows_i686_gnu" version = "0.52.6" @@ -3769,12 +3560,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" -[[package]] -name = "windows_i686_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" - [[package]] name = "windows_i686_msvc" version = "0.52.6" @@ -3787,12 +3572,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" -[[package]] -name = "windows_x86_64_gnu" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" @@ -3805,12 +3584,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" @@ -3823,12 +3596,6 @@ version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" -[[package]] -name = "windows_x86_64_msvc" -version = "0.48.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" @@ -3843,20 +3610,20 @@ checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" [[package]] name = "winnow" -version = "0.7.10" +version = "0.7.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c06928c8748d81b05c9be96aad92e1b6ff01833332f281e8cfca3be4b35fc9ec" +checksum = "74c7b26e3480b707944fc872477815d29a8e429d2f93a1ce000f5fa84a15cbcd" dependencies = [ "memchr", ] [[package]] name = "wit-bindgen-rt" -version = "0.33.0" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" dependencies = [ - "bitflags 2.9.0", + "bitflags 2.9.1", ] [[package]] @@ -3877,23 +3644,17 @@ dependencies = [ "wasmparser", ] -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - [[package]] name = "writeable" -version = "0.5.5" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" [[package]] name = "yoke" -version = "0.7.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" dependencies = [ "serde", "stable_deref_trait", @@ -3903,9 +3664,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", @@ -3925,11 +3686,11 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.17" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa91407dacce3a68c56de03abe2760159582b846c6a4acd2f456618087f12713" +checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" dependencies = [ - "zerocopy-derive 0.8.17", + "zerocopy-derive 0.8.25", ] [[package]] @@ -3945,9 +3706,9 @@ dependencies = [ [[package]] name = "zerocopy-derive" -version = "0.8.17" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "06718a168365cad3d5ff0bb133aad346959a2074bd4a85c121255a11304a8626" +checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" dependencies = [ "proc-macro2", "quote", @@ -3956,18 +3717,18 @@ dependencies = [ [[package]] name = "zerofrom" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", @@ -3981,11 +3742,22 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + [[package]] name = "zerovec" -version = "0.10.4" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" dependencies = [ "yoke", "zerofrom", @@ -3994,9 +3766,9 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.10.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index ce2e815..25b72fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -4,4 +4,4 @@ exclude = [ "src/wasm_runtime", "src/rust_wasm_samples", "src/hyperlight_wasm_m resolver = "2" [workspace.dependencies] -hyperlight-host = { git = "https://github.com/hyperlight-dev/hyperlight", branch = "hyperlight-component-macro", default-features = false, features = ["executable_heap"] } +hyperlight-host = { version = "0.6.1", default-features = false, features = ["executable_heap"] } diff --git a/Justfile b/Justfile index 7e1ad3b..17fcbd5 100644 --- a/Justfile +++ b/Justfile @@ -55,13 +55,10 @@ clippy target=default-target: (check target) # There may be tests that we really want to ignore so we cant just use --ignored and run then we have to # specify the test name of the ignored tests that we want to run # Additionally, we have to run the tests with the function_call_metrics feature enabled separately -test target=default-target features="": (test-inprocess target) (test-seccomp target features) +test target=default-target features="": (test-seccomp target features) cargo test {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F " + features } }} --profile={{ if target == "debug" {"dev"} else { target } }} cargo test test_metrics {{ if features =="" {''} else if features=="no-default-features" {"--no-default-features" } else {"--no-default-features -F " + features } }} --profile={{ if target == "debug" {"dev"} else { target } }} -- --ignored -test-inprocess target=default-target: - {{ if target == "debug" { "cargo test --features='inprocess'; cargo test test_metrics --features='inprocess' -- --ignored; cargo test test_gather_metrics --features='inprocess' -- --ignored" } else {"echo 'inprocess tests are not run for release builds'" } }} - test-seccomp target=default-target features="": cargo test {{ if features =="" {'--no-default-features -F "kvm,mshv2,seccomp"'} else {"--no-default-features -F seccomp," + features } }} --profile={{ if target == "debug" {"dev"} else { target } }} -- --test-threads=1 cargo test {{ if features =="" {'--no-default-features -F "kvm,mshv2,seccomp"'} else {"--no-default-features -F seccomp," + features } }} test_metrics --profile={{ if target == "debug" {"dev"} else { target } }} -- --ignored --test-threads=1 diff --git a/README.md b/README.md index 55e370b..cbbf8f4 100644 --- a/README.md +++ b/README.md @@ -54,11 +54,11 @@ You should also add your user to the kvm group: `sudo adduser $USER kvm` ## Building -NOTE: Ensure that you use version 1.82.0 of rust toolchain. +NOTE: Ensure that you use version 1.85.0 of rust toolchain. ```Console -rustup install 1.82.0 -rustup default 1.82.0 +rustup install 1.85.0 +rustup default 1.85.0 ``` Now you can build the Rust Wasm library: @@ -84,7 +84,7 @@ cargo run --example helloworld Hyperlight-Wasm has experimental support for running WebAssembly Component Model components, rather than core wasm modules. In this -mode, set the `HYPERLIGHT_WASM_WORLD` environment variable to point to +mode, set the `WIT_WORLD` environment variable to point to a binary encoding of a component type (e.g. the result of running `wasm-tools component wit -w -o /path/to/output.wasm /path/to/input.wit`), which will ensure that the resultant library @@ -94,15 +94,6 @@ generate bindings from the same component type in the host. For a complete (albeit small) example of this, see [this example](https://aka.ms/hyperlight-wasm-sockets-sample). -> [!NOTE] -> Currently, component model support in Hyperlight-Wasm requires using -> [the `hyperlight-component-macro` branch of core -> hyperlight](https://github.com/hyperlight-dev/hyperlight/pull/376). The -> Hyperlight-Wasm [`Cargo.toml`](./Cargo.toml) already depends on this -> version, rather than the published one, but you should be careful to -> use the same dependency specification to avoid Cargo pulling two -> instances of core hyperlight into your dependency graph. - ## Code of Conduct This project has adopted the [Microsoft Open Source Code of diff --git a/RustDev.md b/RustDev.md index 4d4ebf5..c5bc180 100644 --- a/RustDev.md +++ b/RustDev.md @@ -19,11 +19,11 @@ component type of the relevant encoding (of the form produced by encoding a WIT package; in particular, instance imports/exports need WIT-formatted "wit:package/instance@version" names) needs to be available at compile-time. To enable this world, set -`HYPERLIGHT_WASM_WORLD` when building `hyperlight-wasm`: +`WIT_WORLD` when building `hyperlight-wasm`: ```sh wasm-tools component wit -w -o world.wasm world.wit -export HYPERLIGHT_WASM_WORLD=$(readlink -f world.wasm) +export WIT_WORLD=$(readlink -f world.wasm) ``` ## `ProtoWasmSandbox` vs `WasmSandbox` vs `LoadedWasmSandbox` diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 2e2b8c8..c1bc0a6 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "1.82.0" +channel = "1.85.0" diff --git a/src/examples_common/Cargo.toml b/src/examples_common/Cargo.toml index e849404..99a71e7 100644 --- a/src/examples_common/Cargo.toml +++ b/src/examples_common/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "examples_common" version = "0.9.0" -edition = "2021" +edition = "2024" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] diff --git a/src/examples_common/src/lib.rs b/src/examples_common/src/lib.rs index 5a13ff3..43106ec 100644 --- a/src/examples_common/src/lib.rs +++ b/src/examples_common/src/lib.rs @@ -17,7 +17,7 @@ limitations under the License. use std::env; use std::path::Path; -use hyperlight_host::{new_error, Result}; +use hyperlight_host::{Result, new_error}; /// Get the Wasm module called `name` from the standard module location /// at `$REPO_ROOT/x64/[debug|release]/$name`. diff --git a/src/hyperlight_wasm/Cargo.toml b/src/hyperlight_wasm/Cargo.toml index f6fe43c..80834e7 100644 --- a/src/hyperlight_wasm/Cargo.toml +++ b/src/hyperlight_wasm/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "hyperlight-wasm" version = "0.1.0" -edition = "2021" -rust-version = "1.82" +edition = "2024" +rust-version = "1.85" include = ["*"] # Make sure wasm_runtime is included! [lib] @@ -68,7 +68,6 @@ crashdump = ["hyperlight-host/crashdump"] kvm = ["hyperlight-host/kvm"] mshv2 = ["hyperlight-host/mshv2"] mshv3 = ["hyperlight-host/mshv3"] -inprocess = ["hyperlight-host/inprocess"] [[bench]] name = "benchmarks" diff --git a/src/hyperlight_wasm/benches/benchmarks.rs b/src/hyperlight_wasm/benches/benchmarks.rs index 496b35a..5ef49d7 100644 --- a/src/hyperlight_wasm/benches/benchmarks.rs +++ b/src/hyperlight_wasm/benches/benchmarks.rs @@ -14,11 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -use std::sync::{Arc, Mutex}; - -use criterion::{criterion_group, criterion_main, Bencher, Criterion}; +use criterion::{Bencher, Criterion, criterion_group, criterion_main}; use hyperlight_host::HyperlightError; -use hyperlight_wasm::{LoadedWasmSandbox, ParameterValue, Result, ReturnType, SandboxBuilder}; +use hyperlight_wasm::{LoadedWasmSandbox, Result, SandboxBuilder}; fn get_time_since_boot_microsecond() -> Result { let res = std::time::SystemTime::now() @@ -35,11 +33,7 @@ fn wasm_guest_call_benchmark(c: &mut Criterion) { b.iter(|| { loaded_wasm_sandbox - .call_guest_function( - "Echo", - Some(vec![ParameterValue::String("Hello World!".to_string())]), - ReturnType::String, - ) + .call_guest_function::("Echo", "Hello World!".to_string()) .unwrap() }); }; @@ -75,13 +69,10 @@ fn wasm_sandbox_benchmark(c: &mut Criterion) { fn get_loaded_wasm_sandbox(ext: &str) -> LoadedWasmSandbox { let mut sandbox = SandboxBuilder::new().build().unwrap(); - let get_time_since_boot_microsecond_func = - Arc::new(Mutex::new(get_time_since_boot_microsecond)); - sandbox - .register_host_func_0( + .register( "GetTimeSinceBootMicrosecond", - &get_time_since_boot_microsecond_func, + get_time_since_boot_microsecond, ) .unwrap(); diff --git a/src/hyperlight_wasm/build.rs b/src/hyperlight_wasm/build.rs index e964979..c997b5f 100644 --- a/src/hyperlight_wasm/build.rs +++ b/src/hyperlight_wasm/build.rs @@ -45,7 +45,7 @@ fn build_wasm_runtime() -> PathBuf { let _ = std::io::stdout() .write_all(AsRef::::as_ref(&in_repo_dir).as_encoded_bytes()); println!(); - println!("cargo::rerun-if-env-changed=HYPERLIGHT_WASM_WORLD"); + println!("cargo::rerun-if-env-changed=WIT_WORLD"); // the PROFILE env var unfortunately only gives us 1 bit of "dev or release" let cargo_profile = if profile == "debug" { "dev" } else { "release" }; let mut cmd = std::process::Command::new("cargo"); diff --git a/src/hyperlight_wasm/examples/helloworld/main.rs b/src/hyperlight_wasm/examples/helloworld/main.rs index 4b277e4..409204f 100644 --- a/src/hyperlight_wasm/examples/helloworld/main.rs +++ b/src/hyperlight_wasm/examples/helloworld/main.rs @@ -14,11 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. */ -use std::sync::{Arc, Mutex}; - use examples_common::get_wasm_module_path; use hyperlight_host::HyperlightError; -use hyperlight_wasm::{ParameterValue, Result, ReturnType, ReturnValue, SandboxBuilder}; +use hyperlight_wasm::{Result, SandboxBuilder}; fn get_time_since_boot_microsecond() -> Result { let res = std::time::SystemTime::now() @@ -32,52 +30,35 @@ fn main() -> Result<()> { ( "HelloWorld.wasm", "HelloWorld", - Some(vec![ParameterValue::String( - "Message from Rust Example to Wasm Function".to_string(), - )]), + "Message from Rust Example to Wasm Function".to_string(), ), ( "HelloWorld.aot", "HelloWorld", - Some(vec![ParameterValue::String( - "Message from Rust Example to Wasm Function".to_string(), - )]), + "Message from Rust Example to Wasm Function".to_string(), ), ( "RunWasm.wasm", "Echo", - Some(vec![ParameterValue::String( - "Message from Rust Example to Wasm Function".to_string(), - )]), + "Message from Rust Example to Wasm Function".to_string(), ), ( "RunWasm.aot", "Echo", - Some(vec![ParameterValue::String( - "Message from Rust Example to Wasm Function".to_string(), - )]), + "Message from Rust Example to Wasm Function".to_string(), ), ]; for (idx, case) in tests.iter().enumerate() { let (mod_path, fn_name, params_opt) = case; - #[cfg(all(debug_assertions, feature = "inprocess"))] - let mut sandbox = SandboxBuilder::new() - .with_sandbox_running_in_process() - .build()?; - - #[cfg(not(all(debug_assertions, feature = "inprocess")))] let mut sandbox = SandboxBuilder::new().build()?; let wasm_sandbox = match mod_path.starts_with("RunWasm") { true => { - let get_time_since_boot_microsecond_func = - Arc::new(Mutex::new(get_time_since_boot_microsecond)); - sandbox - .register_host_func_0( + .register( "GetTimeSinceBootMicrosecond", - &get_time_since_boot_microsecond_func, + get_time_since_boot_microsecond, ) .unwrap(); @@ -93,14 +74,8 @@ fn main() -> Result<()> { if *fn_name == "Echo" { // Call a function in the Wasm module - let ReturnValue::String(result) = loaded_wasm_sandbox.call_guest_function( - fn_name, - params_opt.clone(), - ReturnType::String, - )? - else { - panic!("Failed to get result from call_guest_function to Echo Function") - }; + let result: String = + loaded_wasm_sandbox.call_guest_function(fn_name, params_opt.clone())?; println!( "Result from calling Echo Function in Wasm Module \ test case {idx}) is: {}", @@ -108,14 +83,8 @@ fn main() -> Result<()> { ); } else if *fn_name == "HelloWorld" { // Call a function in the Wasm module - let ReturnValue::Int(result) = loaded_wasm_sandbox.call_guest_function( - fn_name, - params_opt.clone(), - ReturnType::Int, - )? - else { - panic!("Failed to get result from call_guest_function to HelloWorld Function") - }; + let result: i32 = + loaded_wasm_sandbox.call_guest_function(fn_name, params_opt.clone())?; println!( "Result from calling HelloWorld Function in Wasm Module \ diff --git a/src/hyperlight_wasm/examples/hostfuncs/main.rs b/src/hyperlight_wasm/examples/hostfuncs/main.rs index 1b15a13..255eda9 100644 --- a/src/hyperlight_wasm/examples/hostfuncs/main.rs +++ b/src/hyperlight_wasm/examples/hostfuncs/main.rs @@ -14,10 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -use std::sync::{Arc, Mutex}; - use examples_common::get_wasm_module_path; -use hyperlight_wasm::{ParameterValue, Result, ReturnType, ReturnValue, SandboxBuilder}; +use hyperlight_wasm::SandboxBuilder; fn main() { // Create a Wasm Sandbox (this is running in the local Hypervisor) @@ -29,16 +27,13 @@ fn main() { .unwrap(); // Create a host-provided function and register it on the WasmSandbox. - // - // Note that you must wrap the function in an Arc/Mutex before you - // pass it into the register_host_func_1 method below. - let host_func = Arc::new(Mutex::new(|a: i32| -> Result { + let host_func = |a: i32| { println!("host_func called with {}", a); - Ok(a + 1) - })); + a + 1 + }; proto_wasm_sandbox - .register_host_func_1("TestHostFunc", &host_func) + .register("TestHostFunc", host_func) .unwrap(); let wasm_sandbox = proto_wasm_sandbox.load_runtime().unwrap(); @@ -49,16 +44,9 @@ fn main() { } .unwrap(); - let ReturnValue::Int(result) = loaded_wasm_sandbox - .call_guest_function( - "call_host_function", - Some(vec![ParameterValue::Int(5)]), - ReturnType::Int, - ) - .unwrap() - else { - panic!("Failed to get result from call_guest_function") - }; + let result: i32 = loaded_wasm_sandbox + .call_guest_function("call_host_function", 5i32) + .unwrap(); println!("got result: {:?} from the host function!", result); } diff --git a/src/hyperlight_wasm/examples/metrics/main.rs b/src/hyperlight_wasm/examples/metrics/main.rs index 9a7cea3..5266952 100644 --- a/src/hyperlight_wasm/examples/metrics/main.rs +++ b/src/hyperlight_wasm/examples/metrics/main.rs @@ -14,10 +14,8 @@ See the License for the specific language governing permissions and limitations under the License. */ -use std::sync::{Arc, Mutex}; - use examples_common::get_wasm_module_path; -use hyperlight_wasm::{ParameterValue, Result, ReturnType, SandboxBuilder}; +use hyperlight_wasm::{Result, SandboxBuilder}; fn main() -> Result<()> { // Install prometheus metrics exporter. @@ -29,17 +27,16 @@ fn main() -> Result<()> { .expect("Failed to install Prometheus exporter"); for _ in 0..10 { - let host_func = Arc::new(Mutex::new(|a: i32| -> Result { + let host_func = |a: i32| { println!("host_func called with {}", a); - Ok(a + 1) - })); + a + 1 + }; let mut wasm_sandbox = SandboxBuilder::new() - .with_guest_function_call_max_cancel_wait_millis(100) .with_guest_input_buffer_size(1000000) .build()?; - wasm_sandbox.register_host_func_1("TestHostFunc", &host_func)?; + wasm_sandbox.register("TestHostFunc", host_func)?; let wasm_sandbox = wasm_sandbox.load_runtime()?; @@ -47,11 +44,7 @@ fn main() -> Result<()> { wasm_sandbox.load_module(get_wasm_module_path("rust_wasm_samples.wasm")?)?; loaded_wasm_sandbox - .call_guest_function( - "add", - Some(vec![ParameterValue::Int(5), ParameterValue::Int(10)]), - ReturnType::Int, - ) + .call_guest_function::("add", (5i32, 10i32)) .unwrap(); } diff --git a/src/hyperlight_wasm/examples/rust_wasm_examples/main.rs b/src/hyperlight_wasm/examples/rust_wasm_examples/main.rs index 186e750..77bb698 100644 --- a/src/hyperlight_wasm/examples/rust_wasm_examples/main.rs +++ b/src/hyperlight_wasm/examples/rust_wasm_examples/main.rs @@ -14,34 +14,36 @@ See the License for the specific language governing permissions and limitations under the License. */ -use std::sync::{Arc, Mutex}; - use examples_common::get_wasm_module_path; -use hyperlight_wasm::{ParameterValue, Result, ReturnType, ReturnValue, SandboxBuilder}; +use hyperlight_wasm::{LoadedWasmSandbox, Result, SandboxBuilder}; fn main() -> Result<()> { - let tests = [ - ("hello_world", None), - ( - "add", - Some(vec![ParameterValue::Int(5), ParameterValue::Int(3)]), - ), - ("call_host_function", Some(vec![ParameterValue::Int(5)])), + type TestFn = fn(&mut LoadedWasmSandbox) -> Result; + let tests: &[(String, TestFn)] = &[ + ("hello_world".to_string(), |sb| { + sb.call_guest_function("hello_world", ()) + }), + ("add".to_string(), |sb| { + sb.call_guest_function("add", (5i32, 3i32)) + }), + ("call_host_function".to_string(), |sb| { + sb.call_guest_function("call_host_function", 5i32) + }), ]; for (idx, case) in tests.iter().enumerate() { - let (fn_name, params_opt) = case; - let host_func = Arc::new(Mutex::new(|a: i32| -> Result { + let (fn_name, func) = case; + let host_func = |a: i32| { println!("host_func called with {}", a); - Ok(a + 1) - })); + a + 1 + }; let mut proto_wasm_sandbox = SandboxBuilder::new() .with_guest_input_buffer_size(256 * 1024) .with_guest_heap_size(768 * 1024) .build()?; - proto_wasm_sandbox.register_host_func_1("TestHostFunc", &host_func)?; + proto_wasm_sandbox.register("TestHostFunc", host_func)?; let wasm_sandbox = proto_wasm_sandbox.load_runtime()?; let mod_path = get_wasm_module_path("rust_wasm_samples.wasm")?; @@ -50,14 +52,7 @@ fn main() -> Result<()> { let mut loaded_wasm_sandbox = wasm_sandbox.load_module(mod_path)?; // Call a function in the Wasm module - let ReturnValue::Int(result) = loaded_wasm_sandbox.call_guest_function( - fn_name, - params_opt.clone(), - ReturnType::Int, - )? - else { - panic!("Failed to get result from call_guest_function") - }; + let result: i32 = func(&mut loaded_wasm_sandbox)?; println!("test case {idx} fn_name: {fn_name}\nresult: {}", result) } diff --git a/src/hyperlight_wasm/src/lib.rs b/src/hyperlight_wasm/src/lib.rs index e287d56..53f8870 100644 --- a/src/hyperlight_wasm/src/lib.rs +++ b/src/hyperlight_wasm/src/lib.rs @@ -22,7 +22,6 @@ pub mod build_info; mod sandbox; use build_info::BuildInfo; -use hyperlight_host::func::HostFunction1; pub use sandbox::loaded_wasm_sandbox::LoadedWasmSandbox; pub use sandbox::proto_wasm_sandbox::ProtoWasmSandbox; pub use sandbox::sandbox_builder::SandboxBuilder; @@ -38,13 +37,8 @@ pub type ReturnType = hyperlight_host::func::ReturnType; pub type Result = hyperlight_host::Result; /// Check if there is a hypervisor present pub use hyperlight_host::is_hypervisor_present; -/// Set the metrics registry for hyperlight -pub use hyperlight_host::metrics::set_metrics_registry; /// Create a generic HyperlightError pub use hyperlight_host::new_error; -/// The function to pass to a new `WASMSandbox` to tell it how to handle -/// guest requests to print some output. -pub type HostPrintFn<'a> = &'a dyn HostFunction1<'a, String, i32>; /// Get the build information for this version of hyperlight-wasm pub fn get_build_info() -> BuildInfo { diff --git a/src/hyperlight_wasm/src/sandbox/loaded_wasm_sandbox.rs b/src/hyperlight_wasm/src/sandbox/loaded_wasm_sandbox.rs index f1cd0d0..d0f4486 100644 --- a/src/hyperlight_wasm/src/sandbox/loaded_wasm_sandbox.rs +++ b/src/hyperlight_wasm/src/sandbox/loaded_wasm_sandbox.rs @@ -14,15 +14,19 @@ See the License for the specific language governing permissions and limitations under the License. */ +use std::sync::Arc; + +use hyperlight_host::func::{ParameterTuple, SupportedReturnType}; +// re-export the InterruptHandle trait as it's part of the public API +pub use hyperlight_host::hypervisor::InterruptHandle; use hyperlight_host::sandbox::Callable; use hyperlight_host::sandbox_state::sandbox::{DevolvableSandbox, Sandbox}; use hyperlight_host::sandbox_state::transition::Noop; -use hyperlight_host::{log_then_return, MultiUseSandbox, Result}; +use hyperlight_host::{MultiUseSandbox, Result, log_then_return, new_error}; use super::metrics::METRIC_TOTAL_LOADED_WASM_SANDBOXES; use super::wasm_sandbox::WasmSandbox; use crate::sandbox::metrics::{METRIC_ACTIVE_LOADED_WASM_SANDBOXES, METRIC_SANDBOX_UNLOADS}; -use crate::{ParameterValue, ReturnType, ReturnValue}; /// A sandbox that has both a Wasm engine and an arbitrary Wasm module /// loaded into memory. @@ -50,14 +54,13 @@ impl LoadedWasmSandbox { /// On success, return an `Ok` with the return /// value and a new copy of `Self` suitable for further use. On failure, /// return an appropriate `Err`. - pub fn call_guest_function( + pub fn call_guest_function( &mut self, fn_name: &str, - params: Option>, - return_type: ReturnType, - ) -> Result { + params: impl ParameterTuple, + ) -> Result { match &mut self.inner { - Some(inner) => inner.call_guest_function_by_name(fn_name, return_type, params), + Some(inner) => inner.call_guest_function_by_name(fn_name, params), None => log_then_return!("No inner MultiUseSandbox to call_guest_function"), } } @@ -73,16 +76,27 @@ impl LoadedWasmSandbox { metrics::counter!(METRIC_TOTAL_LOADED_WASM_SANDBOXES).increment(1); Ok(LoadedWasmSandbox { inner: Some(inner) }) } + + /// Get a handle to the interrupt handler for this sandbox, + /// capable of interrupting guest execution. + pub fn interrupt_handle(&self) -> Result> { + if let Some(inner) = &self.inner { + Ok(inner.interrupt_handle()) + } else { + Err(new_error!( + "WasmSandbox is None, cannot get interrupt handle" + )) + } + } } impl Callable for LoadedWasmSandbox { - fn call( + fn call( &mut self, func_name: &str, - func_ret_type: ReturnType, - args: Option>, - ) -> Result { - self.call_guest_function(func_name, args, func_ret_type) + args: impl ParameterTuple, + ) -> Result { + self.call_guest_function(func_name, args) } } @@ -108,17 +122,17 @@ impl Drop for LoadedWasmSandbox { #[cfg(test)] mod tests { - use std::sync::{Arc, Mutex}; + use std::sync::Arc; use std::thread; use crossbeam_queue::ArrayQueue; use examples_common::get_wasm_module_path; - use hyperlight_host::{new_error, HyperlightError}; + use hyperlight_host::{HyperlightError, new_error}; - use super::{LoadedWasmSandbox, ParameterValue, ReturnType, ReturnValue, WasmSandbox}; + use super::{LoadedWasmSandbox, WasmSandbox}; + use crate::Result; use crate::sandbox::proto_wasm_sandbox::ProtoWasmSandbox; use crate::sandbox::sandbox_builder::SandboxBuilder; - use crate::Result; fn get_time_since_boot_microsecond() -> Result { let res = std::time::SystemTime::now() @@ -134,13 +148,10 @@ mod tests { for ext in [".aot", ".wasm"].iter() { let mut sandbox = ProtoWasmSandbox::default(); - let get_time_since_boot_microsecond_func = - Arc::new(Mutex::new(get_time_since_boot_microsecond)); - sandbox - .register_host_func_0( + .register( "GetTimeSinceBootMicrosecond", - &get_time_since_boot_microsecond_func, + get_time_since_boot_microsecond, ) .unwrap(); @@ -166,13 +177,10 @@ mod tests { println!("Creating WasmSandbox instance {}", i); let mut sandbox = ProtoWasmSandbox::default(); - let get_time_since_boot_microsecond_func = - Arc::new(Mutex::new(get_time_since_boot_microsecond)); - sandbox - .register_host_func_0( + .register( "GetTimeSinceBootMicrosecond", - &get_time_since_boot_microsecond_func, + get_time_since_boot_microsecond, ) .unwrap(); @@ -266,18 +274,13 @@ mod tests { let mut sandbox = SandboxBuilder::new() .with_guest_stack_size(32 * 1024) .with_guest_heap_size(128 * 1024) - .with_guest_error_buffer_size(4096) - .with_guest_function_call_max_execution_time_millis(5000) .build() .unwrap(); - let get_time_since_boot_microsecond_func = - Arc::new(Mutex::new(get_time_since_boot_microsecond)); - sandbox - .register_host_func_0( + .register( "GetTimeSinceBootMicrosecond", - &get_time_since_boot_microsecond_func, + get_time_since_boot_microsecond, ) .unwrap(); @@ -296,7 +299,7 @@ mod tests { #[test] fn test_call_host_func_with_vecbytes() { - let host_func = Arc::new(Mutex::new(|b: Vec, l: i32| -> Result { + let host_func = |b: Vec, l: i32| { // get the C String from the vec of bytes let s = std::str::from_utf8(&b).unwrap(); @@ -310,14 +313,14 @@ mod tests { if l != 12 { return Err(new_error!("Unexpected length of buffer {}", l)); } - Ok(0) - })); + Ok(0i32) + }; for ext in [".aot", ".wasm"].iter() { let mut proto_wasm_sandbox = SandboxBuilder::new().build().unwrap(); proto_wasm_sandbox - .register_host_func_2("HostFuncWithBufferAndLength", &host_func) + .register("HostFuncWithBufferAndLength", host_func) .unwrap(); let wasm_sandbox = proto_wasm_sandbox.load_runtime().unwrap(); @@ -331,12 +334,9 @@ mod tests { // Call a guest function that calls a host function that takes a buffer and a length - let ReturnValue::Int(r) = loaded_wasm_sandbox - .call_guest_function("PassBufferAndLengthToHost", None, ReturnType::Int) - .unwrap() - else { - panic!("Failed to get result from call_guest_function",) - }; + let r: i32 = loaded_wasm_sandbox + .call_guest_function("PassBufferAndLengthToHost", ()) + .unwrap(); assert_eq!(r, 0); } @@ -349,19 +349,9 @@ mod tests { // Call a guest function that returns an int for i in 0..iterations { - let ReturnValue::Int(result) = loaded_wasm_sandbox - .call_guest_function( - "CalcFib", - Some(vec![ParameterValue::Int(4)]), - ReturnType::Int, - ) - .unwrap() - else { - panic!( - "Failed to get result from call_guest_function iteration {}", - i - ) - }; + let result: i32 = loaded_wasm_sandbox + .call_guest_function("CalcFib", 4i32) + .unwrap(); println!( "Got result: {:?} from the host function! iteration {}", @@ -372,21 +362,12 @@ mod tests { // Call a guest function that returns a string for i in 0..iterations { - let ReturnValue::String(result) = loaded_wasm_sandbox + let result: String = loaded_wasm_sandbox .call_guest_function( "Echo", - Some(vec![ParameterValue::String( - "Message from Rust Example to Wasm Function".to_string(), - )]), - ReturnType::String, - ) - .unwrap() - else { - panic!( - "Failed to get result from call_guest_function iteration {}", - i + "Message from Rust Example to Wasm Function".to_string(), ) - }; + .unwrap(); println!( "Got result: {:?} from the host function! iteration {}", @@ -395,21 +376,12 @@ mod tests { } for i in 0..iterations { - let ReturnValue::String(result) = loaded_wasm_sandbox + let result: String = loaded_wasm_sandbox .call_guest_function( "ToUpper", - Some(vec![ParameterValue::String( - "Message from Rust Example to WASM Function".to_string(), - )]), - ReturnType::String, - ) - .unwrap() - else { - panic!( - "Failed to get result from call_guest_function iteration {}", - i + "Message from Rust Example to WASM Function".to_string(), ) - }; + .unwrap(); println!( "Got result: {:?} from the host function! iteration {}", @@ -425,22 +397,9 @@ mod tests { // Call a guest function that returns a size prefixed buffer for i in 0..iterations { - let ReturnValue::VecBytes(result) = loaded_wasm_sandbox - .call_guest_function( - "ReceiveByteArray", - Some(vec![ - ParameterValue::VecBytes(vec![0x01, 0x02, 0x03]), - ParameterValue::Int(3), - ]), - ReturnType::VecBytes, - ) - .unwrap() - else { - panic!( - "Failed to get result from call_guest_function iteration {}", - i - ) - }; + let result: Vec = loaded_wasm_sandbox + .call_guest_function("ReceiveByteArray", (vec![0x01, 0x02, 0x03], 3i32)) + .unwrap(); println!( "Got result: {:?} from the host function! iteration {}", @@ -451,21 +410,12 @@ mod tests { // Call a guest function that Prints a string using HostPrint Host function for i in 0..iterations { - let ReturnValue::Void = loaded_wasm_sandbox - .call_guest_function( + loaded_wasm_sandbox + .call_guest_function::<()>( "Print", - Some(vec![ParameterValue::String( - "Message from Rust Example to Wasm Function\n".to_string(), - )]), - ReturnType::Void, - ) - .unwrap() - else { - panic!( - "Failed to get result from call_guest_function iteration {}", - i + "Message from Rust Example to Wasm Function\n".to_string(), ) - }; + .unwrap(); println!("Called the host function! iteration {}", i,); } @@ -473,15 +423,9 @@ mod tests { // Call a guest function that calls prints a string constant using printf for i in 0..iterations { - let ReturnValue::Void = loaded_wasm_sandbox - .call_guest_function("PrintHelloWorld", None, ReturnType::Void) - .unwrap() - else { - panic!( - "Failed to get result from call_guest_function iteration {}", - i - ) - }; + loaded_wasm_sandbox + .call_guest_function::<()>("PrintHelloWorld", ()) + .unwrap(); println!("Called the host function! iteration {}", i,); } diff --git a/src/hyperlight_wasm/src/sandbox/proto_wasm_sandbox.rs b/src/hyperlight_wasm/src/sandbox/proto_wasm_sandbox.rs index 7e20011..551096c 100644 --- a/src/hyperlight_wasm/src/sandbox/proto_wasm_sandbox.rs +++ b/src/hyperlight_wasm/src/sandbox/proto_wasm_sandbox.rs @@ -15,26 +15,19 @@ limitations under the License. */ use hyperlight_host::func::call_ctx::MultiUseGuestCallContext; -use hyperlight_host::func::host_functions::{HostFunctionDefinition, Registerable}; -use hyperlight_host::func::{ - HostFunction0, HostFunction1, HostFunction2, HostFunction3, HyperlightFunction, - SupportedParameterType, SupportedReturnType, -}; -use hyperlight_host::sandbox::config::SandboxConfiguration; +use hyperlight_host::func::{HostFunction, ParameterTuple, Registerable, SupportedReturnType}; use hyperlight_host::sandbox::Callable; #[cfg(all(feature = "seccomp", target_os = "linux"))] use hyperlight_host::sandbox::ExtraAllowedSyscall; +use hyperlight_host::sandbox::config::SandboxConfiguration; use hyperlight_host::sandbox_state::sandbox::{EvolvableSandbox, Sandbox}; use hyperlight_host::sandbox_state::transition::{MultiUseContextCallback, Noop}; -use hyperlight_host::{ - new_error, GuestBinary, MultiUseSandbox, Result, SandboxRunOptions, UninitializedSandbox, -}; +use hyperlight_host::{GuestBinary, MultiUseSandbox, Result, UninitializedSandbox, new_error}; use super::metrics::{METRIC_ACTIVE_PROTO_WASM_SANDBOXES, METRIC_TOTAL_PROTO_WASM_SANDBOXES}; use super::sandbox_builder::SandboxBuilder; use super::wasm_sandbox::WasmSandbox; use crate::build_info::BuildInfo; -use crate::{HostPrintFn, ReturnType, ReturnValue}; /// A Hyperlight Sandbox with no Wasm run time loaded and no guest module code loaded. /// This is used to register new host functions that can be called by guest code. @@ -49,31 +42,31 @@ pub struct ProtoWasmSandbox { impl Sandbox for ProtoWasmSandbox {} impl Registerable for ProtoWasmSandbox { - fn register_host_function( + fn register_host_function( &mut self, - hfd: &HostFunctionDefinition, - hf: HyperlightFunction, + name: &str, + hf: impl Into>, ) -> Result<()> { self.inner .as_mut() .ok_or(new_error!("inner sandbox was none")) - .and_then(|sb| sb.register_host_function(hfd, hf)) + .and_then(|sb| sb.register(name, hf)) } #[cfg(all(feature = "seccomp", target_os = "linux"))] - fn register_host_function_with_syscalls( + fn register_host_function_with_syscalls( &mut self, - hfd: &HostFunctionDefinition, - hf: HyperlightFunction, + name: &str, + hf: impl Into>, eas: Vec, ) -> Result<()> { self.inner .as_mut() .ok_or(new_error!("inner sandbox was none")) - .and_then(|sb| sb.register_host_function_with_syscalls(hfd, hf, eas)) + .and_then(|sb| sb.register_host_function_with_syscalls(name, hf, eas)) } } -impl<'a> ProtoWasmSandbox { +impl ProtoWasmSandbox { /// Create a new sandbox complete with no Wasm runtime and no end-user /// code loaded. Since there's no user code or runtime loaded, the returned /// sandbox cannot execute anything. @@ -86,12 +79,10 @@ impl<'a> ProtoWasmSandbox { /// fields in the `SandboxConfiguration` struct. pub(super) fn new( cfg: Option, - opts: Option, guest_binary: GuestBinary, - host_print_fn: Option>, ) -> Result { BuildInfo::log(); - let inner = UninitializedSandbox::new(guest_binary, cfg, opts, host_print_fn)?; + let inner = UninitializedSandbox::new(guest_binary, cfg)?; metrics::gauge!(METRIC_ACTIVE_PROTO_WASM_SANDBOXES).increment(1); metrics::counter!(METRIC_TOTAL_PROTO_WASM_SANDBOXES).increment(1); Ok(Self { inner: Some(inner) }) @@ -110,8 +101,8 @@ impl<'a> ProtoWasmSandbox { }; let func = Box::new(move |call_ctx: &mut MultiUseGuestCallContext| { - let res = call_ctx.call("InitWasmRuntime", ReturnType::Int, None)?; - if res != ReturnValue::Int(0) { + let res: i32 = call_ctx.call("InitWasmRuntime", ())?; + if res != 0 { return Err(new_error!( "InitWasmRuntime Failed with error code {:?}", res @@ -127,156 +118,64 @@ impl<'a> ProtoWasmSandbox { Ok(WasmSandbox::new(new_sbox)) } - /// Register the given 0-parameter host function `func` with `self` under + /// Register the given host function `host_func` with `self` under /// the given `name`. Return `Ok` if the registration succeeded, and a /// descriptive `Err` otherwise. - pub fn register_host_func_0>( + pub fn register( &mut self, - name: &str, - func: &dyn HostFunction0<'a, R>, + name: impl AsRef, + host_func: impl Into>, ) -> Result<()> { - match &mut self.inner { - Some(inner) => func.register(inner, name), - None => Err(new_error!("inner sandbox was none")), - } - } - - /// Register the given 0-parameter host function `func` with `self` along with a vec of syscalls the - /// function requires and return `Ok` if the registration succeeded, and a descriptive `Err` if - /// it didn't. - #[cfg(all(feature = "seccomp", target_os = "linux"))] - pub fn register_host_func_with_extra_allowed_syscalls_0>( - &mut self, - name: &str, - func: &dyn HostFunction0<'a, R>, - extra_allowed_syscalls: Vec, - ) -> Result<()> { - match &mut self.inner { - Some(inner) => { - func.register_with_extra_allowed_syscalls(inner, name, extra_allowed_syscalls) - } - None => Err(new_error!("inner sandbox was none")), - } - } - - /// Register the given 1-parameter host function `func` with `self`, and - /// return `Ok` if the registration succeeded, and a descriptive `Err` if - /// it didn't. - pub fn register_host_func_1< - P1: SupportedParameterType + Clone + 'a, - R: SupportedReturnType, - >( - &mut self, - name: &str, - func: &dyn HostFunction1<'a, P1, R>, - ) -> Result<()> { - match &mut self.inner { - Some(inner) => func.register(inner, name), - None => Err(new_error!("inner sandbox was none")), - } - } - - /// Register the given 1-parameter host function `func` with `self` along with a vec of syscalls the - /// function requires and return `Ok` if the registration succeeded, and a descriptive `Err` if - /// it didn't. - #[cfg(all(feature = "seccomp", target_os = "linux"))] - pub fn register_host_func_with_extra_allowed_syscalls_1< - P1: SupportedParameterType + Clone + 'a, - R: SupportedReturnType, - >( - &mut self, - name: &str, - func: &dyn HostFunction1<'a, P1, R>, - extra_allowed_syscalls: Vec, - ) -> Result<()> { - match &mut self.inner { - Some(inner) => { - func.register_with_extra_allowed_syscalls(inner, name, extra_allowed_syscalls) - } - None => Err(new_error!("inner sandbox was none")), - } - } - - /// Register the given 2-parameter host function `func` with `self`, and - /// return `Ok` if the registration succeeded, and a descriptive `Err` if - /// it didn't. - pub fn register_host_func_2< - P1: SupportedParameterType + Clone + 'a, - P2: SupportedParameterType + Clone + 'a, - R: SupportedReturnType, - >( - &mut self, - name: &str, - func: &dyn HostFunction2<'a, P1, P2, R>, - ) -> Result<()> { - match &mut self.inner { - Some(inner) => func.register(inner, name), - None => Err(new_error!("inner sandbox was none")), - } + self.inner + .as_mut() + .ok_or(new_error!("inner sandbox was none"))? + .register(name, host_func) } - /// Register the given 2-parameter host function `func` with `self` along with a vec of syscalls the + /// Register the given host function `host_func` with `self` along with a vec of syscalls the /// function requires and return `Ok` if the registration succeeded, and a descriptive `Err` if /// it didn't. #[cfg(all(feature = "seccomp", target_os = "linux"))] - pub fn register_host_func_with_extra_allowed_syscalls_2< - P1: SupportedParameterType + Clone + 'a, - P2: SupportedParameterType + Clone + 'a, - R: SupportedReturnType, + pub fn register_with_extra_allowed_syscalls< + Args: ParameterTuple, + Output: SupportedReturnType, >( &mut self, - name: &str, - func: &dyn HostFunction2<'a, P1, P2, R>, - extra_allowed_syscalls: Vec, + name: impl AsRef, + host_func: impl Into>, + extra_allowed_syscalls: impl IntoIterator, ) -> Result<()> { - match &mut self.inner { - Some(inner) => { - func.register_with_extra_allowed_syscalls(inner, name, extra_allowed_syscalls) - } - None => Err(new_error!("inner sandbox was none")), - } + self.inner + .as_mut() + .ok_or(new_error!("inner sandbox was none"))? + .register_with_extra_allowed_syscalls(name, host_func, extra_allowed_syscalls) } - /// Register the given 3-parameter host function `func` with `self`, and - /// return `Ok` if the registration succeeded, and a descriptive `Err` if - /// it didn't. - pub fn register_host_func_3< - P1: SupportedParameterType + Clone + 'a, - P2: SupportedParameterType + Clone + 'a, - P3: SupportedParameterType + Clone + 'a, - R: SupportedReturnType, - >( + /// Register the given host printing function `print_func` with `self`. + /// Return `Ok` if the registration succeeded, and a descriptive `Err` otherwise. + pub fn register_print( &mut self, - name: &str, - func: &dyn HostFunction3<'a, P1, P2, P3, R>, + print_func: impl Into>, ) -> Result<()> { - match &mut self.inner { - Some(inner) => func.register(inner, name), - None => Err(new_error!("inner sandbox was none")), - } + self.inner + .as_mut() + .ok_or(new_error!("inner sandbox was none"))? + .register_print(print_func) } - /// Register the given 3-parameter host function `func` with `self` along with a vec of syscalls the - /// function requires and return `Ok` if the registration succeeded, and a descriptive `Err` if - /// it didn't. + /// Register the given host printing function `print_func` with `self` along with a + /// vec of syscalls the function requires. + /// Return `Ok` if the registration succeeded, and a descriptive `Err` otherwise. #[cfg(all(feature = "seccomp", target_os = "linux"))] - pub fn register_host_func_with_extra_allowed_syscalls_3< - P1: SupportedParameterType + Clone + 'a, - P2: SupportedParameterType + Clone + 'a, - P3: SupportedParameterType + Clone + 'a, - R: SupportedReturnType, - >( + pub fn register_print_with_extra_allowed_syscalls( &mut self, - name: &str, - func: &dyn HostFunction3<'a, P1, P2, P3, R>, - extra_allowed_syscalls: Vec, + print_func: impl Into>, + extra_allowed_syscalls: impl IntoIterator, ) -> Result<()> { - match &mut self.inner { - Some(inner) => { - func.register_with_extra_allowed_syscalls(inner, name, extra_allowed_syscalls) - } - None => Err(new_error!("inner sandbox was none")), - } + self.inner + .as_mut() + .ok_or(new_error!("inner sandbox was none"))? + .register_print_with_extra_allowed_syscalls(print_func, extra_allowed_syscalls) } } @@ -300,22 +199,18 @@ impl Drop for ProtoWasmSandbox { /// /// Once all guest functions have been loaded you can call `load_runtime` to load the Wasm runtme and get a `WasmSandbox`. /// - -// The default configuration is as follows: - -// The Hyperlight default Host Print implementation is used. -// The Sandbox will attempt to run in a hypervisor if and will fail if no Hypervisor is available. -// The Sandbox will have a stack size of 8K and a heap size of 64K -// The Sandbox will have a max execution time of 1000ms and a max wait for cancellation of 100ms -// All other Hyperlight configuration values will be set to their defaults. - -// This will result in a memory footprint for the VM backing the Sandbox of approximately 434K - +/// The default configuration is as follows: +/// +/// * The Hyperlight default Host Print implementation is used. +/// * The Sandbox will attempt to run in a hypervisor and will fail if no Hypervisor is available. +/// * The Sandbox will have a stack size of 8K and a heap size of 64K +/// * All other Hyperlight configuration values will be set to their defaults. +/// +/// This will result in a memory footprint for the VM backing the Sandbox of approximately 434K +/// /// Use the `load_runtime` method to /// load the Wasm runtime and convert the returned `ProtoWasmSandbox` /// into a `WasmSandbox` that can have a Wasm module loaded returning a `LoadedWasmSandbox` that can be used to call Wasm functions in the guest. -/// - impl Default for ProtoWasmSandbox { fn default() -> Self { SandboxBuilder::new().build().unwrap() diff --git a/src/hyperlight_wasm/src/sandbox/sandbox_builder.rs b/src/hyperlight_wasm/src/sandbox/sandbox_builder.rs index fc4ba61..7c92e74 100644 --- a/src/hyperlight_wasm/src/sandbox/sandbox_builder.rs +++ b/src/hyperlight_wasm/src/sandbox/sandbox_builder.rs @@ -14,36 +14,26 @@ See the License for the specific language governing permissions and limitations under the License. */ -use std::time::Duration; - -#[cfg(all(target_os = "windows", not(debug_assertions)))] -use hyperlight_host::new_error; +use hyperlight_host::func::HostFunction; use hyperlight_host::sandbox::SandboxConfiguration; -use hyperlight_host::{ - is_hypervisor_present, GuestBinary, HyperlightError, Result, SandboxRunOptions, -}; +use hyperlight_host::{GuestBinary, HyperlightError, Result, is_hypervisor_present}; use super::proto_wasm_sandbox::ProtoWasmSandbox; -use crate::HostPrintFn; // use unreasonably large minimum stack/heap/input data sizes for now to // deal with the size of wasmtime/wasi-libc aot artifacts pub const MIN_STACK_SIZE: u64 = 64 * 1024; pub const MIN_INPUT_DATA_SIZE: usize = 192 * 1024; pub const MIN_HEAP_SIZE: u64 = 1024 * 1024; -pub const MIN_GUEST_ERROR_BUFFER_SIZE: usize = 1024; /// A builder for WasmSandbox #[derive(Clone)] -pub struct SandboxBuilder<'a> { +pub struct SandboxBuilder { config: SandboxConfiguration, - opts: Option, - host_print_fn: Option>, - #[cfg(all(target_os = "windows", debug_assertions))] - guest_path: Option, + host_print_fn: Option>, } -impl<'a> SandboxBuilder<'a> { +impl SandboxBuilder { /// Create a new SandboxBuilder pub fn new() -> Self { let mut config: SandboxConfiguration = Default::default(); @@ -52,33 +42,16 @@ impl<'a> SandboxBuilder<'a> { Self { config, - opts: None, host_print_fn: None, - #[cfg(all(target_os = "windows", debug_assertions))] - guest_path: None, } } - #[cfg(all(feature = "inprocess", debug_assertions))] - /// Run the sandbox in-process - pub fn with_sandbox_running_in_process(mut self) -> Self { - self.opts = Some(SandboxRunOptions::RunInProcess(false)); - self - } - /// Set the host print function - pub fn with_host_print_fn(mut self, host_print_fn: HostPrintFn<'a>) -> Self { - self.host_print_fn = Some(host_print_fn); - self - } - - /// Set the guest error buffer size - /// The default (and minimum) value for this is set to the value of the MIN_GUEST_ERROR_BUFFER_SIZE const. - pub fn with_guest_error_buffer_size(mut self, guest_error_buffer_size: usize) -> Self { - if guest_error_buffer_size > MIN_GUEST_ERROR_BUFFER_SIZE { - self.config - .set_guest_error_buffer_size(MIN_GUEST_ERROR_BUFFER_SIZE); - } + pub fn with_host_print_fn( + mut self, + host_print_fn: impl Into>, + ) -> Self { + self.host_print_fn = Some(host_print_fn.into()); self } @@ -100,29 +73,6 @@ impl<'a> SandboxBuilder<'a> { self } - /// Set the host function definition buffer size - /// This is the size of the buffer that the host can write - /// details of the host functions that the guest can call - /// - pub fn with_host_function_buffer_size(mut self, host_function_buffer_size: usize) -> Self { - self.config - .set_host_function_definition_size(host_function_buffer_size); - self - } - - /// Set the host exception buffer size - /// This is the size of the buffer that the host can write to with - /// details of any exceptions/errors/panics that are thrown during host function execution - /// - /// It allows details of any exception or error that occurred in a host function called from the guest - /// to be captured and returned to the host via the guest as it is not possible to transparently return exception/error/panic - /// details from a host function to the guest as the guest/host boundary is a hard boundary - pub fn with_host_exception_buffer_size(mut self, host_exception_buffer_size: usize) -> Self { - self.config - .set_host_exception_size(host_exception_buffer_size); - self - } - /// Set the guest stack size /// This is the size of the stack that code executing in the guest can use. /// If this value is too small then the guest will fail with a stack overflow error @@ -145,40 +95,6 @@ impl<'a> SandboxBuilder<'a> { self } - /// Set the guest panic context buffer size - pub fn with_guest_panic_context_buffer_size(mut self, guest_panic_buffer_size: usize) -> Self { - self.config - .set_guest_panic_context_buffer_size(guest_panic_buffer_size); - self - } - - /// Set the max execution time for the guest function call - /// If the guest function call takes longer than this time then the guest function call will be terminated - /// and the guest function will return an error - pub fn with_guest_function_call_max_execution_time_millis( - mut self, - guest_function_call_max_execution_time: u64, - ) -> Self { - self.config.set_max_execution_time(Duration::from_millis( - guest_function_call_max_execution_time, - )); - self - } - - /// Set the max time to wait for cancellation of a guest function call - /// If cancellation of the guest function call takes longer than this time then the guest function call will be terminated - /// and the guest function will return an error - pub fn with_guest_function_call_max_cancel_wait_millis( - mut self, - guest_function_call_max_cancel_wait_time: u64, - ) -> Self { - self.config - .set_max_execution_cancel_wait_time(Duration::from_millis( - guest_function_call_max_cancel_wait_time, - )); - self - } - /// Get the current configuration pub fn get_config(&self) -> &SandboxConfiguration { &self.config @@ -186,41 +102,21 @@ impl<'a> SandboxBuilder<'a> { /// Build the ProtoWasmSandbox pub fn build(self) -> Result { - let guest_binary = match self.opts { - #[cfg(target_os = "windows")] - Some(SandboxRunOptions::RunInProcess(debug)) => match debug { - false => GuestBinary::Buffer(super::WASM_RUNTIME.to_vec()), - true => { - #[cfg(debug_assertions)] - { - let guest_path = self.guest_path.unwrap(); - GuestBinary::FilePath(guest_path) - } - #[cfg(not(debug_assertions))] - { - return Err(new_error!("Debugging is only supported in debug builds ")); - } - } - }, - _ => { - if !is_hypervisor_present() { - return Err(HyperlightError::NoHypervisorFound()); - } - GuestBinary::Buffer(super::WASM_RUNTIME.to_vec()) - } - }; - - let proto_wasm_sandbox = ProtoWasmSandbox::new( - Some(self.config), - self.opts, - guest_binary, - self.host_print_fn, - )?; + if !is_hypervisor_present() { + return Err(HyperlightError::NoHypervisorFound()); + } + + let guest_binary = GuestBinary::Buffer(&super::WASM_RUNTIME); + + let mut proto_wasm_sandbox = ProtoWasmSandbox::new(Some(self.config), guest_binary)?; + if let Some(host_print_fn) = self.host_print_fn { + proto_wasm_sandbox.register_print(host_print_fn)?; + } Ok(proto_wasm_sandbox) } } -impl<'a> Default for SandboxBuilder<'a> { +impl Default for SandboxBuilder { fn default() -> Self { Self::new() } diff --git a/src/hyperlight_wasm/src/sandbox/wasm_sandbox.rs b/src/hyperlight_wasm/src/sandbox/wasm_sandbox.rs index c961926..ee42e8f 100644 --- a/src/hyperlight_wasm/src/sandbox/wasm_sandbox.rs +++ b/src/hyperlight_wasm/src/sandbox/wasm_sandbox.rs @@ -20,13 +20,12 @@ use hyperlight_host::func::call_ctx::MultiUseGuestCallContext; use hyperlight_host::sandbox::Callable; use hyperlight_host::sandbox_state::sandbox::{EvolvableSandbox, Sandbox}; use hyperlight_host::sandbox_state::transition::MultiUseContextCallback; -use hyperlight_host::{new_error, MultiUseSandbox, Result}; +use hyperlight_host::{MultiUseSandbox, Result, new_error}; use super::loaded_wasm_sandbox::LoadedWasmSandbox; use crate::sandbox::metrics::{ METRIC_ACTIVE_WASM_SANDBOXES, METRIC_SANDBOX_LOADS, METRIC_TOTAL_WASM_SANDBOXES, }; -use crate::{ParameterValue, ReturnType, ReturnValue}; /// A sandbox with just the Wasm engine loaded into memory. `WasmSandbox`es /// are not yet ready to execute guest functions. @@ -76,11 +75,8 @@ impl WasmSandbox { fn load_module_inner(mut self, wasm_bytes: Vec) -> Result { let func = Box::new(move |call_ctx: &mut MultiUseGuestCallContext| { let len = wasm_bytes.len() as i32; - let p1 = ParameterValue::VecBytes(wasm_bytes); - let p2 = ParameterValue::Int(len); - - let res = call_ctx.call("LoadWasmModule", ReturnType::Int, Some(vec![p1, p2]))?; - if res != ReturnValue::Int(0) { + let res: i32 = call_ctx.call("LoadWasmModule", (wasm_bytes, len))?; + if res != 0 { return Err(new_error!( "LoadWasmModule Failed with error code {:?}", res @@ -118,9 +114,8 @@ impl Drop for WasmSandbox { mod tests { use std::env; use std::path::Path; - use std::sync::{Arc, Mutex}; - use hyperlight_host::{is_hypervisor_present, HyperlightError}; + use hyperlight_host::{HyperlightError, is_hypervisor_present}; use super::*; use crate::sandbox::sandbox_builder::SandboxBuilder; @@ -140,17 +135,11 @@ mod tests { #[test] fn test_termination() -> Result<()> { - let mut sandbox = SandboxBuilder::new() - .with_guest_function_call_max_execution_time_millis(1000) - .with_guest_function_call_max_cancel_wait_millis(1000) - .build()?; - - let get_time_since_boot_microsecond_func = - Arc::new(Mutex::new(get_time_since_boot_microsecond)); + let mut sandbox = SandboxBuilder::new().build()?; - sandbox.register_host_func_0( + sandbox.register( "GetTimeSinceBootMicrosecond", - &get_time_since_boot_microsecond_func, + get_time_since_boot_microsecond, )?; let loaded = sandbox.load_runtime()?; @@ -159,11 +148,14 @@ mod tests { let mut loaded = loaded.load_module(run_wasm)?; - let result = loaded.call_guest_function( - "KeepCPUBusy", - Some(vec![ParameterValue::Int(10000)]), - ReturnType::Int, - ); + let interrupt = loaded.interrupt_handle()?; + + std::thread::spawn(move || { + std::thread::sleep(std::time::Duration::from_millis(1000)); + interrupt.kill(); + }); + + let result = loaded.call_guest_function::("KeepCPUBusy", 10000i32); match result { Ok(_) => panic!("Expected error"), @@ -187,14 +179,8 @@ mod tests { let helloworld_wasm = get_test_file_path("HelloWorld.wasm").unwrap(); let mut loaded_wasm_sandbox = wasm_sandbox.load_module(helloworld_wasm).unwrap(); - let result = loaded_wasm_sandbox - .call_guest_function( - "HelloWorld", - Some(vec![ParameterValue::String( - "Message from Rust Test".to_string(), - )]), - ReturnType::Int, - ) + let result: i32 = loaded_wasm_sandbox + .call_guest_function("HelloWorld", "Message from Rust Test".to_string()) .unwrap(); // TODO: Validate the output from the Wasm Modules. @@ -216,14 +202,8 @@ mod tests { let mut loaded_wasm_sandbox = wasm_sandbox .load_module_from_buffer(&wasm_module_buffer) .unwrap(); - let result = loaded_wasm_sandbox - .call_guest_function( - "HelloWorld", - Some(vec![ParameterValue::String( - "Message from Rust Test".to_string(), - )]), - ReturnType::Int, - ) + let result: i32 = loaded_wasm_sandbox + .call_guest_function("HelloWorld", "Message from Rust Test".to_string()) .unwrap(); // TODO: Validate the output from the Wasm Modules. @@ -262,43 +242,17 @@ mod tests { Ok(full_path) } - /// Get the max execution time and the max wait time until cancellation - /// for a sandbox. For MSHV, both of these return values will be 100ms, - /// while for KVM (linux) and HyperV (windows), this function will return - /// 200ms for both values. - fn get_timeouts() -> (u64, u64) { - #[cfg(target_os = "linux")] - { - if is_hypervisor_present() { - return (200, 200); - } - (100, 100) - } - #[cfg(target_os = "windows")] - { - (200, 200) - } - } - struct SandboxTest { sbox: WasmSandbox, name: String, } fn get_test_wasm_sandboxes() -> Result> { - let (max_exec_time, max_cancel_wait) = get_timeouts(); - let builder = SandboxBuilder::new() - .with_guest_error_buffer_size(0x1000) .with_guest_input_buffer_size(0x8000) .with_guest_output_buffer_size(0x8000) - .with_host_function_buffer_size(0x1000) - .with_host_exception_buffer_size(0x1000) .with_guest_stack_size(0x2000) - .with_guest_heap_size(0x100000) - .with_guest_panic_context_buffer_size(0x800) - .with_guest_function_call_max_execution_time_millis(max_exec_time) - .with_guest_function_call_max_cancel_wait_millis(max_cancel_wait); + .with_guest_heap_size(0x100000); let mut sandboxes: Vec = Vec::new(); if is_hypervisor_present() { @@ -308,19 +262,6 @@ mod tests { }); } - #[cfg(all(debug_assertions, feature = "inprocess"))] - { - let sbox = builder - .clone() - .with_sandbox_running_in_process() - .build()? - .load_runtime()?; - - sandboxes.push(SandboxTest { - sbox, - name: "in-process, using manual load".to_string(), - }); - } Ok(sandboxes) } } diff --git a/src/hyperlight_wasm_aot/Cargo.toml b/src/hyperlight_wasm_aot/Cargo.toml index 88987ba..f13fbde 100644 --- a/src/hyperlight_wasm_aot/Cargo.toml +++ b/src/hyperlight_wasm_aot/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "hyperlight-wasm-aot" version = "0.1.0" -edition = "2021" +edition = "2024" [dependencies] wasmtime = { version = "30.0.2", default-features = false, features = ["cranelift", "runtime", "component-model" ] } diff --git a/src/hyperlight_wasm_macro/Cargo.toml b/src/hyperlight_wasm_macro/Cargo.toml index d364ff9..5827059 100644 --- a/src/hyperlight_wasm_macro/Cargo.toml +++ b/src/hyperlight_wasm_macro/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "hyperlight-wasm-macro" version = "0.1.0" -edition = "2021" +edition = "2024" description = """ Procedural macros to generate Hyperlight Wasm host and guest bindings from component types """ @@ -17,4 +17,4 @@ proc-macro2 = { version = "1.0.93" } syn = { version = "2.0.96" } itertools = { version = "0.14.0" } prettyplease = { version = "0.2.31" } -hyperlight-component-util = { git = "https://github.com/hyperlight-dev/hyperlight", branch = "hyperlight-component-macro" } \ No newline at end of file +hyperlight-component-util = { version = "0.6.1" } diff --git a/src/hyperlight_wasm_macro/src/lib.rs b/src/hyperlight_wasm_macro/src/lib.rs index 8666da2..5ed3f8a 100644 --- a/src/hyperlight_wasm_macro/src/lib.rs +++ b/src/hyperlight_wasm_macro/src/lib.rs @@ -21,16 +21,16 @@ mod wasmguest; /// Create the hyperlight_guest_wasm_init() function (called by /// wasm_runtime:component.rs) for the wasm component type located at -/// $HYPERLIGHT_WASM_WORLD. This function registers Hyperlight +/// $WIT_WORLD. This function registers Hyperlight /// functions for component exports (which are implemented by calling /// into wasmtime) and registers wasmtime host functions with the /// wasmtime linker for component imports (which are implemented by /// calling to the Hyperlight host). #[proc_macro] pub fn wasm_guest_bindgen(_: proc_macro::TokenStream) -> proc_macro::TokenStream { - let path = std::env::var_os("HYPERLIGHT_WASM_WORLD").unwrap(); + let path = std::env::var_os("WIT_WORLD").unwrap(); util::read_wit_type_from_file(path, |kebab_name, ct| { - let decls = emit::run_state(true, |s| { + let decls = emit::run_state(true, true, |s| { // Emit type/trait definitions for all instances in the world rtypes::emit_toplevel(s, &kebab_name, ct); // Emit the host/guest function registrations diff --git a/src/hyperlight_wasm_macro/src/wasmguest.rs b/src/hyperlight_wasm_macro/src/wasmguest.rs index ef9909c..a25eacf 100644 --- a/src/hyperlight_wasm_macro/src/wasmguest.rs +++ b/src/hyperlight_wasm_macro/src/wasmguest.rs @@ -24,8 +24,8 @@ limitations under the License. // the `Resources` struct with.) use hyperlight_component_util::emit::{ - kebab_to_fn, kebab_to_namespace, kebab_to_type, kebab_to_var, split_wit_name, FnName, State, - WitName, + FnName, State, WitName, kebab_to_fn, kebab_to_namespace, kebab_to_type, kebab_to_var, + split_wit_name, }; use hyperlight_component_util::etypes::{ self, Component, Defined, ExternDecl, ExternDesc, Handleable, Instance, Tyvar, @@ -87,14 +87,13 @@ fn emit_import_extern_decl<'a, 'b, 'c>( }; quote! { #li.func_wrap::<_, (#(#pts,)*), #rt>(#edkn, |_, (#(#pds,)*)| { - call_host_function( + let #ret = call_host_function::>( #fname, ::core::option::Option::Some(vec![#(#pus,)*]), ::hyperlight_common::flatbuffer_wrappers::function_types::ReturnType::VecBytes, ).unwrap(); - let #ret = ::hyperlight_guest::host_function_call::get_host_return_value::>().unwrap(); ::core::result::Result::Ok(#ur) - }); + }).unwrap(); } } ExternDesc::Type(t) => match t { @@ -145,10 +144,10 @@ fn emit_export_extern_decl<'a, 'b, 'c>( let n = match kebab_to_fn(ed.kebab_name) { FnName::Plain(n) => n, FnName::Associated(_, _) => { - panic!("resorurces exported from wasm not yet supported") + panic!("resources exported from wasm not yet supported") } }; - let nlit = n.unraw().to_string(); + let nlit = ed.kebab_name; let pts = ft.params.iter().map(|_| quote! { ::hyperlight_common::flatbuffer_wrappers::function_types::ParameterType::VecBytes }).collect::>(); let pwts = ft .params @@ -159,7 +158,7 @@ fn emit_export_extern_decl<'a, 'b, 'c>( let (pds, pus) = ft.params.iter().enumerate() .map(|(i, p)| { let id = kebab_to_var(p.name.name); - let pd = quote! { let ::hyperlight_common::flatbuffer_wrappers::ParameterValue::VecBytes(ref #id) = &fc.parameters.as_ref().unwrap()[#i]; }; + let pd = quote! { let ::hyperlight_common::flatbuffer_wrappers::function_types::ParameterValue::VecBytes(#id) = &fc.parameters.as_ref().unwrap()[#i] else { panic!("invariant violation: host passed non-VecBytes core hyperlight argument"); }; }; let pu = emit_hl_unmarshal_param(s, id, &p.ty); (pd, pu) }) @@ -179,10 +178,10 @@ fn emit_export_extern_decl<'a, 'b, 'c>( let func_idx = instance.get_export(&mut *store, instance_idx.as_ref(), #nlit).unwrap(); let #ret = instance.get_typed_func::<(#(#pwts,)*), (#rwt,)>(&mut *store, func_idx)? .call(&mut *store, (#(#pus,)*))?.0; - ::core::result::Result::Ok(#marshal_result) + ::core::result::Result::Ok(::hyperlight_common::flatbuffer_wrappers::util::get_flatbuffer_result::<&[u8]>(&#marshal_result)) } - ::hyperlight_guest::guest_function_register::register_function( - ::hyperlight_guest::guest_function_definition::GuestFunctionDefinition::new( + ::hyperlight_guest_bin::guest_function::register::register_function( + ::hyperlight_guest_bin::guest_function::definition::GuestFunctionDefinition::new( #fname.to_string(), ::alloc::vec![#(#pts),*], ::hyperlight_common::flatbuffer_wrappers::function_types::ReturnType::VecBytes, diff --git a/src/wasm_runtime/Cargo.lock b/src/wasm_runtime/Cargo.lock index dc525c1..5c77d6b 100644 --- a/src/wasm_runtime/Cargo.lock +++ b/src/wasm_runtime/Cargo.lock @@ -13,9 +13,9 @@ dependencies = [ [[package]] name = "adler2" -version = "2.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" [[package]] name = "allocator-api2" @@ -25,9 +25,9 @@ checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" [[package]] name = "anyhow" -version = "1.0.97" +version = "1.0.98" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dcfed56ad506cb2c684a14971b8861fdc3baaaae314b9e5f9bb532cbe3ba7a4f" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" [[package]] name = "arbitrary" @@ -43,9 +43,9 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "backtrace" -version = "0.3.74" +version = "0.3.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" dependencies = [ "addr2line", "cfg-if", @@ -53,7 +53,7 @@ dependencies = [ "miniz_oxide", "object", "rustc-demangle", - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -64,9 +64,9 @@ checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" [[package]] name = "bitflags" -version = "2.9.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "buddy_system_allocator" @@ -74,14 +74,14 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1a0108968a3a2dab95b089c0fc3f1afa7759aa5ebe6f1d86d206d6f7ba726eb" dependencies = [ - "spin", + "spin 0.9.8", ] [[package]] name = "bumpalo" -version = "3.17.0" +version = "3.18.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" +checksum = "793db76d6187cd04dff33004d8e6c9cc4e05cd330500379d2394209271b4aeee" dependencies = [ "allocator-api2", ] @@ -94,9 +94,9 @@ checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" [[package]] name = "camino" -version = "1.1.9" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +checksum = "0da45bc31171d8d6960122e222a67740df867c1dd53b4d51caa297084c185cab" dependencies = [ "serde", ] @@ -126,18 +126,18 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.16" +version = "1.2.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be714c154be609ec7f5dad223a33bf1482fff90472de28f7362806e6d4832b8c" +checksum = "956a5e21988b87f372569b66183b78babf23ebc2e744b733e4350a752c4dafac" dependencies = [ "shlex", ] [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "cfg_aliases" @@ -332,9 +332,9 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" [[package]] name = "errno" -version = "0.3.10" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18" dependencies = [ "libc", "windows-sys 0.59.0", @@ -429,22 +429,22 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" dependencies = [ "cfg-if", "js-sys", "libc", - "wasi 0.11.0+wasi-snapshot-preview1", + "wasi 0.11.1+wasi-snapshot-preview1", "wasm-bindgen", ] [[package]] name = "getrandom" -version = "0.3.2" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73fea8450eea4bac3940448fb7ae50d91f034f941199fcd9d909a5a07aa455f0" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", "js-sys", @@ -473,9 +473,9 @@ checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.15.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "5971ac85611da7067dbfcabef3c70ebb5606018acd9e2a3903a0da507521e0d5" dependencies = [ "foldhash", "serde", @@ -548,11 +548,10 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.5" +version = "0.27.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +checksum = "e3c93eb611681b207e1fe55d5a71ecf91572ec8a6705cdb6857f7d8d5242cf58" dependencies = [ - "futures-util", "http", "hyper", "hyper-util", @@ -566,16 +565,21 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.10" +version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +checksum = "dc2fdfdbff08affe55bb779f33b053aa1fe5dd5b54c257343c17edfa55711bdb" dependencies = [ + "base64", "bytes", "futures-channel", + "futures-core", "futures-util", "http", "http-body", "hyper", + "ipnet", + "libc", + "percent-encoding", "pin-project-lite", "socket2", "tokio", @@ -585,22 +589,24 @@ dependencies = [ [[package]] name = "hyperlight-common" -version = "0.2.0" -source = "git+https://github.com/hyperlight-dev/hyperlight?branch=hyperlight-component-macro#53872785af15505377ec0a37c0dc0130d3f87141" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "102b63aa5b49a5b22d8b50bdedaad54a9f89ecdd4bf71442e859444429fbbc87" dependencies = [ "anyhow", "flatbuffers", "log", - "spin", - "strum", + "spin 0.10.0", ] [[package]] name = "hyperlight-component-util" -version = "0.2.0" -source = "git+https://github.com/hyperlight-dev/hyperlight?branch=hyperlight-component-macro#53872785af15505377ec0a37c0dc0130d3f87141" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be3a11b5c5967729ea7c5dedb017097e709da44eca3de3a2ee7681f5502eb751" dependencies = [ "itertools 0.14.0", + "log", "prettyplease", "proc-macro2", "quote", @@ -610,18 +616,29 @@ dependencies = [ [[package]] name = "hyperlight-guest" -version = "0.2.0" -source = "git+https://github.com/hyperlight-dev/hyperlight?branch=hyperlight-component-macro#53872785af15505377ec0a37c0dc0130d3f87141" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9ce181acaa1d996c96288cc8ae4515b5a8f36b38e9d2dbdb1620819f02c531c" dependencies = [ "anyhow", + "hyperlight-common", + "serde_json", +] + +[[package]] +name = "hyperlight-guest-bin" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc7e10f5b50e71731896601ca9b6c9207b887d9b1b062b2dc6a508c9ebec80fa" +dependencies = [ "buddy_system_allocator", "cc", "cfg-if", "glob", "hyperlight-common", + "hyperlight-guest", "log", - "serde_json", - "spin", + "spin 0.10.0", ] [[package]] @@ -639,21 +656,22 @@ dependencies = [ [[package]] name = "icu_collections" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" dependencies = [ "displaydoc", + "potential_utf", "yoke", "zerofrom", "zerovec", ] [[package]] -name = "icu_locid" -version = "1.5.0" +name = "icu_locale_core" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" dependencies = [ "displaydoc", "litemap", @@ -662,31 +680,11 @@ dependencies = [ "zerovec", ] -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - [[package]] name = "icu_normalizer" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" dependencies = [ "displaydoc", "icu_collections", @@ -694,67 +692,54 @@ dependencies = [ "icu_properties", "icu_provider", "smallvec", - "utf16_iter", - "utf8_iter", - "write16", "zerovec", ] [[package]] name = "icu_normalizer_data" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" [[package]] name = "icu_properties" -version = "1.5.1" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" dependencies = [ "displaydoc", "icu_collections", - "icu_locid_transform", + "icu_locale_core", "icu_properties_data", "icu_provider", - "tinystr", + "potential_utf", + "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" -version = "1.5.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" [[package]] name = "icu_provider" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" dependencies = [ "displaydoc", - "icu_locid", - "icu_provider_macros", + "icu_locale_core", "stable_deref_trait", "tinystr", "writeable", "yoke", "zerofrom", + "zerotrie", "zerovec", ] -[[package]] -name = "icu_provider_macros" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "id-arena" version = "2.2.1" @@ -774,9 +759,9 @@ dependencies = [ [[package]] name = "idna_adapter" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" dependencies = [ "icu_normalizer", "icu_properties", @@ -784,9 +769,9 @@ dependencies = [ [[package]] name = "indexmap" -version = "2.8.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", "hashbrown", @@ -799,6 +784,16 @@ version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" +[[package]] +name = "iri-string" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc5ebe9c3a1a7a5127f920a418f7585e9e758e911d0466ed004f393b0e380b2" +dependencies = [ + "memchr", + "serde", +] + [[package]] name = "itertools" version = "0.12.1" @@ -841,15 +836,15 @@ checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" [[package]] name = "libc" -version = "0.2.171" +version = "0.2.172" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c19937216e9d3aa9956d9bb8dfc0b0c8beb6058fc4f7a4dc4d850edf86a237d6" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "libm" -version = "0.2.11" +version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" [[package]] name = "linux-raw-sys" @@ -859,15 +854,15 @@ checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "litemap" -version = "0.7.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23fb14cb19457329c82206317a5663005a4d404783dc74f4252769b0d5f42856" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "lock_api" -version = "0.4.12" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07af8b9cdd281b7915f413fa73f29ebd5d55d0d3f0155584dade1ff18cea1b17" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -875,9 +870,15 @@ dependencies = [ [[package]] name = "log" -version = "0.4.26" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30bde2b3dc3671ae49d8e2e9f044c7c005836e7a023ee57cffa25ab82764bb9e" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" [[package]] name = "mach2" @@ -903,30 +904,24 @@ dependencies = [ "rustix", ] -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - [[package]] name = "miniz_oxide" -version = "0.8.5" +version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5" +checksum = "1fa76a2c86f704bdb222d66965fb3d63269ce38518b83cb0575fca855ebb6316" dependencies = [ "adler2", ] [[package]] name = "mio" -version = "1.0.3" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" +checksum = "78bed444cc8a2160f01cbcf811ef18cac863ad68ae8ca62092e8db51d51c761c" dependencies = [ "libc", - "wasi 0.11.0+wasi-snapshot-preview1", - "windows-sys 0.52.0", + "wasi 0.11.1+wasi-snapshot-preview1", + "windows-sys 0.59.0", ] [[package]] @@ -943,9 +938,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.21.1" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75b0bedcc4fe52caa0e03d9f1151a323e4aa5e2d78ba3580400cd3c9e2bc4bc" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "paste" @@ -983,6 +978,15 @@ dependencies = [ "serde", ] +[[package]] +name = "potential_utf" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +dependencies = [ + "zerovec", +] + [[package]] name = "ppv-lite86" version = "0.2.21" @@ -994,9 +998,9 @@ dependencies = [ [[package]] name = "prettyplease" -version = "0.2.31" +version = "0.2.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5316f57387668042f561aae71480de936257848f9c43ce528e311d89a07cadeb" +checksum = "6837b9e10d61f45f987d50808f83d1ee3d206c66acf650c3e4ae2e1f6ddedf55" dependencies = [ "proc-macro2", "syn", @@ -1004,18 +1008,18 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a31971752e70b8b2686d7e46ec17fb38dad4051d94024c88df49b667caea9c84" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] [[package]] name = "psm" -version = "0.1.25" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f58e5423e24c18cc840e1c98370b3993c6649cd1678b4d24318bcf0a083cbe88" +checksum = "6e944464ec8536cd1beb0bbfd96987eb5e3b72f2ecdafdc5c769a37f1fa2ae1f" dependencies = [ "cc", ] @@ -1033,9 +1037,9 @@ dependencies = [ [[package]] name = "quinn" -version = "0.11.7" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3bd15a6f2967aef83887dcb9fec0014580467e33720d073560cf015a5683012" +checksum = "626214629cda6781b6dc1d316ba307189c85ba657213ce642d9c77670f8202c8" dependencies = [ "bytes", "cfg_aliases", @@ -1053,12 +1057,13 @@ dependencies = [ [[package]] name = "quinn-proto" -version = "0.11.10" +version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b820744eb4dc9b57a3398183639c511b5a26d2ed702cedd3febaa1393caa22cc" +checksum = "49df843a9161c85bb8aae55f101bc0bac8bcafd637a620d9122fd7e0b2f7422e" dependencies = [ "bytes", - "getrandom 0.3.2", + "getrandom 0.3.3", + "lru-slab", "rand", "ring", "rustc-hash", @@ -1073,9 +1078,9 @@ dependencies = [ [[package]] name = "quinn-udp" -version = "0.5.10" +version = "0.5.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e46f3055866785f6b92bc6164b76be02ca8f2eb4b002c0354b28cf4c119e5944" +checksum = "ee4e529991f949c5e25755532370b8af5d114acae52326361d68d47af64aa842" dependencies = [ "cfg_aliases", "libc", @@ -1102,13 +1107,12 @@ checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" [[package]] name = "rand" -version = "0.9.0" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" dependencies = [ "rand_chacha", "rand_core", - "zerocopy", ] [[package]] @@ -1127,14 +1131,14 @@ version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" dependencies = [ - "getrandom 0.3.2", + "getrandom 0.3.3", ] [[package]] name = "regalloc2" -version = "0.11.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "145c1c267e14f20fb0f88aa76a1c5ffec42d592c1d28b3cd9148ae35916158d3" +checksum = "dc06e6b318142614e4a48bc725abbf08ff166694835c43c9dae5a9009704639a" dependencies = [ "allocator-api2", "bumpalo", @@ -1146,9 +1150,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.15" +version = "0.12.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb" +checksum = "eabf4c97d9130e2bf606614eb937e86edac8292eaa6f422f995d7e8de1eb1813" dependencies = [ "base64", "bytes", @@ -1161,16 +1165,12 @@ dependencies = [ "hyper", "hyper-rustls", "hyper-util", - "ipnet", "js-sys", "log", - "mime", - "once_cell", "percent-encoding", "pin-project-lite", "quinn", "rustls", - "rustls-pemfile", "rustls-pki-types", "serde", "serde_json", @@ -1179,13 +1179,13 @@ dependencies = [ "tokio", "tokio-rustls", "tower", + "tower-http", "tower-service", "url", "wasm-bindgen", "wasm-bindgen-futures", "web-sys", "webpki-roots", - "windows-registry", ] [[package]] @@ -1196,7 +1196,7 @@ checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" dependencies = [ "cc", "cfg-if", - "getrandom 0.2.15", + "getrandom 0.2.16", "libc", "untrusted", "windows-sys 0.52.0", @@ -1204,9 +1204,9 @@ dependencies = [ [[package]] name = "rustc-demangle" -version = "0.1.24" +version = "0.1.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +checksum = "989e6739f80c4ad5b13e0fd7fe89531180375b18520cc8c82080e4dc4035b84f" [[package]] name = "rustc-hash" @@ -1238,9 +1238,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.25" +version = "0.23.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "822ee9188ac4ec04a2f0531e55d035fb2de73f18b41a63c70c2712503b6fb13c" +checksum = "730944ca083c1c233a75c09f199e973ca499344a2b7ba9e755c457e86fb4a321" dependencies = [ "once_cell", "ring", @@ -1250,29 +1250,21 @@ dependencies = [ "zeroize", ] -[[package]] -name = "rustls-pemfile" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dce314e5fee3f39953d46bb63bb8a46d40c2f8fb7cc5a3b6cab2bde9721d6e50" -dependencies = [ - "rustls-pki-types", -] - [[package]] name = "rustls-pki-types" -version = "1.11.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c" +checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" dependencies = [ "web-time", + "zeroize", ] [[package]] name = "rustls-webpki" -version = "0.103.0" +version = "0.103.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0aa4eeac2588ffff23e9d7a7e9b3f971c5fb5b7ebc9452745e0c232c64f83b2f" +checksum = "e4a72fe2bcf7a6ac6fd7d0b9e5cb68aeb7d4c0a0271730218b3e92d43b4eb435" dependencies = [ "ring", "rustls-pki-types", @@ -1281,9 +1273,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.20" +version = "1.0.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" +checksum = "8a0d197bd2c9dc6e53b84da9556a69ba4cdfab8619eb41a8bd1cc2027a0f6b1d" [[package]] name = "ryu" @@ -1367,18 +1359,18 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.14.0" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" dependencies = [ "serde", ] [[package]] name = "socket2" -version = "0.5.8" +version = "0.5.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" dependencies = [ "libc", "windows-sys 0.52.0", @@ -1393,6 +1385,15 @@ dependencies = [ "lock_api", ] +[[package]] +name = "spin" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5fe4ccb98d9c292d56fec89a5e07da7fc4cf0dc11e156b41793132775d3e591" +dependencies = [ + "lock_api", +] + [[package]] name = "sptr" version = "0.3.2" @@ -1405,28 +1406,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -[[package]] -name = "strum" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.27.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn", -] - [[package]] name = "subtle" version = "2.6.1" @@ -1435,9 +1414,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "2.0.100" +version = "2.0.103" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b09a44accad81e1ba1cd74a32461ba89dee89095ba17b32f5d03683b1b1fc2a0" +checksum = "e4307e30089d6fd6aff212f2da3a1f9e32f3223b1f010fb09b7c95f90f3ca1e8" dependencies = [ "proc-macro2", "quote", @@ -1455,9 +1434,9 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", @@ -1521,9 +1500,9 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.7.6" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" dependencies = [ "displaydoc", "zerovec", @@ -1546,9 +1525,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.45.0" +version = "1.45.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2513ca694ef9ede0fb23fe71a4ee4107cb102b9dc1930f6d0fd77aae068ae165" +checksum = "75ef51a33ef1da925cea3e4eb122833cb377c61439ca401b770f54902b806779" dependencies = [ "backtrace", "bytes", @@ -1584,6 +1563,24 @@ dependencies = [ "tower-service", ] +[[package]] +name = "tower-http" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adc82fd73de2a9722ac5da747f12383d2bfdb93591ee6c58486e0097890f05f2" +dependencies = [ + "bitflags", + "bytes", + "futures-util", + "http", + "http-body", + "iri-string", + "pin-project-lite", + "tower", + "tower-layer", + "tower-service", +] + [[package]] name = "tower-layer" version = "0.3.3" @@ -1608,9 +1605,9 @@ dependencies = [ [[package]] name = "tracing-core" -version = "0.1.33" +version = "0.1.34" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e672c95779cf947c5311f83787af4fa8fffd12fb27e4993211a84bdfd9610f9c" +checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678" dependencies = [ "once_cell", ] @@ -1650,12 +1647,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - [[package]] name = "utf8_iter" version = "1.0.4" @@ -1673,9 +1664,9 @@ dependencies = [ [[package]] name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" [[package]] name = "wasi" @@ -1776,9 +1767,10 @@ dependencies = [ "cfg-if", "hyperlight-common", "hyperlight-guest", + "hyperlight-guest-bin", "hyperlight-wasm-macro", "reqwest", - "spin", + "spin 0.9.8", "wasmtime", ] @@ -2020,9 +2012,9 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.8" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9" +checksum = "2853738d1cc4f2da3a225c18ec6c3721abb31961096e9dbf5ab35fa88b19cfdb" dependencies = [ "rustls-pki-types", ] @@ -2054,48 +2046,13 @@ dependencies = [ "wasmtime-environ", ] -[[package]] -name = "windows-link" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" - -[[package]] -name = "windows-registry" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" -dependencies = [ - "windows-result", - "windows-strings", - "windows-targets 0.53.0", -] - -[[package]] -name = "windows-result" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c64fd11a4fd95df68efcfee5f44a294fe71b8bc6a91993e2791938abcc712252" -dependencies = [ - "windows-link", -] - -[[package]] -name = "windows-strings" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" -dependencies = [ - "windows-link", -] - [[package]] name = "windows-sys" version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -2104,7 +2061,7 @@ version = "0.59.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" dependencies = [ - "windows-targets 0.52.6", + "windows-targets", ] [[package]] @@ -2113,30 +2070,14 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.6", - "windows_aarch64_msvc 0.52.6", - "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm 0.52.6", - "windows_i686_msvc 0.52.6", - "windows_x86_64_gnu 0.52.6", - "windows_x86_64_gnullvm 0.52.6", - "windows_x86_64_msvc 0.52.6", -] - -[[package]] -name = "windows-targets" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" -dependencies = [ - "windows_aarch64_gnullvm 0.53.0", - "windows_aarch64_msvc 0.53.0", - "windows_i686_gnu 0.53.0", - "windows_i686_gnullvm 0.53.0", - "windows_i686_msvc 0.53.0", - "windows_x86_64_gnu 0.53.0", - "windows_x86_64_gnullvm 0.53.0", - "windows_x86_64_msvc 0.53.0", + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", ] [[package]] @@ -2145,96 +2086,48 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" - [[package]] name = "windows_aarch64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" -[[package]] -name = "windows_aarch64_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" - [[package]] name = "windows_i686_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" -[[package]] -name = "windows_i686_gnu" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" - [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" -[[package]] -name = "windows_i686_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" - [[package]] name = "windows_i686_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" -[[package]] -name = "windows_i686_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" - [[package]] name = "windows_x86_64_gnu" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" -[[package]] -name = "windows_x86_64_gnu" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" - [[package]] name = "windows_x86_64_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" - [[package]] name = "windows_x86_64_msvc" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" -[[package]] -name = "windows_x86_64_msvc" -version = "0.53.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" - [[package]] name = "wit-bindgen-rt" version = "0.39.0" @@ -2262,23 +2155,17 @@ dependencies = [ "wasmparser", ] -[[package]] -name = "write16" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" - [[package]] name = "writeable" -version = "0.5.5" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" [[package]] name = "yoke" -version = "0.7.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" dependencies = [ "serde", "stable_deref_trait", @@ -2288,9 +2175,9 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", @@ -2300,18 +2187,18 @@ dependencies = [ [[package]] name = "zerocopy" -version = "0.8.23" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd97444d05a4328b90e75e503a34bad781f14e28a823ad3557f0750df1ebcbc6" +checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" dependencies = [ "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.8.23" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6352c01d0edd5db859a63e2605f4ea3183ddbd15e2c4a9e7d32184df75e4f154" +checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" dependencies = [ "proc-macro2", "quote", @@ -2345,11 +2232,22 @@ version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + [[package]] name = "zerovec" -version = "0.10.4" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" dependencies = [ "yoke", "zerofrom", @@ -2358,9 +2256,9 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.10.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", diff --git a/src/wasm_runtime/Cargo.toml b/src/wasm_runtime/Cargo.toml index 25fa6d8..6abd467 100644 --- a/src/wasm_runtime/Cargo.toml +++ b/src/wasm_runtime/Cargo.toml @@ -11,8 +11,9 @@ doctest = false bench = false [dependencies] -hyperlight-common = { git = "https://github.com/hyperlight-dev/hyperlight", branch = "hyperlight-component-macro", default-features = false } -hyperlight-guest = { git = "https://github.com/hyperlight-dev/hyperlight", branch = "hyperlight-component-macro", features = [ "printf" ] } +hyperlight-common = { version = "0.6.1", default-features = false } +hyperlight-guest-bin = { version = "0.6.1", features = [ "printf" ] } +hyperlight-guest = { version = "0.6.1" } wasmtime = { version = "30.0.2", default-features = false, features = [ "runtime", "custom-virtual-memory", "custom-native-signals", "component-model" ] } hyperlight-wasm-macro = { path = "../hyperlight_wasm_macro" } spin = "0.9.8" diff --git a/src/wasm_runtime/build.rs b/src/wasm_runtime/build.rs index 5e1fd56..7235292 100644 --- a/src/wasm_runtime/build.rs +++ b/src/wasm_runtime/build.rs @@ -98,9 +98,9 @@ fn main() { } cfg.compile("wasm_runtime"); - println!("cargo::rerun-if-env-changed=HYPERLIGHT_WASM_WORLD"); + println!("cargo::rerun-if-env-changed=WIT_WORLD"); println!("cargo::rustc-check-cfg=cfg(component)"); - if env::var_os("HYPERLIGHT_WASM_WORLD").is_some() { + if env::var_os("WIT_WORLD").is_some() { println!("cargo::rustc-cfg=component"); } } diff --git a/src/wasm_runtime/src/component.rs b/src/wasm_runtime/src/component.rs index 415724e..7fa5dff 100644 --- a/src/wasm_runtime/src/component.rs +++ b/src/wasm_runtime/src/component.rs @@ -26,9 +26,9 @@ use hyperlight_common::flatbuffer_wrappers::function_types::{ use hyperlight_common::flatbuffer_wrappers::guest_error::ErrorCode; use hyperlight_common::flatbuffer_wrappers::util::get_flatbuffer_result; use hyperlight_guest::error::{HyperlightGuestError, Result}; -use hyperlight_guest::guest_function_definition::GuestFunctionDefinition; -use hyperlight_guest::guest_function_register::register_function; -use hyperlight_guest::host_function_call::call_host_function; +use hyperlight_guest_bin::guest_function::definition::GuestFunctionDefinition; +use hyperlight_guest_bin::guest_function::register::register_function; +use hyperlight_guest_bin::host_comm::call_host_function; use spin::Mutex; use wasmtime::component::{Component, Instance, Linker}; use wasmtime::{Config, Engine, Store}; diff --git a/src/wasm_runtime/src/hostfuncs.rs b/src/wasm_runtime/src/hostfuncs.rs index 2ef3234..943d411 100644 --- a/src/wasm_runtime/src/hostfuncs.rs +++ b/src/wasm_runtime/src/hostfuncs.rs @@ -14,19 +14,28 @@ See the License for the specific language governing permissions and limitations under the License. */ -use alloc::format; use alloc::string::ToString; use alloc::vec::Vec; -use hyperlight_common::flatbuffer_wrappers::function_types::{ParameterType, ReturnType}; +use hyperlight_common::flatbuffer_wrappers::function_types::{ + ParameterType, ReturnType, ReturnValue, +}; use hyperlight_common::flatbuffer_wrappers::guest_error::ErrorCode; -use hyperlight_common::flatbuffer_wrappers::host_function_definition::HostFunctionDefinition; use hyperlight_guest::error::{HyperlightGuestError, Result}; -use hyperlight_guest::host_function_call::call_host_function; +use hyperlight_guest_bin::host_comm::call_host_function; use wasmtime::{Caller, Engine, FuncType, Val, ValType}; use crate::marshal; +pub(crate) type HostFunctionDefinition = + hyperlight_common::flatbuffer_wrappers::host_function_definition::HostFunctionDefinition; +pub(crate) type HostFunctionDetails = + hyperlight_common::flatbuffer_wrappers::host_function_details::HostFunctionDetails; + +pub(crate) fn get_host_function_details() -> HostFunctionDetails { + hyperlight_guest_bin::host_comm::get_host_function_details() +} + pub(crate) fn hostfunc_type(d: &HostFunctionDefinition, e: &Engine) -> Result { let mut params = Vec::new(); let mut last_was_vec = false; @@ -56,20 +65,16 @@ pub(crate) fn hostfunc_type(d: &HostFunctionDefinition, e: &Engine) -> Result {} ReturnType::Int | ReturnType::UInt => results.push(ValType::I32), ReturnType::Long | ReturnType::ULong => results.push(ValType::I64), - /* hyperlight_guest::host_function_call::get_host_value_return_as_{bool,float,double,string} are missing */ + ReturnType::Bool => results.push(ValType::I32), + ReturnType::Float => results.push(ValType::F32), + ReturnType::Double => results.push(ValType::F64), + ReturnType::String => results.push(ValType::I32), + // TODO: this comment about using i64 for VecBytes doesn't seem to match with what + // hl_return_to_val was doing, check if this is still correct. /* For compatibility with old host, we return * a packed i64 with a (wasm32) pointer in the lower half and * a length in the upper half. */ ReturnType::VecBytes => results.push(ValType::I64), - _ => { - return Err(HyperlightGuestError::new( - ErrorCode::GuestError, - format!( - "Host function return type {:?} must be (u)int or (u)long, if present", - d.return_type - ), - )); - } } Ok(FuncType::new(e, params, results)) } @@ -88,7 +93,39 @@ pub(crate) fn call( marshal::val_to_hl_param(&mut c, |c, n| c.get_export(n), s, t) }) .collect(); - call_host_function(&d.function_name, Some(params), d.return_type) + + let rv = call_host_function::(&d.function_name, Some(params), d.return_type) .expect("Host function call failed"); - marshal::hl_return_to_val(&mut c, |c, n| c.get_export(n), &d.return_type, rs) + + assert!( + return_type_from_val(&rv) == d.return_type, + "Host function return type mismatch" + ); + + if rs.is_empty() { + assert!( + d.return_type == ReturnType::Void, + "Host function return type mismatch" + ); + return Ok(()); + } + + rs[0] = marshal::hl_return_to_val(&mut c, |c, n| c.get_export(n), rv)?; + + Ok(()) +} + +fn return_type_from_val(val: &ReturnValue) -> ReturnType { + match val { + ReturnValue::Int(_) => ReturnType::Int, + ReturnValue::UInt(_) => ReturnType::UInt, + ReturnValue::Long(_) => ReturnType::Long, + ReturnValue::ULong(_) => ReturnType::ULong, + ReturnValue::Float(_) => ReturnType::Float, + ReturnValue::Double(_) => ReturnType::Double, + ReturnValue::String(_) => ReturnType::String, + ReturnValue::VecBytes(_) => ReturnType::VecBytes, + ReturnValue::Bool(_) => ReturnType::Bool, + ReturnValue::Void(_) => ReturnType::Void, + } } diff --git a/src/wasm_runtime/src/main.rs b/src/wasm_runtime/src/main.rs index 32a6829..23afd9f 100644 --- a/src/wasm_runtime/src/main.rs +++ b/src/wasm_runtime/src/main.rs @@ -32,8 +32,6 @@ mod wasip1; #[cfg(component)] mod component; -#[cfg(component)] -use component::*; // The file referenced in this include! macro is created by the // build.rs script. The build.rs script gets the current version of diff --git a/src/wasm_runtime/src/marshal.rs b/src/wasm_runtime/src/marshal.rs index 038a6bf..3ce22c0 100644 --- a/src/wasm_runtime/src/marshal.rs +++ b/src/wasm_runtime/src/marshal.rs @@ -22,12 +22,11 @@ use alloc::vec::Vec; use alloc::{format, vec}; use hyperlight_common::flatbuffer_wrappers::function_types::{ - ParameterType, ParameterValue, ReturnType, + ParameterType, ParameterValue, ReturnType, ReturnValue, }; use hyperlight_common::flatbuffer_wrappers::guest_error::ErrorCode; use hyperlight_common::flatbuffer_wrappers::util::get_flatbuffer_result; use hyperlight_guest::error::{HyperlightGuestError, Result}; -use hyperlight_guest::host_function_call::get_host_return_value; use wasmtime::{AsContextMut, Extern, Val}; fn malloc( @@ -252,33 +251,29 @@ pub fn val_to_hl_param<'a, C: AsContextMut>( pub fn hl_return_to_val( ctx: &mut C, get_export: impl Fn(&mut C, &str) -> Option, - rt: &ReturnType, - ret: &mut [Val], -) -> Result<()> { - match rt { - ReturnType::Void => get_host_return_value::<()>()?, - ReturnType::Int => { - ret[0] = Val::I32(get_host_return_value::()?); - } - ReturnType::Long => { - ret[0] = Val::I64(get_host_return_value::()?); - } - ReturnType::UInt => { - ret[0] = Val::I32(get_host_return_value::()? as i32); - } - ReturnType::ULong => { - ret[0] = Val::I64(get_host_return_value::()? as i64); + rv: ReturnValue, +) -> Result { + match rv { + ReturnValue::Int(i) => Ok(Val::I32(i)), + ReturnValue::UInt(u) => Ok(Val::I32(u as i32)), + ReturnValue::Long(l) => Ok(Val::I64(l)), + ReturnValue::ULong(u) => Ok(Val::I64(u as i64)), + ReturnValue::Bool(b) => Ok(Val::I32(if b { 1 } else { 0 })), + ReturnValue::Float(f) => Ok(Val::F32(f.to_bits())), + ReturnValue::Double(f) => Ok(Val::F64(f.to_bits())), + ReturnValue::String(s) => { + let s = CString::new(s.as_str()).unwrap(); + let nbytes = s.count_bytes() + 1; // include the NUL terminator + let addr = malloc(ctx, &get_export, nbytes)?; + write(ctx, &get_export, addr, s.as_bytes_with_nul())?; + Ok(Val::I32(addr)) } - /* hyperlight_guest::host_function_call::get_host_value_return_as_{bool,float,double,string} are missing */ - ReturnType::VecBytes => { - let b = get_host_return_value::>()?; + ReturnValue::VecBytes(b) => { let addr = malloc(ctx, &get_export, b.len())?; write(ctx, &get_export, addr, b.as_ref())?; - ret[0] = Val::I32(addr); - } - _ => { - panic!("unimplemented"); + Ok(Val::I32(addr)) + // TODO: check that the next parameter is the correct length } + ReturnValue::Void(()) => Ok(Val::I32(0)), } - Ok(()) } diff --git a/src/wasm_runtime/src/module.rs b/src/wasm_runtime/src/module.rs index 06f026e..b5e3691 100644 --- a/src/wasm_runtime/src/module.rs +++ b/src/wasm_runtime/src/module.rs @@ -26,10 +26,9 @@ use hyperlight_common::flatbuffer_wrappers::function_types::{ use hyperlight_common::flatbuffer_wrappers::guest_error::ErrorCode; use hyperlight_common::flatbuffer_wrappers::util::get_flatbuffer_result; use hyperlight_guest::error::{HyperlightGuestError, Result}; -use hyperlight_guest::guest_function_definition::GuestFunctionDefinition; -use hyperlight_guest::guest_function_register::register_function; -use hyperlight_guest::host_function_call::print_output_as_guest_function; -use hyperlight_guest::host_functions::get_host_function_details; +use hyperlight_guest_bin::guest_function::definition::GuestFunctionDefinition; +use hyperlight_guest_bin::guest_function::register::register_function; +use hyperlight_guest_bin::host_comm::print_output_with_host_print; use spin::Mutex; use wasmtime::{Config, Engine, Linker, Module, Store, Val}; @@ -98,7 +97,7 @@ fn init_wasm_runtime() -> Result> { let mut linker = Linker::new(&engine); wasip1::register_handlers(&mut linker)?; - let hostfuncs = get_host_function_details() + let hostfuncs = hostfuncs::get_host_function_details() .host_functions .unwrap_or_default(); for hostfunc in hostfuncs.iter() { @@ -146,7 +145,7 @@ pub extern "C" fn hyperlight_main() { "PrintOutput".to_string(), vec![ParameterType::String], ReturnType::Int, - print_output_as_guest_function as usize, + print_output_with_host_print as usize, )); register_function(GuestFunctionDefinition::new( diff --git a/src/wasm_runtime/src/platform.rs b/src/wasm_runtime/src/platform.rs index 37d6abb..6973950 100644 --- a/src/wasm_runtime/src/platform.rs +++ b/src/wasm_runtime/src/platform.rs @@ -58,7 +58,7 @@ pub extern "C" fn wasmtime_mprotect(_ptr: *mut u8, _size: usize, prot_flags: u32 #[no_mangle] pub extern "C" fn wasmtime_page_size() -> usize { - unsafe { hyperlight_guest::OS_PAGE_SIZE as usize } + unsafe { hyperlight_guest_bin::OS_PAGE_SIZE as usize } } #[allow(non_camel_case_types)] // we didn't choose the name! diff --git a/src/wasm_runtime/src/wasip1.rs b/src/wasm_runtime/src/wasip1.rs index f672200..70b08e4 100644 --- a/src/wasm_runtime/src/wasip1.rs +++ b/src/wasm_runtime/src/wasip1.rs @@ -22,7 +22,7 @@ use alloc::vec::Vec; use hyperlight_common::flatbuffer_wrappers::function_types::{ParameterValue, ReturnType}; use hyperlight_guest::error::Result; -use hyperlight_guest::host_function_call::{call_host_function, get_host_return_value}; +use hyperlight_guest_bin::host_comm::call_host_function; use wasmtime::{Caller, Extern, Linker}; pub(crate) fn register_handlers(linker: &mut Linker) -> Result<()> { @@ -63,16 +63,13 @@ pub(crate) fn register_handlers(linker: &mut Linker) -> Result<()> { let Ok(str) = core::str::from_utf8(&string_bytes) else { return -2; }; - let Ok(()) = call_host_function( + let Ok(written) = call_host_function::( "HostPrint", Some(Vec::from(&[ParameterValue::String(str.to_string())])), ReturnType::Int, ) else { return -3; }; - let Ok(written) = get_host_return_value::() else { - return -4; - }; total_written += written; } memory diff --git a/src/wasmsamples/dockerfile b/src/wasmsamples/dockerfile index a4462cb..41d043c 100644 --- a/src/wasmsamples/dockerfile +++ b/src/wasmsamples/dockerfile @@ -1,3 +1,4 @@ +# syntax=docker/dockerfile:1-labs FROM ubuntu ENV DEBIAN_FRONTEND=noninteractive LABEL org.opencontainers.image.source=https://github.com/hyperlight-dev/hyperlight-wasm