Skip to content

Commit

Permalink
Update to Wasmtime 29 (#239)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton authored Jan 22, 2025
1 parent 66086d3 commit c22498c
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 20 deletions.
2 changes: 1 addition & 1 deletion BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ go_library(
],
"//conditions:default": [],
}),
importpath = "github.com/bytecodealliance/wasmtime-go/v28",
importpath = "github.com/bytecodealliance/wasmtime-go/v29",
visibility = ["//visibility:public"],
)

Expand Down
18 changes: 9 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
<a href="https://github.com/bytecodealliance/wasmtime-go/actions?query=workflow%3ACI">
<img src="https://github.com/bytecodealliance/wasmtime-go/workflows/CI/badge.svg" alt="CI status"/>
</a>
<a href="https://pkg.go.dev/github.com/bytecodealliance/wasmtime-go/v28">
<img src="https://godoc.org/github.com/bytecodealliance/wasmtime-go/v28?status.svg" alt="Documentation"/>
<a href="https://pkg.go.dev/github.com/bytecodealliance/wasmtime-go/v29">
<img src="https://godoc.org/github.com/bytecodealliance/wasmtime-go/v29?status.svg" alt="Documentation"/>
</a>
<a href="https://bytecodealliance.github.io/wasmtime-go/coverage.html">
<img src="https://img.shields.io/badge/coverage-main-green" alt="Code Coverage"/>
Expand All @@ -25,7 +25,7 @@
## Installation

```sh
go get -u github.com/bytecodealliance/wasmtime-go/v28@v28.0.0
go get -u github.com/bytecodealliance/wasmtime-go/v29@v29.0.0
```

Be sure to check out the [API documentation][api]!
Expand All @@ -39,16 +39,16 @@ need to arrange to build Wasmtime and use `CGO_*` env vars to compile correctly.

This project has been tested with Go 1.13 or later.

[api]: https://pkg.go.dev/github.com/bytecodealliance/wasmtime-go/v28
[api]: https://pkg.go.dev/github.com/bytecodealliance/wasmtime-go/v29
[wasmtime]: https://github.com/bytecodealliance/wasmtime

If you are a bazel user, add following to your WORKSPACE file:

```
go_repository(
name = "com_github_bytecodealliance_wasmtime_go",
importpath = "github.com/bytecodealliance/wasmtime-go/v28",
version = "v28.0.0",
importpath = "github.com/bytecodealliance/wasmtime-go/v29",
version = "v29.0.0",
)
```

Expand All @@ -61,7 +61,7 @@ package main

import (
"fmt"
"github.com/bytecodealliance/wasmtime-go/v28"
"github.com/bytecodealliance/wasmtime-go/v29"
)

func main() {
Expand Down Expand Up @@ -179,8 +179,8 @@ Once merged checkout `main` and do:
$ rm .gitignore
$ python3 ci/download-wasmtime.py
$ git add .
$ git commit -m 'v28.0.0 release artifacts'
$ git tag v28.0.0
$ git commit -m 'v29.0.0 release artifacts'
$ git tag v29.0.0
```

and push up the tag
2 changes: 1 addition & 1 deletion ci/download-wasmtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import glob


version = 'v28.0.0'
version = 'v29.0.1'
urls = [
['wasmtime-{}-x86_64-mingw-c-api.zip', 'windows-x86_64'],
['wasmtime-{}-x86_64-linux-c-api.tar.xz', 'linux-x86_64'],
Expand Down
9 changes: 9 additions & 0 deletions engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,3 +82,12 @@ func (engine *Engine) IncrementEpoch() {
C.wasmtime_engine_increment_epoch(engine.ptr())
runtime.KeepAlive(engine)
}

// IsPulley will return whether the current engine's execution is backed by
// the Pulley interpreter inside of Wasmtime. If this returns false then
// native execution is used instead.
func (engine *Engine) IsPulley() bool {
ret := C.wasmtime_engine_is_pulley(engine.ptr())
runtime.KeepAlive(engine)
return bool(ret)
}
1 change: 1 addition & 0 deletions engine_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ func TestEngine(t *testing.T) {
engine := NewEngine()
defer engine.Close()
NewEngineWithConfig(NewConfig())
engine.IsPulley()
}

func TestEngineInvalidatesConfig(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"time"

"github.com/bytecodealliance/wasmtime-go/v28"
"github.com/bytecodealliance/wasmtime-go/v29"
)

// Example of limiting a WebAssembly function's runtime using "fuel consumption".
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/bytecodealliance/wasmtime-go/v28
module github.com/bytecodealliance/wasmtime-go/v29

go 1.18

Expand Down
14 changes: 7 additions & 7 deletions includebuild.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ import (
// included in vendored dependencies.
// Cf. https://github.com/golang/go/issues/26366

_ "github.com/bytecodealliance/wasmtime-go/v28/build/include"
_ "github.com/bytecodealliance/wasmtime-go/v28/build/include/wasmtime"
_ "github.com/bytecodealliance/wasmtime-go/v28/build/linux-aarch64"
_ "github.com/bytecodealliance/wasmtime-go/v28/build/linux-x86_64"
_ "github.com/bytecodealliance/wasmtime-go/v28/build/macos-aarch64"
_ "github.com/bytecodealliance/wasmtime-go/v28/build/macos-x86_64"
_ "github.com/bytecodealliance/wasmtime-go/v28/build/windows-x86_64"
_ "github.com/bytecodealliance/wasmtime-go/v29/build/include"
_ "github.com/bytecodealliance/wasmtime-go/v29/build/include/wasmtime"
_ "github.com/bytecodealliance/wasmtime-go/v29/build/linux-aarch64"
_ "github.com/bytecodealliance/wasmtime-go/v29/build/linux-x86_64"
_ "github.com/bytecodealliance/wasmtime-go/v29/build/macos-aarch64"
_ "github.com/bytecodealliance/wasmtime-go/v29/build/macos-x86_64"
_ "github.com/bytecodealliance/wasmtime-go/v29/build/windows-x86_64"
)

0 comments on commit c22498c

Please sign in to comment.