Comments (4)
Confirmed my hunch: by setting up the local build environment in a checkout of wasmtime-go
and putting that in the $GOPATH so that go
finds it I can import wasmtime-go
in other packages.
The steps were:
- Setup local
wasmtime
checkout for building locally. End result should be thatcargo build
works and produces thewasmtime
lib. mkdir -p $GOPATH/src/github.com/bytecodealliance
cd $GOPATH/src/github.com/bytecodealliance
git clone https://github.com/bytecodealliance/wasmtime-go
cd wasmtime-go
./ci/local.sh ~/path/to/local/wasmtime/checkout
go install .
from wasmtime-go.
Ah yes, so tagged releases have pre-built binaries checked in, but if you're using the master branch you'll need to use CGO_*
env vars and will need to compile your own copy of libwasmtime.a
(or download it)
from wasmtime-go.
I believe that you need to specify a version when you use go get
, otherwise Go will download the tip of master (since there aren't any non v0 releases tagged).
Try this:
$ go get -u github.com/bytecodealliance/[email protected]
from wasmtime-go.
Thanks, that works! Note, though, that it doesn't work in the "old" $GOPATH-mode of go
:
$ go get -u github.com/bytecodealliance/[email protected]
go: cannot use path@version syntax in GOPATH mode
But it works with go modules:
$ mkdir ~/tmp/test_wasmtime
$ cd ~/tmp/test_wasmtime
$ go mod init test_wasmtime
go: creating new go.mod: module test_wasmtime
$ go get -u github.com/bytecodealliance/[email protected]
go: downloading github.com/bytecodealliance/wasmtime-go v0.16.1
# github.com/bytecodealliance/wasmtime-go
../../code/go/pkg/mod/github.com/bytecodealliance/[email protected]/module.go:7:14: warning: assigning to 'wasm_byte_t *' (aka 'char *') from 'uint8_t *' (aka 'unsigned char *') converts between pointers to integer types with different sign [-Wpointer-sign]
../../code/go/pkg/mod/github.com/bytecodealliance/[email protected]/module.go:14:14: warning: assigning to 'wasm_byte_t *' (aka 'char *') from 'uint8_t *' (aka 'unsigned char *') converts between pointers to integer types with different sign [-Wpointer-sign]
from wasmtime-go.
Related Issues (20)
- Is it possible to dynamically link several wasm modules in Go host? HOT 6
- Works with wit-bindgen? HOT 3
- Out of bounds memory access panic HOT 5
- Support for ARM macs with bazel
- Allocation too large< ~lib/rt/itcms.ts<$Index out of range,~lib/rt.ts HOT 4
- Add changelog/releases info HOT 1
- SetMaxWasmStack fails with async_stack_size error HOT 6
- Please elaborate on installation instructions for unsupported platforms HOT 1
- Does debugging work when embedding in go like rust? HOT 1
- Equivalence for `WasiCtx.insert_file` from wasmtime_wasi Rust crate HOT 14
- Minor release HOT 4
- Windows build failure: undefined reference to `_setjmp' HOT 7
- Error out when using wasmtime-go to run Python code HOT 2
- Compilation failure on 32-bit systems HOT 3
- How to monitor memory usage HOT 4
- Go get latest version failed
- Missing V15 features.component_model in config HOT 3
- Support v16? HOT 2
- Feature request: support manual freeing of resources HOT 2
- No compiled main function from file called HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wasmtime-go.