Skip to content

Commit 39905c5

Browse files
authored
Update to wasmtime v37 (#512)
* Update to wasmtime v37 * Apply cargo fmt
1 parent 47d73e1 commit 39905c5

9 files changed

Lines changed: 425 additions & 460 deletions

File tree

Cargo.lock

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

Gemfile.lock

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
PATH
22
remote: .
33
specs:
4-
wasmtime (36.0.0)
4+
wasmtime (37.0.2)
55
rb_sys (~> 0.9.116)
66

77
GEM

ext/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ magnus = { version = "0.8", features = ["old-api", "rb-sys"] }
2424
rb-sys = { version = "*", default-features = false, features = [
2525
"stable-api-compiled-fallback",
2626
] }
27-
wasmtime = { version = "=36.0.0", features = ["memory-protection-keys"] }
28-
wasmtime-wasi = "=36.0.0"
27+
wasmtime = { version = "=37.0.2", features = ["memory-protection-keys"] }
28+
wasmtime-wasi = "=37.0.2"
2929
cap-std = "3.4.0"
3030
wat = "1.239.0"
3131
tokio = { version = "1.47.1", features = [
@@ -38,8 +38,8 @@ async-timer = { version = "1.0.0-beta.15", features = [
3838
"tokio1",
3939
], optional = true }
4040
static_assertions = "1.1.0"
41-
wasmtime-environ = "=36.0.0"
42-
deterministic-wasi-ctx = { version = "=3.0.1" }
41+
wasmtime-environ = "=37.0.2"
42+
deterministic-wasi-ctx = { version = "=3.0.2" }
4343

4444
[build-dependencies]
4545
rb-sys-env = "0.2.2"

ext/src/ruby_api/linker.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ impl Linker {
306306
pub(crate) fn add_wasi_p1(&self) -> Result<(), Error> {
307307
*self.has_wasi.borrow_mut() = true;
308308
let mut inner = self.inner.borrow_mut();
309-
wasmtime_wasi::preview1::add_to_linker_sync(&mut inner, |s| s.wasi_p1_ctx_mut())
309+
wasmtime_wasi::p1::add_to_linker_sync(&mut inner, |s| s.wasi_p1_ctx_mut())
310310
.map_err(|e| error!("{e}"))
311311
}
312312
}

ext/src/ruby_api/pooling_allocation_config.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use magnus::{
1010
Error, Module, Object as _, Value,
1111
};
1212
use rb_sys::{ruby_special_consts::RUBY_Qtrue, VALUE};
13-
use wasmtime::{MpkEnabled, PoolingAllocationConfig as PoolingAllocationConfigImpl};
13+
use wasmtime::{Enabled, PoolingAllocationConfig as PoolingAllocationConfigImpl};
1414

1515
use crate::{define_rb_intern, err, helpers::SymbolEnum, root};
1616

@@ -266,16 +266,16 @@ impl From<PoolingAllocationConfigImpl> for PoolingAllocationConfig {
266266

267267
define_rb_intern!(
268268
AUTO => "auto",
269-
ENABLE => "enable",
270-
DISABLE => "disable",
269+
YES => "yes",
270+
NO => "no",
271271
);
272272

273273
lazy_static! {
274-
pub static ref MPK_MAPPING: SymbolEnum<'static, MpkEnabled> = {
274+
pub static ref MPK_MAPPING: SymbolEnum<'static, Enabled> = {
275275
let mapping = vec![
276-
(*AUTO, MpkEnabled::Auto),
277-
(*ENABLE, MpkEnabled::Enable),
278-
(*DISABLE, MpkEnabled::Disable),
276+
(*AUTO, Enabled::Auto),
277+
(*YES, Enabled::Yes),
278+
(*NO, Enabled::No),
279279
];
280280

281281
SymbolEnum::new("Memory protection keys strategy", mapping)

ext/src/ruby_api/store.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use wasmtime::{
1919
AsContext, AsContextMut, ResourceLimiter, Store as StoreImpl, StoreContext, StoreContextMut,
2020
StoreLimits, StoreLimitsBuilder,
2121
};
22-
use wasmtime_wasi::preview1::WasiP1Ctx;
22+
use wasmtime_wasi::p1::WasiP1Ctx;
2323
use wasmtime_wasi::{I32Exit, ResourceTable};
2424
use wasmtime_wasi::{WasiCtx, WasiCtxView, WasiView};
2525

ext/src/ruby_api/wasi_config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ use std::fs;
1515
use std::path::Path;
1616
use std::{fs::File, path::PathBuf};
1717
use wasmtime_wasi::cli::OutputFile;
18+
use wasmtime_wasi::p1::WasiP1Ctx;
1819
use wasmtime_wasi::p2::pipe::MemoryInputPipe;
19-
use wasmtime_wasi::preview1::WasiP1Ctx;
2020
use wasmtime_wasi::{DirPerms, FilePerms, WasiCtx, WasiCtxBuilder};
2121

2222
define_rb_intern!(

lib/wasmtime/version.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# frozen_string_literal: true
22

33
module Wasmtime
4-
VERSION = "36.0.0"
4+
VERSION = "37.0.2"
55
end

spec/unit/pooling_allocation_config_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,10 @@ module Wasmtime
7070
end
7171

7272
it "allows memory_protection_keys configuration" do
73-
config.memory_protection_keys = :enable
74-
expect(config.inspect).to include("memory_protection_keys: Enable")
75-
config.memory_protection_keys = :disable
76-
expect(config.inspect).to include("memory_protection_keys: Disable")
73+
config.memory_protection_keys = :yes
74+
expect(config.inspect).to include("memory_protection_keys: Yes")
75+
config.memory_protection_keys = :no
76+
expect(config.inspect).to include("memory_protection_keys: No")
7777
config.memory_protection_keys = :auto
7878
expect(config.inspect).to include("memory_protection_keys: Auto")
7979
end

0 commit comments

Comments
 (0)