Skip to content

Commit 3046d02

Browse files
committed
adopt wit-dylib
This removes the built-in Wasm code generator in favor of `wit-dylib`, which is designed to be reused by interpreters for various languages. It avoids redundant effort and leaves us with less code to maintain overall. This is particularly optimized, yet. Given how `wit-dylib[-ffi]` works, we have to acquire and release the CPython GIL a lot more frequently (e.g. for every parameter and result of every import and export call). I haven't measured the overhead in practice, so I don't know if it's significant; if it is, we can make changes to `wit-dylib` to reduce the overhead. Also, `wit-dylib` currently embeds a data section with a lot of metadata that we don't use, so we could slim that down if needed. Otherwise, this should not affect the developer experience in any noticeable way. Signed-off-by: Joel Dice <joel.dice@fermyon.com> update deps Signed-off-by: Joel Dice <joel.dice@fermyon.com>
1 parent 2efafb6 commit 3046d02

File tree

12 files changed

+1547
-4665
lines changed

12 files changed

+1547
-4665
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,23 @@ clap = { version = "4.5.20", features = ["derive"] }
1414
tar = "0.4.42"
1515
tempfile = "3.13.0"
1616
zstd = "0.13.2"
17-
componentize-py-shared = { path = "shared" }
18-
wasm-encoder = "0.239.0"
19-
wit-parser = "0.239.0"
20-
wit-component = "0.239.0"
21-
wasmparser = "0.239.0"
17+
# TODO: switch to wasm-tools 1.241.0 when available
18+
wasm-encoder = { git = "https://github.com/bytecodealliance/wasm-tools", rev = "b1d8ff59" }
19+
wit-dylib = { git = "https://github.com/bytecodealliance/wasm-tools", rev = "b1d8ff59" }
20+
wit-parser = { git = "https://github.com/bytecodealliance/wasm-tools", rev = "b1d8ff59" }
21+
wit-component = { git = "https://github.com/bytecodealliance/wasm-tools", rev = "b1d8ff59" }
22+
wasmparser = { git = "https://github.com/bytecodealliance/wasm-tools", rev = "b1d8ff59" }
2223
indexmap = "2.6.0"
2324
bincode = "1.3.3"
2425
heck = "0.5.0"
2526
pyo3 = { version = "0.26.0", features = [
2627
"abi3-py39",
2728
"extension-module",
2829
], optional = true }
29-
wasmtime = "37.0.2"
30+
wasmtime = { version = "37.0.2", features = [ "component-model-async" ] }
3031
wasmtime-wasi = "37.0.2"
3132
once_cell = "1.20.2"
32-
component-init-transform = { version = "0.2", git = "https://github.com/dicej/component-init", rev = "3800ab6e" }
33+
component-init-transform = { git = "https://github.com/dicej/component-init", rev = "3b9680fe" }
3334
async-trait = "0.1.83"
3435
futures = "0.3.31"
3536
tokio = { version = "1.41.0", features = [
@@ -80,5 +81,4 @@ test-generator = { path = "test-generator" }
8081
flate2 = "1.1.1"
8182

8283
[workspace]
83-
members = ["runtime", "shared", "test-generator"]
84-
84+
members = ["runtime", "test-generator"]

runtime/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ crate-type = ["staticlib"]
1010
anyhow = "1.0.91"
1111
once_cell = "1.20.2"
1212
pyo3 = { version="0.26.0", features = ["abi3-py312", "num-bigint"] }
13-
componentize-py-shared = { path = "../shared" }
1413
num-bigint = "0.4.6"
1514
wit-bindgen = { version = "0.40.0", default-features = false, features = ["macros", "realloc"] }
1615
wit-bindgen-rt = { version = "0.40.0" }
16+
# TODO: switch to a release when available:
17+
wit-dylib-ffi = { git = "https://github.com/bytecodealliance/wasm-tools", rev = "b1d8ff59", default-features = false }

0 commit comments

Comments
 (0)