Skip to content

Commit 9338e63

Browse files
committed
Update proxy adapter for latest wasmtime
1 parent c5deb00 commit 9338e63

File tree

7 files changed

+23
-18
lines changed

7 files changed

+23
-18
lines changed

.github/workflows/examples.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
export COMPONENTIZE_PY_TEST_COUNT=0
6+
export COMPONENTIZE_PY_TEST_SEED=bc6ad1950594f1fe477144ef5b3669dd5962e49de4f3b666e5cbf9072507749a
7+
export WASMTIME_BACKTRACE_DETAILS=1
8+
9+
cargo build --release
10+
11+
(cd examples/cli \
12+
&& ../../target/release/componentize-py -d ../../wit -w wasi:cli/[email protected] componentize app -o cli.wasm)

Cargo.lock

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

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ im-rc = "15.1.0"
4747
serde = { version = "1.0.213", features = ["derive"] }
4848
toml = "0.8.19"
4949
semver = "1.0.23"
50+
wasi-preview1-component-adapter-provider = "25.0.1"
5051

5152
[dev-dependencies]
5253
proptest = "1.5.0"

adapters/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.
-94.5 KB
Binary file not shown.

build.rs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ fn stubs_for_clippy(out_dir: &Path) -> Result<()> {
6161
"libwasi-emulated-signal.so.zst",
6262
"libc++.so.zst",
6363
"libc++abi.so.zst",
64-
"wasi_snapshot_preview1.reactor.wasm.zst",
6564
];
6665

6766
for file in files {
@@ -208,13 +207,6 @@ fn package_all_the_things(out_dir: &Path) -> Result<()> {
208207
bail!("no such directory: {}", path.display())
209208
}
210209

211-
compress(
212-
&repo_dir.join("adapters/ab5a4484"),
213-
"wasi_snapshot_preview1.reactor.wasm",
214-
out_dir,
215-
false,
216-
)?;
217-
218210
Ok(())
219211
}
220212

src/lib.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,13 @@ use {
1111
serde::Deserialize,
1212
std::{
1313
collections::HashMap,
14-
env, fs,
15-
io::Cursor,
16-
iter,
14+
fs, iter,
1715
ops::Deref,
1816
path::{Path, PathBuf},
1917
str,
2018
},
2119
summary::{Escape, Locations, Summary},
20+
wasi_preview1_component_adapter_provider::WASI_SNAPSHOT_PREVIEW1_REACTOR_ADAPTER,
2221
wasmtime::{
2322
component::{Component, Instance, Linker, ResourceTable, ResourceType},
2423
Config, Engine, Store,
@@ -295,10 +294,7 @@ pub async fn componentize(
295294

296295
linker = linker.adapter(
297296
"wasi_snapshot_preview1",
298-
&zstd::decode_all(Cursor::new(include_bytes!(concat!(
299-
env!("OUT_DIR"),
300-
"/wasi_snapshot_preview1.reactor.wasm.zst"
301-
))))?,
297+
WASI_SNAPSHOT_PREVIEW1_REACTOR_ADAPTER,
302298
)?;
303299

304300
let component = linker.encode()?;

0 commit comments

Comments
 (0)