Skip to content

Commit 05b0825

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

37 files changed

Lines changed: 184 additions & 56 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"

.gitignore

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,5 +476,8 @@ target/
476476

477477
# MSVC Windows builds of rustc generate these, which store debugging information
478478
*.pdb
479-
src/component_sample/**/*.wasm
480-
src/wasmsamples/components/bindings/
479+
480+
# Build-generated binaries
481+
*.wasm
482+
*.aot
483+
*.o

Cargo.toml

Lines changed: 1 addition & 1 deletion
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]

Justfile

Lines changed: 38 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
}

0 commit comments

Comments
 (0)