Code Monkey home page Code Monkey logo

Comments (4)

mrnugget avatar mrnugget commented on June 15, 2024

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:

  1. Setup local wasmtime checkout for building locally. End result should be that cargo build works and produces the wasmtime lib.
  2. mkdir -p $GOPATH/src/github.com/bytecodealliance
  3. cd $GOPATH/src/github.com/bytecodealliance
  4. git clone https://github.com/bytecodealliance/wasmtime-go
  5. cd wasmtime-go
  6. ./ci/local.sh ~/path/to/local/wasmtime/checkout
  7. go install .

from wasmtime-go.

alexcrichton avatar alexcrichton commented on June 15, 2024

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.

avidal avatar avidal commented on June 15, 2024

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.

mrnugget avatar mrnugget commented on June 15, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.