Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit 40861ae

Browse files
authored
Update Wasmtime/tooling dependencies (#14)
This forces all the `*.wit.md` file to go into one large `*.wit` file for now which will get split up later once `use` is re-introduced.
1 parent 56178af commit 40861ae

File tree

13 files changed

+1146
-1418
lines changed

13 files changed

+1146
-1418
lines changed

Cargo.lock

Lines changed: 193 additions & 239 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

host/src/lib.rs

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,7 @@ mod table;
77
pub use table::Table;
88

99
wit_bindgen_host_wasmtime_rust::generate!({
10-
import: "../wit/wasi-clocks.wit.md",
11-
import: "../wit/wasi-default-clocks.wit.md",
12-
import: "../wit/wasi-filesystem.wit.md",
13-
import: "../wit/wasi-logging.wit.md",
14-
import: "../wit/wasi-poll.wit.md",
15-
import: "../wit/wasi-random.wit.md",
16-
default: "../wit/command.wit.md",
17-
name: "wasi",
10+
path: "../wit/wasi.wit",
1811
tracing: true,
1912
});
2013

src/lib.rs

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
11
#![allow(unused_variables)] // TODO: remove this when more things are implemented
22

3-
wit_bindgen_guest_rust::generate!({
4-
import: "wit/wasi-clocks.wit.md",
5-
import: "wit/wasi-default-clocks.wit.md",
6-
import: "wit/wasi-filesystem.wit.md",
7-
import: "wit/wasi-logging.wit.md",
8-
import: "wit/wasi-poll.wit.md",
9-
import: "wit/wasi-random.wit.md",
10-
default: "wit/command.wit.md",
11-
name: "wasi_command",
12-
no_std,
13-
raw_strings,
14-
unchecked,
15-
// The generated definition of command will pull in std, so we are defining it
16-
// manually below instead
17-
skip: ["command"],
18-
});
19-
3+
use crate::bindings::{
4+
wasi_clocks, wasi_default_clocks, wasi_filesystem, wasi_logging, wasi_random,
5+
};
206
use core::arch::wasm32::unreachable;
217
use core::mem::{forget, size_of};
228
use core::ptr::{copy_nonoverlapping, null_mut};
239
use core::slice;
2410
use wasi::*;
2511

12+
mod bindings {
13+
wit_bindgen_guest_rust::generate!({
14+
path: "wit/wasi.wit",
15+
no_std,
16+
raw_strings,
17+
unchecked,
18+
// The generated definition of command will pull in std, so we are defining it
19+
// manually below instead
20+
skip: ["command"],
21+
});
22+
}
23+
2624
#[export_name = "command"]
2725
unsafe extern "C" fn command_entrypoint(stdin: i32, stdout: i32, _args_ptr: i32, _args_len: i32) {
2826
*Descriptor::get(0) = Descriptor::File(File {

test-programs/macros/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,4 @@ test = false
1313
quote = "1.0"
1414

1515
[build-dependencies]
16-
wit-component = { git = "https://github.com/bytecodealliance/wit-bindgen" }
16+
wit-component = "0.3.2"

test-programs/macros/build.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ fn main() {
2323

2424
let wasi_adapter = out_dir.join("wasm32-wasi/release/wasi_snapshot_preview1.wasm");
2525
println!("wasi adapter: {:?}", &wasi_adapter);
26+
let wasi_adapter = fs::read(&wasi_adapter).unwrap();
2627

2728
let mut cmd = Command::new("cargo");
2829
cmd.arg("build")
@@ -46,7 +47,7 @@ fn main() {
4647
.module(module.as_slice())
4748
.unwrap()
4849
.validate(true)
49-
.adapter_file(&wasi_adapter)
50+
.adapter("wasi_snapshot_preview1", &wasi_adapter)
5051
.unwrap()
5152
.encode()
5253
.expect(&format!(

wit/command.wit.md

Lines changed: 0 additions & 16 deletions
This file was deleted.

wit/wasi-clocks.wit.md

Lines changed: 0 additions & 104 deletions
This file was deleted.

wit/wasi-default-clocks.wit.md

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)