Skip to content

Commit fd4c52e

Browse files
committed
Clean up our samples and structue them like upstream HL
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
1 parent 3124e14 commit fd4c52e

38 files changed

Lines changed: 181 additions & 62 deletions

File tree

.github/dependabot.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ updates:
3232
- dependency-name: "wasmtime"
3333
update-types: ["version-update:semver-minor", "version-update:semver-major"]
3434
- package-ecosystem: "cargo"
35-
directory: "/src/rust_wasm_samples"
35+
directory: "/src/tests/rust_guests/rust_wasm_samples"
3636
schedule:
3737
interval: "daily"
3838
time: "03:00"
@@ -48,7 +48,7 @@ updates:
4848
labels:
4949
- "kind/dependencies"
5050
- package-ecosystem: "cargo"
51-
directory: "/src/component_sample"
51+
directory: "/src/tests/rust_guests/component_sample"
5252
schedule:
5353
interval: "daily"
5454
time: "03:00"

.github/workflows/dep_build_wasm_examples.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ jobs:
6666
# Only push if not from a fork, not from pull request, and not from dependabot
6767
uses: docker/build-push-action@v6
6868
with:
69-
context: src/wasmsamples
70-
file: src/wasmsamples/dockerfile
69+
context: src/tests/c_guests/wasmsamples
70+
file: src/tests/c_guests/wasmsamples/dockerfile
7171
load: true
7272
push: ${{ env.DO_PUSH }}
7373
build-args: |
@@ -81,7 +81,6 @@ jobs:
8181
just ensure-tools
8282
just build-wasm-examples release
8383
shell: bash
84-
working-directory: src/wasmsamples
8584
- name: Upload Wasm Modules
8685
uses: actions/upload-artifact@v4
8786
with:

.github/workflows/dep_rust.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,6 @@ jobs:
120120
# required for gh cli when downloading
121121
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
122122

123-
- name: Test Component Model Examples
124-
run: just examples-components ${{ matrix.config }}
125-
working-directory: ./src/hyperlight_wasm
126-
127123
### Benchmarks ###
128124

129125
- name: Download benchmarks from "latest"

Cargo.toml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[workspace]
22
members = [ "src/hyperlight_wasm", "src/examples_common", "src/hyperlight_wasm_aot", "src/hyperlight_wasm_runtime", "src/hyperlight_wasm_macro" ]
3-
exclude = [ "src/rust_wasm_samples", "src/component_sample", "src/greeter_sample" ]
3+
exclude = [ "src/tests/rust_guests/rust_wasm_samples", "src/tests/rust_guests/component_sample", "src/tests/rust_guests/greeter_sample" ]
44
resolver = "2"
55

66
[workspace.package]
@@ -13,11 +13,5 @@ repository = "https://github.com/hyperlight-dev/hyperlight-wasm"
1313
readme = "README.md"
1414

1515
[workspace.dependencies]
16-
hyperlight-common = { git = "https://github.com/hyperlight-dev/hyperlight", rev = "c9a1a4cefce6a085af92e375121e9f1b1c8deeec", default-features = false }
17-
hyperlight-component-macro = { git = "https://github.com/hyperlight-dev/hyperlight", rev = "c9a1a4cefce6a085af92e375121e9f1b1c8deeec" }
18-
hyperlight-component-util = { git = "https://github.com/hyperlight-dev/hyperlight", rev = "c9a1a4cefce6a085af92e375121e9f1b1c8deeec" }
19-
hyperlight-guest = { git = "https://github.com/hyperlight-dev/hyperlight", rev = "c9a1a4cefce6a085af92e375121e9f1b1c8deeec" }
20-
hyperlight-guest-bin = { git = "https://github.com/hyperlight-dev/hyperlight", rev = "c9a1a4cefce6a085af92e375121e9f1b1c8deeec", features = [ "printf" ] }
21-
hyperlight-host = { git = "https://github.com/hyperlight-dev/hyperlight", rev = "c9a1a4cefce6a085af92e375121e9f1b1c8deeec", default-features = false, features = ["executable_heap"] }
22-
hyperlight-wasm-macro = { version = "0.13.0", path = "src/hyperlight_wasm_macro" }
23-
hyperlight-wasm-runtime = { version = "0.13.0", path = "src/hyperlight_wasm_runtime" }
16+
hyperlight-host = { version = "0.13.0", default-features = false, features = ["executable_heap", "init-paging"] }
17+
hyperlight-common = { version = "0.13.0", default-features = false }

Justfile

Lines changed: 41 additions & 34 deletions
Large diffs are not rendered by default.

src/hyperlight_wasm/benches/benchmarks_components.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use crate::bindings::example::runcomponent::Guest;
88
extern crate alloc;
99
mod bindings {
1010
hyperlight_component_macro::host_bindgen!(
11-
"../../src/wasmsamples/components/runcomponent-world.wasm"
11+
"../../src/tests/c_guests/wasmsamples/components/runcomponent-world.wasm"
1212
);
1313
}
1414

src/hyperlight_wasm/examples/c-component/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::bindings::example::runcomponent::Guest;
66
extern crate alloc;
77
mod bindings {
88
hyperlight_component_macro::host_bindgen!(
9-
"../../src/wasmsamples/components/runcomponent-world.wasm"
9+
"../../src/tests/c_guests/wasmsamples/components/runcomponent-world.wasm"
1010
);
1111
}
1212

src/hyperlight_wasm/examples/component_example/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use examples_common::get_wasm_module_path;
88
extern crate alloc;
99
mod bindings {
1010
hyperlight_component_macro::host_bindgen!({
11-
path: "../component_sample/wit/component-world.wasm",
11+
path: "../tests/rust_guests/component_sample/wit/component-world.wasm",
1212
});
1313
}
1414

src/hyperlight_wasm/examples/component_greeter_example/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ mod bindings {
1212
// and we select "greeter-world" via world_name.
1313
// Both worlds import the same "host" interface, showing interface reuse.
1414
hyperlight_component_macro::host_bindgen!({
15-
path: "../component_sample/wit/component-world.wasm",
15+
path: "../tests/rust_guests/component_sample/wit/component-world.wasm",
1616
world_name: "greeter-world",
1717
});
1818
}

src/hyperlight_wasm/scripts/build-wasm-examples.bat

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@echo off
2-
pushd %~dp0\..\..\wasmsamples
3-
call :NORMALIZEPATH "..\..\x64\%1"
2+
pushd %~dp0\..\..\tests\c_guests\wasmsamples
3+
call :NORMALIZEPATH "..\..\..\..\x64\%1"
44
echo "%ABSPATH%"
55
call compile-wasm.bat "." "%ABSPATH%"
66
popd

0 commit comments

Comments
 (0)