From 1c045e45e6f82d840b812325e448cce222a95bad Mon Sep 17 00:00:00 2001 From: Jorge Prendes Date: Mon, 9 Mar 2026 16:53:38 +0000 Subject: [PATCH] rename wasm_runtime -> hyperlight-wasm-runtime Signed-off-by: Jorge Prendes --- .github/dependabot.yml | 2 +- .github/workflows/CreateRelease.yml | 15 ------ .github/workflows/CreateReleaseBranch.yml | 8 ---- .gitignore | 2 - .vscode/launch.json | 2 +- Cargo.lock | 38 +++++++-------- Cargo.toml | 4 +- Justfile | 17 ++----- RustDev.md | 2 +- docs/wasm-modules-debugging.md | 2 +- src/hyperlight_wasm/Cargo.toml | 2 +- src/hyperlight_wasm/build.rs | 48 +++++++++---------- src/hyperlight_wasm/src/build_info.rs | 30 ++++++++---- src/hyperlight_wasm/src/lib.rs | 16 +++---- src/hyperlight_wasm/src/sandbox/mod.rs | 2 +- src/hyperlight_wasm_macro/src/lib.rs | 2 +- .../Cargo.lock | 0 .../Cargo.toml | 4 +- .../build.rs | 2 +- .../src/component.rs | 0 .../src/hostfuncs.rs | 0 .../src/lib.rs | 2 +- .../src/main.rs | 2 +- .../src/marshal.rs | 0 .../src/module.rs | 0 .../src/platform.c | 0 .../src/platform.rs | 0 .../src/wasip1.rs | 0 src/wasm_runtime/.gitignore | 2 - 29 files changed, 90 insertions(+), 114 deletions(-) rename src/{wasm_runtime => hyperlight_wasm_runtime}/Cargo.lock (100%) rename src/{wasm_runtime => hyperlight_wasm_runtime}/Cargo.toml (95%) rename src/{wasm_runtime => hyperlight_wasm_runtime}/build.rs (98%) rename src/{wasm_runtime => hyperlight_wasm_runtime}/src/component.rs (100%) rename src/{wasm_runtime => hyperlight_wasm_runtime}/src/hostfuncs.rs (100%) rename src/{wasm_runtime => hyperlight_wasm_runtime}/src/lib.rs (94%) rename src/{wasm_runtime => hyperlight_wasm_runtime}/src/main.rs (96%) rename src/{wasm_runtime => hyperlight_wasm_runtime}/src/marshal.rs (100%) rename src/{wasm_runtime => hyperlight_wasm_runtime}/src/module.rs (100%) rename src/{wasm_runtime => hyperlight_wasm_runtime}/src/platform.c (100%) rename src/{wasm_runtime => hyperlight_wasm_runtime}/src/platform.rs (100%) rename src/{wasm_runtime => hyperlight_wasm_runtime}/src/wasip1.rs (100%) delete mode 100644 src/wasm_runtime/.gitignore diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 2c7c1f97..441a97fe 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -21,7 +21,7 @@ updates: update-types: ["version-update:semver-minor", "version-update:semver-major"] # Add entries for excluded workspace members - package-ecosystem: "cargo" - directory: "/src/wasm_runtime" + directory: "/src/hyperlight_wasm_runtime" schedule: interval: "daily" time: "03:00" diff --git a/.github/workflows/CreateRelease.yml b/.github/workflows/CreateRelease.yml index db15e4db..90ff253b 100644 --- a/.github/workflows/CreateRelease.yml +++ b/.github/workflows/CreateRelease.yml @@ -39,21 +39,6 @@ jobs: uses: hyperlight-dev/ci-setup-workflow@v1.8.0 with: rust-toolchain: "1.89" - - name: Verify vendor.tar - if: ${{ contains(github.ref, 'refs/heads/release/') }} - run: | - set -euxo pipefail - VENDOR1=$(mktemp -d) - VENDOR2=$(mktemp -d) - tar xf ./src/hyperlight_wasm/vendor.tar -C $VENDOR1 - just make-vendor-tar - tar xf ./src/hyperlight_wasm/vendor.tar -C $VENDOR2 - if ! git diff --no-index $VENDOR1 $VENDOR2; then - echo "vendor.tar is not up to date, please run 'just make-vendor-tar' and commit the changes" - exit 1 - fi - git restore ./src/hyperlight_wasm/vendor.tar - shell: bash - name: Package hyperlight-wasm crate if: ${{ contains(github.ref, 'refs/heads/release/') }} run: cargo package -p hyperlight-wasm diff --git a/.github/workflows/CreateReleaseBranch.yml b/.github/workflows/CreateReleaseBranch.yml index 64542788..5f838acd 100644 --- a/.github/workflows/CreateReleaseBranch.yml +++ b/.github/workflows/CreateReleaseBranch.yml @@ -24,13 +24,5 @@ jobs: - name: Create Release Branch run: | git checkout -b release/${GITHUB_REF_NAME} - just make-vendor-tar - sed -i '/vendor.tar/d' ./src/hyperlight_wasm/.gitignore - git add ./src/hyperlight_wasm/vendor.tar - git add ./src/hyperlight_wasm/.gitignore - git config user.name hyperlight-wasm-ci - git config user.email github@users.noreply.github.com - git commit -s \ - -m "Vendor dependencies for release ${GITHUB_REF_NAME}" git push --set-upstream origin release/${GITHUB_REF_NAME} shell: bash diff --git a/.gitignore b/.gitignore index b99517dc..879912af 100644 --- a/.gitignore +++ b/.gitignore @@ -463,8 +463,6 @@ $RECYCLE.BIN/ **/include/libc/musl/** **/include/flatbuffers/generated/** **/include/flatcc/** -**/guest-toolchain -src/wasm_runtime/src/include ## Rust from https://github.com/github/gitignore/blob/main/Rust.gitignore diff --git a/.vscode/launch.json b/.vscode/launch.json index cf6632a1..fad7f1dd 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -3,7 +3,7 @@ { "id": "program", "type": "promptString", - "default": "x64/debug/wasm_runtime", + "default": "x64/debug/hyperlight_wasm_runtime", "description": "Path to the program to debug", } ], diff --git a/Cargo.lock b/Cargo.lock index babf78ad..23eb2492 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1623,6 +1623,7 @@ dependencies = [ "goblin", "hyperlight-component-macro", "hyperlight-host", + "hyperlight-wasm-runtime", "junction", "libc", "log", @@ -1645,7 +1646,6 @@ dependencies = [ "tracing-opentelemetry", "tracing-subscriber", "uuid", - "wasm-runtime", "windows", ] @@ -1672,6 +1672,24 @@ dependencies = [ "syn", ] +[[package]] +name = "hyperlight-wasm-runtime" +version = "0.12.0" +dependencies = [ + "cargo_metadata", + "cc", + "cfg-if", + "cfg_aliases", + "hyperlight-common", + "hyperlight-guest", + "hyperlight-guest-bin", + "hyperlight-wasm-macro", + "reqwest", + "spin 0.10.0", + "tracing", + "wasmtime", +] + [[package]] name = "iana-time-zone" version = "0.1.64" @@ -4038,24 +4056,6 @@ dependencies = [ "wasmparser 0.244.0", ] -[[package]] -name = "wasm-runtime" -version = "0.12.0" -dependencies = [ - "cargo_metadata", - "cc", - "cfg-if", - "cfg_aliases", - "hyperlight-common", - "hyperlight-guest", - "hyperlight-guest-bin", - "hyperlight-wasm-macro", - "reqwest", - "spin 0.10.0", - "tracing", - "wasmtime", -] - [[package]] name = "wasmparser" version = "0.236.1" diff --git a/Cargo.toml b/Cargo.toml index 2fe9aba0..680a9e43 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,5 +1,5 @@ [workspace] -members = [ "src/hyperlight_wasm", "src/examples_common", "src/hyperlight_wasm_aot", "src/wasm_runtime", "src/hyperlight_wasm_macro" ] +members = [ "src/hyperlight_wasm", "src/examples_common", "src/hyperlight_wasm_aot", "src/hyperlight_wasm_runtime", "src/hyperlight_wasm_macro" ] exclude = [ "src/rust_wasm_samples", "src/component_sample" ] resolver = "2" @@ -20,4 +20,4 @@ hyperlight-guest = { version = "0.12.0" } hyperlight-guest-bin = { version = "0.12.0", features = [ "printf" ] } hyperlight-host = { version = "0.12.0", default-features = false, features = ["executable_heap", "init-paging"] } hyperlight-wasm-macro = { version = "0.12.0", path = "src/hyperlight_wasm_macro" } -wasm-runtime = { version = "0.12.0", path = "src/wasm_runtime" } +hyperlight-wasm-runtime = { version = "0.12.0", path = "src/hyperlight_wasm_runtime" } diff --git a/Justfile b/Justfile index d3686e07..9f62f148 100644 --- a/Justfile +++ b/Justfile @@ -8,12 +8,6 @@ wit-world-c := if os() == "windows" { "$env:WIT_WORLD=\"" + justfile_directory() set windows-shell := ["pwsh.exe", "-NoLogo", "-Command"] -make-vendor-tar: - tar cf ./src/hyperlight_wasm/vendor.tar \ - --owner=0 --group=0 \ - --exclude-vcs-ignores \ - -C ./src wasm_runtime hyperlight_wasm_macro - ensure-tools: cargo install wasm-tools --locked --version 1.235.0 cargo install cargo-component --locked --version 0.21.1 @@ -66,14 +60,14 @@ check target=default-target: cargo check --profile={{ if target == "debug" {"dev"} else { target } }} cd src/rust_wasm_samples && cargo check --profile={{ if target == "debug" {"dev"} else { target } }} cd src/component_sample && cargo check --profile={{ if target == "debug" {"dev"} else { target } }} - cd src/wasm_runtime && cargo hyperlight check --profile={{ if target == "debug" {"dev"} else { target } }} + cd src/hyperlight_wasm_runtime && cargo hyperlight check --profile={{ if target == "debug" {"dev"} else { target } }} cd src/hyperlight_wasm_macro && cargo check --profile={{ if target == "debug" {"dev"} else { target } }} fmt-check: rustup toolchain install nightly -c rustfmt && cargo +nightly fmt -v --all -- --check cd src/rust_wasm_samples && rustup toolchain install nightly -c rustfmt && cargo +nightly fmt -v --all -- --check cd src/component_sample && rustup toolchain install nightly -c rustfmt && cargo +nightly fmt -v --all -- --check - cd src/wasm_runtime && rustup toolchain install nightly -c rustfmt && cargo +nightly fmt -v --all -- --check + cd src/hyperlight_wasm_runtime && rustup toolchain install nightly -c rustfmt && cargo +nightly fmt -v --all -- --check cd src/hyperlight_wasm_macro && rustup toolchain install nightly -c rustfmt && cargo +nightly fmt -v --all -- --check fmt: @@ -81,17 +75,14 @@ fmt: cargo +nightly fmt --all cd src/rust_wasm_samples && cargo +nightly fmt -v --all cd src/component_sample && cargo +nightly fmt -v --all - cd src/wasm_runtime && cargo +nightly fmt -v --all + cd src/hyperlight_wasm_runtime && cargo +nightly fmt -v --all cd src/hyperlight_wasm_macro && cargo +nightly fmt -v --all -export CC_x86_64_unknown_none:= if os() == "windows" { justfile_directory() / "src/wasm_runtime/guest-toolchain/clang" } else { "" } -export AR_x86_64_unknown_none:= if os() == "windows" { "llvm-ar" } else { "" } - clippy target=default-target: (check target) cargo clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --all-features -- -D warnings cd src/rust_wasm_samples && cargo clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --all-features -- -D warnings cd src/component_sample && cargo clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --all-features -- -D warnings - cd src/wasm_runtime && cargo hyperlight clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --all-features -- -D warnings + cd src/hyperlight_wasm_runtime && cargo hyperlight clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --all-features -- -D warnings cd src/hyperlight_wasm_macro && cargo clippy --profile={{ if target == "debug" {"dev"} else { target } }} --all-targets --all-features -- -D warnings # TESTING diff --git a/RustDev.md b/RustDev.md index f0b20fe4..f31b434f 100644 --- a/RustDev.md +++ b/RustDev.md @@ -41,7 +41,7 @@ but has no Wasm runtime loaded. Once it has been transitioned to a `WasmSandbox` ### More about `WasmSandbox` -The `WasmSandbox` represents a sandbox state that is not completely ready for use. While it does have the `wasm_runtime` guest binary loaded into it (see [Rust.md](./Rust.md) for more details on this guest binary), and the Wasm runtime initialised, it is missing a user's WebAssembly module code. The 'WasmSandbox' type is an intermediate state that is designed to be cached in a host to avoid having to pay the cost of loading the `wasm_runtime` guest binary and initializing the Wasm runtime each time a new user code module is loaded. +The `WasmSandbox` represents a sandbox state that is not completely ready for use. While it does have the `hyperlight-wasm-runtime` guest binary loaded into it (see [Rust.md](./Rust.md) for more details on this guest binary), and the Wasm runtime initialised, it is missing a user's WebAssembly module code. The 'WasmSandbox' type is an intermediate state that is designed to be cached in a host to avoid having to pay the cost of loading the `hyperlight-wasm-runtime` guest binary and initializing the Wasm runtime each time a new user code module is loaded. Loading user code is the final initialization step necessary to have a ready-to-use sandbox, so moving from the `WasmSandbox` state to the `LoadedWasmSandbox` state requires specifying what user code to load. See the "State transitions" section below for details on making this state transition. diff --git a/docs/wasm-modules-debugging.md b/docs/wasm-modules-debugging.md index fbe2e8be..e7a0d7cd 100644 --- a/docs/wasm-modules-debugging.md +++ b/docs/wasm-modules-debugging.md @@ -39,7 +39,7 @@ After you attach, you can set breakpoints, step through the code, and inspect va { "id": "program", "type": "promptString", - "default": "x64/debug/wasm_runtime", + "default": "x64/debug/hyperlight_wasm_runtime", "description": "Path to the program to debug" }, ], diff --git a/src/hyperlight_wasm/Cargo.toml b/src/hyperlight_wasm/Cargo.toml index c954a2ce..04ee71be 100644 --- a/src/hyperlight_wasm/Cargo.toml +++ b/src/hyperlight_wasm/Cargo.toml @@ -60,7 +60,7 @@ log = "0.4" cfg-if = "1" metrics = "0.24.3" env_logger = "0.11.9" -wasm-runtime.workspace = true +hyperlight-wasm-runtime.workspace = true [target.'cfg(windows)'.dependencies] windows = { version = "0.62", features = ["Win32_System_Threading"] } diff --git a/src/hyperlight_wasm/build.rs b/src/hyperlight_wasm/build.rs index 8616decf..583786b4 100644 --- a/src/hyperlight_wasm/build.rs +++ b/src/hyperlight_wasm/build.rs @@ -16,11 +16,11 @@ limitations under the License. // build.rs -// The purpose of this build script is to embed the wasm_runtime binary as a resource in the hyperlight-wasm binary. -// This is done by reading the wasm_runtime binary into a static byte array named WASM_RUNTIME. -// this build script writes the code to do that to a file named wasm_runtime_resource.rs in the OUT_DIR. +// The purpose of this build script is to embed the hyperlight-wasm-runtime binary as a resource in the hyperlight-wasm binary. +// This is done by reading the hyperlight-wasm-runtime binary into a static byte array named WASM_RUNTIME. +// this build script writes the code to do that to a file named built.rs in the OUT_DIR. // this file is included in lib.rs. -// The wasm_runtime binary is expected to be in the x64/{config} directory. +// The hyperlight-wasm-runtime binary is expected to be in the x64/{config} directory. use std::fs::OpenOptions; use std::io::Write; @@ -50,8 +50,8 @@ fn get_wasm_runtime_manifest_path() -> PathBuf { // "packages": [ // ..., // { - // "name": "wasm-runtime", - // "manifest_path": "/path/to/wasm-runtime/Cargo.toml", + // "name": "hyperlight-wasm-runtime", + // "manifest_path": "/path/to/hyperlight-wasm-runtime/Cargo.toml", // ... // }, // ... @@ -74,14 +74,14 @@ fn get_wasm_runtime_manifest_path() -> PathBuf { let metadata: CargoMetadata = serde_json::from_slice(&output.stdout).expect("Failed to parse cargo metadata"); - // find the package entry for wasm-runtime and get its manifest_path - let wasm_runtime = metadata + // find the package entry for hyperlight-wasm-runtime and get its manifest_path + let hyperlight_wasm_runtime = metadata .packages .into_iter() - .find(|pkg| pkg.name == "wasm-runtime") - .expect("wasm-runtime crate not found in cargo metadata"); + .find(|pkg| pkg.name == "hyperlight-wasm-runtime") + .expect("hyperlight-wasm-runtime crate not found in cargo metadata"); - wasm_runtime.manifest_path + hyperlight_wasm_runtime.manifest_path } fn find_target_dir() -> PathBuf { @@ -121,7 +121,7 @@ fn build_wasm_runtime() -> PathBuf { let runtime_dir = manifest_path.parent().unwrap(); if !runtime_dir.exists() { - panic!("missing wasm_runtime in-tree dependency"); + panic!("missing hyperlight-wasm-runtime in-tree dependency"); } println!("cargo::rerun-if-changed={}", runtime_dir.display()); @@ -156,17 +156,17 @@ fn build_wasm_runtime() -> PathBuf { } cmd.status() - .unwrap_or_else(|e| panic!("could not run cargo build wasm_runtime: {e:?}")); + .unwrap_or_else(|e| panic!("could not run cargo build hyperlight-wasm-runtime: {e:?}")); let resource = target_dir .join("x86_64-hyperlight-none") .join(profile) - .join("wasm_runtime"); + .join("hyperlight-wasm-runtime"); if let Ok(path) = resource.canonicalize() { if std::env::var("CARGO_FEATURE_GDB").is_ok() { println!( - "cargo:warning=Wasm runtime guest binary at: {}", + "cargo:warning=Hyperlight wasm runtime guest binary at: {}", path.display() ); } @@ -174,7 +174,7 @@ fn build_wasm_runtime() -> PathBuf { path } else { panic!( - "could not find wasm_runtime after building it (expected {:?})", + "could not find hyperlight-wasm-runtime after building it (expected {:?})", resource ) } @@ -192,13 +192,13 @@ fn main() -> Result<()> { fs::write(dest_path, contents).unwrap(); - // get the wasmtime version number from the wasm_runtime metadata + // get the wasmtime version number from the hyperlight-wasm-runtime metadata let wasm_runtime_bytes = fs::read(&wasm_runtime_resource).unwrap(); let elf = goblin::elf::Elf::parse(&wasm_runtime_bytes).unwrap(); - // the wasm_runtime binary has a section named .note_hyperlight_metadata that contains the wasmtime version number - // this section is added to the wasm_runtime binary by the build.rs script in the wasm_runtime crate + // the hyperlight-wasm-runtime binary has a section named .note_hyperlight_metadata that contains the wasmtime version number + // this section is added to the hyperlight-wasm-runtime binary by the build.rs script in the hyperlight-wasm-runtime crate let section_name = ".note_hyperlight_metadata"; let wasmtime_version_number = if let Some(header) = elf.section_headers.iter().find(|hdr| { if let Some(name) = elf.shdr_strtab.get_at(hdr.sh_name) { @@ -218,13 +218,13 @@ fn main() -> Result<()> { std::str::from_utf8(metadata_bytes).unwrap() } } else { - panic!(".note_hyperlight_metadata section not found in wasm_runtime binary"); + panic!(".note_hyperlight_metadata section not found in hyperlight-wasm-runtime binary"); }; // write the build information to the built.rs file write_built_file()?; - // open the built.rs file and append the details of the wasm_runtime file + // open the built.rs file and append the details of the hyperlight-wasm-runtime file let built_path = Path::new(&out_dir).join("built.rs"); let mut file = OpenOptions::new() .create(false) @@ -254,9 +254,9 @@ fn main() -> Result<()> { writeln!(file, "{}", wasm_runtime_size).unwrap(); writeln!(file, "{}", wasm_runtime_wasmtime_version).unwrap(); - // Calculate the blake3 hash of the wasm_runtime file and write it to the wasm_runtime_resource.rs file so we can include it in the binary - let wasm_runtime = fs::read(wasm_runtime_resource).unwrap(); - let hash = blake3::hash(&wasm_runtime); + // Calculate the blake3 hash of the hyperlight-wasm-runtime file and write it to the wasm_runtime_resource.rs file so we can include it in the binary + let hyperlight_wasm_runtime = fs::read(wasm_runtime_resource).unwrap(); + let hash = blake3::hash(&hyperlight_wasm_runtime); let hash_str = format!("static WASM_RUNTIME_BLAKE3_HASH: &str = \"{}\";", hash); writeln!(file, "{}", hash_str).unwrap(); diff --git a/src/hyperlight_wasm/src/build_info.rs b/src/hyperlight_wasm/src/build_info.rs index a6233f1a..18eef299 100644 --- a/src/hyperlight_wasm/src/build_info.rs +++ b/src/hyperlight_wasm/src/build_info.rs @@ -23,19 +23,19 @@ static LOG_ONCE: Once = Once::new(); // The `built` crate is used in build.rs to generate a `built.rs` file that contains // information about the build environment. // -// In addition build.rs appends information about the wasm_runtime binary to the `built.rs` file +// In addition build.rs appends information about the hyperlight-wasm-runtime binary to the `built.rs` file // // Collectively that information is used to populate the `BuildInfo` struct. // include!(concat!(env!("OUT_DIR"), "/built.rs")); -/// The build information for the hyperligt-wasm crate +/// The build information for the hyperlight-wasm crate pub struct BuildInfo { - /// The date and time the wasm_runtime was built + /// The date and time the hyperlight-wasm-runtime was built pub wasm_runtime_created: &'static str, - /// The size of the wasm_runtime binary + /// The size of the hyperlight-wasm-runtime binary pub wasm_runtime_size: &'static str, - /// The blake3 hash of the wasm_runtime binary + /// The blake3 hash of the hyperlight-wasm-runtime binary pub wasm_runtime_blake3_hash: &'static str, /// The version of wasmtime being used by hyperlight-wasm pub wasm_runtime_wasmtime_version: &'static str, @@ -121,12 +121,24 @@ impl BuildInfo { impl std::fmt::Display for BuildInfo { fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - writeln!(f, "wasm_runtime created at: {}", self.wasm_runtime_created)?; - writeln!(f, "wasm_runtime size: {}", self.wasm_runtime_size)?; - writeln!(f, "wasm_runtime hash: {}", self.wasm_runtime_blake3_hash)?; writeln!( f, - "wasm_runtime wasmtime version: {}", + "hyperlight-wasm-runtime created at: {}", + self.wasm_runtime_created + )?; + writeln!( + f, + "hyperlight-wasm-runtime size: {}", + self.wasm_runtime_size + )?; + writeln!( + f, + "hyperlight-wasm-runtime hash: {}", + self.wasm_runtime_blake3_hash + )?; + writeln!( + f, + "hyperlight-wasm-runtime wasmtime version: {}", self.wasm_runtime_wasmtime_version )?; writeln!(f, "Package name: {}", self.package_name)?; diff --git a/src/hyperlight_wasm/src/lib.rs b/src/hyperlight_wasm/src/lib.rs index 14988171..d35875fb 100644 --- a/src/hyperlight_wasm/src/lib.rs +++ b/src/hyperlight_wasm/src/lib.rs @@ -75,9 +75,9 @@ mod tests { #[test] fn test_build_info() { let build_info = super::get_build_info(); - // calculate the blake3 hash of the wasm_runtime binary + // calculate the blake3 hash of the hyperlight-wasm-runtime binary let wasm_runtime_hash = blake3::hash(&super::sandbox::WASM_RUNTIME); - // check that the build info hash matches the wasm_runtime hash + // check that the build info hash matches the hyperlight-wasm-runtime hash assert_eq!( build_info.wasm_runtime_blake3_hash, &wasm_runtime_hash.to_string() @@ -88,7 +88,7 @@ mod tests { #[test] fn test_wasmtime_version() { let wasmtime_version = super::get_wasmtime_version(); - // get the wasmtime version from the wasm_runtime binary's Cargo.toml + // get the wasmtime version from the hyperlight-wasm-runtime binary's Cargo.toml let manifest_path = env!("CARGO_MANIFEST_PATH"); let output = std::process::Command::new("cargo") @@ -113,14 +113,14 @@ mod tests { let metadata: CargoMetadata = serde_json::from_slice(&output.stdout).expect("Failed to parse cargo metadata"); - // find the package entry for wasm-runtime and get its manifest_path - let wasm_runtime = metadata + // find the package entry for hyperlight-wasm-runtime and get its manifest_path + let hyperlight_wasm_runtime = metadata .packages .into_iter() - .find(|pkg| pkg.name == "wasm-runtime") - .expect("wasm-runtime crate not found in cargo metadata"); + .find(|pkg| pkg.name == "hyperlight-wasm-runtime") + .expect("hyperlight-wasm-runtime crate not found in cargo metadata"); - let cargo_toml_path = wasm_runtime.manifest_path; + let cargo_toml_path = hyperlight_wasm_runtime.manifest_path; let cargo_toml_content = std::fs::read_to_string(cargo_toml_path).expect("Failed to read Cargo.toml"); let cargo_toml: toml::Value = diff --git a/src/hyperlight_wasm/src/sandbox/mod.rs b/src/hyperlight_wasm/src/sandbox/mod.rs index 17513327..24b3cb80 100644 --- a/src/hyperlight_wasm/src/sandbox/mod.rs +++ b/src/hyperlight_wasm/src/sandbox/mod.rs @@ -26,7 +26,7 @@ pub(crate) mod wasm_sandbox; pub(crate) mod proto_wasm_sandbox; // This include! macro is replaced by the build.rs script. -// The build.rs script reads the wasm_runtime binary into a static byte array named WASM_RUNTIME +// The build.rs script reads the hyperlight-wasm-runtime binary into a static byte array named WASM_RUNTIME // contained in the wasm_runtime_resource.rs file. include!(concat!(env!("OUT_DIR"), "/wasm_runtime_resource.rs")); diff --git a/src/hyperlight_wasm_macro/src/lib.rs b/src/hyperlight_wasm_macro/src/lib.rs index 5ed3f8a2..9405946e 100644 --- a/src/hyperlight_wasm_macro/src/lib.rs +++ b/src/hyperlight_wasm_macro/src/lib.rs @@ -20,7 +20,7 @@ use hyperlight_component_util::*; mod wasmguest; /// Create the hyperlight_guest_wasm_init() function (called by -/// wasm_runtime:component.rs) for the wasm component type located at +/// hyperlight-wasm-runtime:component.rs) for the wasm component type located at /// $WIT_WORLD. This function registers Hyperlight /// functions for component exports (which are implemented by calling /// into wasmtime) and registers wasmtime host functions with the diff --git a/src/wasm_runtime/Cargo.lock b/src/hyperlight_wasm_runtime/Cargo.lock similarity index 100% rename from src/wasm_runtime/Cargo.lock rename to src/hyperlight_wasm_runtime/Cargo.lock diff --git a/src/wasm_runtime/Cargo.toml b/src/hyperlight_wasm_runtime/Cargo.toml similarity index 95% rename from src/wasm_runtime/Cargo.toml rename to src/hyperlight_wasm_runtime/Cargo.toml index f2fa2c14..6db3863f 100644 --- a/src/wasm_runtime/Cargo.toml +++ b/src/hyperlight_wasm_runtime/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "wasm-runtime" +name = "hyperlight-wasm-runtime" version.workspace = true rust-version.workspace = true license.workspace = true @@ -14,7 +14,7 @@ doctest = false bench = false [[bin]] -name = "wasm_runtime" +name = "hyperlight-wasm-runtime" path = "src/main.rs" test = false doctest = false diff --git a/src/wasm_runtime/build.rs b/src/hyperlight_wasm_runtime/build.rs similarity index 98% rename from src/wasm_runtime/build.rs rename to src/hyperlight_wasm_runtime/build.rs index 13f8c29d..5180de2f 100644 --- a/src/wasm_runtime/build.rs +++ b/src/hyperlight_wasm_runtime/build.rs @@ -62,7 +62,7 @@ fn main() { if cfg!(windows) { env::set_var("AR_x86_64_unknown_none", "llvm-ar"); } - cfg.compile("wasm_runtime"); + cfg.compile("wasmtime-hyperlight-platform"); println!("cargo::rerun-if-env-changed=WIT_WORLD"); println!("cargo::rustc-check-cfg=cfg(component)"); diff --git a/src/wasm_runtime/src/component.rs b/src/hyperlight_wasm_runtime/src/component.rs similarity index 100% rename from src/wasm_runtime/src/component.rs rename to src/hyperlight_wasm_runtime/src/component.rs diff --git a/src/wasm_runtime/src/hostfuncs.rs b/src/hyperlight_wasm_runtime/src/hostfuncs.rs similarity index 100% rename from src/wasm_runtime/src/hostfuncs.rs rename to src/hyperlight_wasm_runtime/src/hostfuncs.rs diff --git a/src/wasm_runtime/src/lib.rs b/src/hyperlight_wasm_runtime/src/lib.rs similarity index 94% rename from src/wasm_runtime/src/lib.rs rename to src/hyperlight_wasm_runtime/src/lib.rs index 30130aea..4db99a48 100644 --- a/src/wasm_runtime/src/lib.rs +++ b/src/hyperlight_wasm_runtime/src/lib.rs @@ -37,7 +37,7 @@ mod component; // build.rs script. The build.rs script gets the current version of // wasmtime that this runtime binary uses, and writes it to the // metadata.rs file so that it is embedded as metadata in the -// wasm_runtime binary. This allows hyperlight-wasm to then this +// hyperlight-wasm-runtime binary. This allows hyperlight-wasm to then this // metadata and log it when the hyperlight-wasm crate is loaded. include!(concat!(env!("OUT_DIR"), "/metadata.rs")); diff --git a/src/wasm_runtime/src/main.rs b/src/hyperlight_wasm_runtime/src/main.rs similarity index 96% rename from src/wasm_runtime/src/main.rs rename to src/hyperlight_wasm_runtime/src/main.rs index a5afe88d..3dfeae49 100644 --- a/src/wasm_runtime/src/main.rs +++ b/src/hyperlight_wasm_runtime/src/main.rs @@ -19,7 +19,7 @@ limitations under the License. // Since we are not explicitly using anything from the library, we need to // explicitly import it to ensure it is linked in. -extern crate wasm_runtime; +extern crate hyperlight_wasm_runtime; #[cfg(not(hyperlight))] fn main() { diff --git a/src/wasm_runtime/src/marshal.rs b/src/hyperlight_wasm_runtime/src/marshal.rs similarity index 100% rename from src/wasm_runtime/src/marshal.rs rename to src/hyperlight_wasm_runtime/src/marshal.rs diff --git a/src/wasm_runtime/src/module.rs b/src/hyperlight_wasm_runtime/src/module.rs similarity index 100% rename from src/wasm_runtime/src/module.rs rename to src/hyperlight_wasm_runtime/src/module.rs diff --git a/src/wasm_runtime/src/platform.c b/src/hyperlight_wasm_runtime/src/platform.c similarity index 100% rename from src/wasm_runtime/src/platform.c rename to src/hyperlight_wasm_runtime/src/platform.c diff --git a/src/wasm_runtime/src/platform.rs b/src/hyperlight_wasm_runtime/src/platform.rs similarity index 100% rename from src/wasm_runtime/src/platform.rs rename to src/hyperlight_wasm_runtime/src/platform.rs diff --git a/src/wasm_runtime/src/wasip1.rs b/src/hyperlight_wasm_runtime/src/wasip1.rs similarity index 100% rename from src/wasm_runtime/src/wasip1.rs rename to src/hyperlight_wasm_runtime/src/wasip1.rs diff --git a/src/wasm_runtime/.gitignore b/src/wasm_runtime/.gitignore deleted file mode 100644 index be1ad008..00000000 --- a/src/wasm_runtime/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -guest-toolchain -target