Skip to content

Commit d8c6419

Browse files
committed
enable Wizer::wasm_bulk_memory
As of Rust 1.67, the `wasm32-wasi` target seems to be using bulk memory operations by default, which means we need Wizer to support them, too. Signed-off-by: Joel Dice <[email protected]>
1 parent a943668 commit d8c6419

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

crates/spin-js-cli/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ name = "spinjs"
88
path = "src/main.rs"
99

1010
[dependencies]
11-
wizer = "1.4.0"
11+
wizer = "1.6.0"
1212
structopt = "0.3"
1313
anyhow = "1.0"
1414
tempfile = "3.2.0"

crates/spin-js-cli/src/main.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ use {
1515
};
1616

1717
#[derive(Debug, StructOpt)]
18-
#[structopt(name = "js2wasm", about = "A spin plugin to convert javascript files to Spin compatible modules")]
18+
#[structopt(
19+
name = "js2wasm",
20+
about = "A spin plugin to convert javascript files to Spin compatible modules"
21+
)]
1922
pub struct Options {
2023
#[structopt(parse(from_os_str))]
2124
pub input: PathBuf,
@@ -29,7 +32,7 @@ fn main() -> Result<()> {
2932

3033
if env::var("SPIN_JS_WIZEN").eq(&Ok("1".into())) {
3134
env::remove_var("SPIN_JS_WIZEN");
32-
35+
3336
println!("\nStarting to build Spin compatible module");
3437

3538
let wasm: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/engine.wasm"));
@@ -40,6 +43,7 @@ fn main() -> Result<()> {
4043
let wasm = Wizer::new()
4144
.allow_wasi(true)?
4245
.inherit_stdio(true)
46+
.wasm_bulk_memory(true)
4347
.run(wasm)?;
4448
fs::write(&opts.output, wasm)?;
4549
}
@@ -50,6 +54,7 @@ fn main() -> Result<()> {
5054
let mut wasm = Wizer::new()
5155
.allow_wasi(true)?
5256
.inherit_stdio(true)
57+
.wasm_bulk_memory(true)
5358
.run(wasm)?;
5459

5560
let codegen_cfg = CodegenConfig {

test/test-app/package-lock.json

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

0 commit comments

Comments
 (0)