Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to Wasmtime 15.0.0 #199

Merged
merged 2 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ runs:
# Install the `wasm-tools` binary with the `component` subcommand that is all
# that's needed here.
- run: |
echo WASM_TOOLS=wasm-tools-1.0.35 >> $GITHUB_ENV
echo WASM_TOOLS=wasm-tools-1.0.53 >> $GITHUB_ENV
mkdir -p '${{ runner.tool_cache }}/wasm-tools'
echo '${{ runner.tool_cache }}/wasm-tools' >> $GITHUB_PATH
shell: bash
Expand Down
4 changes: 3 additions & 1 deletion ci/download-wasmtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import zipfile
from pathlib import Path

WASMTIME_VERSION = "v14.0.0"
WASMTIME_VERSION = "v15.0.0"


def main(platform, arch):
Expand Down Expand Up @@ -58,6 +58,8 @@ def final_loc(name):
if len(parts) > 1 and name.endswith('.h'):
return Path('wasmtime') / 'include' / parts[1]
elif name.endswith('.dll') or name.endswith('.so') or name.endswith('.dylib'):
if '-min.' in name:
return None
return dst
else:
return None
Expand Down
95 changes: 57 additions & 38 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ members = ['bindgen', 'wasi_snapshot_preview1']
resolver = "2"

[workspace.dependencies]
wit-bindgen = { version = "0.13.0", default-features = false, features = ['macros'] }
wit-bindgen-core = "0.13.0"
wit-bindgen = { version = "0.14.0", default-features = false, features = ['macros'] }
wit-bindgen-core = "0.14.0"

[profile.release]
strip = 'debuginfo'
4 changes: 2 additions & 2 deletions rust/bindgen.wit
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
package wasmtime:python
package wasmtime:python;

world bindgen {
export generate: func(name: string, wit: list<u8>) -> result<list<tuple<string, list<u8>>>, string>
export generate: func(name: string, wit: list<u8>) -> result<list<tuple<string, list<u8>>>, string>;
}
6 changes: 3 additions & 3 deletions rust/bindgen/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ crate-type = ['cdylib', 'rlib']
[dependencies]
anyhow = "1.0"
heck = { version = "0.4", features = ["unicode"] }
wit-parser = "0.12.1"
wit-component = "0.16.0"
wit-parser = "0.13.0"
wit-component = "0.18.0"
indexmap = "2.0"
wasmtime-environ = { version = "14.0.0", features = ['component-model'] }
wasmtime-environ = { version = "15.0.0", features = ['component-model'] }
wit-bindgen = { workspace = true, features = ['default'] }
wit-bindgen-core = { workspace = true }

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
with open("README.md", "r") as fh:
long_description = fh.read()

version = "14.0.0"
version = "15.0.0"

# Give unique version numbers to all commits so our publication-on-each commit
# works on main
Expand Down
17 changes: 8 additions & 9 deletions tests/test_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,19 @@ def test_fuel(self):
store = Store()

with self.assertRaises(WasmtimeError):
store.add_fuel(1)
store.set_fuel(1)
with self.assertRaises(WasmtimeError):
store.fuel_consumed()
store.get_fuel()

config = Config()
config.consume_fuel = True
store = Store(Engine(config))
store.add_fuel(1)
assert(store.fuel_consumed() == 0)
assert(store.consume_fuel(0) == 1)
store.add_fuel(1)
assert(store.consume_fuel(1) == 1)
with self.assertRaises(WasmtimeError):
store.consume_fuel(2)
store.set_fuel(1)
assert(store.get_fuel() == 1)
store.set_fuel(2)
assert(store.get_fuel() == 2)
store.set_fuel(0)
assert(store.get_fuel() == 0)

def test_limits(self):
store = Store()
Expand Down
Loading
Loading