Can't cross-compile to linux amd64 due to go-sqlite3 dependency.

Issue #56 resolved
Kevin Cantwell created an issue

Perhaps there is no intent to use this tool for linux, but there seems to be some issue with the current go-sqlite3 implementation that prevents compilation to the linux platform, on amd64 architecture at least.

The issue has been raised here: https://github.com/mattn/go-sqlite3/issues/217#issuecomment-140767508

From OSX:

$ GOOS=linux GOARCH=amd64 go build -o goose cmd/goose/main.go
lib/goose/dialect.go:5:2: C source files not allowed when not using cgo or SWIG: sqlite3-binding.c

From within linux amd64 (ubuntu, ec2):

$ go get bitbucket.org/liamstask/goose
package bitbucket.org/liamstask/goose: no buildable Go source files in /home/ubuntu/gopath/src/bitbucket.org/liamstask/goose

Comments (5)

  1. Parker M

    Per the documentation, run go get -tags nosqlite bitbucket.org/liamstask/goose/cmd/goose and this should work as expected.

  2. Oscar

    @parkr, I'm having that same issue. I have tried go get -tags nosqlite bitbucket.org/liamstask/goose/cmd/goose but the error continues. @kevin-cantwell did it work for you?

  3. Parker M

    go get -tags nosqlite bitbucket.org/liamstask/goose/cmd/goose works just fine for me still – it builds the goose command into $GOPATH/bin/goose. Do not do go get bitbucket.org/liamstask/goose, or try to build just cmd/goose/main.go.

    From OS X:

    $ GOOS=linux GOARCH=amd64 go build -tags nosqlite -o goose ./cmd/goose
    

    From within linux amd64:

    $ go get -tags nosqlite bitbucket.org/liamtask/goose/cmd/goose
    
  4. Log in to comment