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

Cross compile failure #347

Closed
wrfly opened this issue Dec 26, 2018 · 1 comment
Closed

Cross compile failure #347

wrfly opened this issue Dec 26, 2018 · 1 comment

Comments

@wrfly
Copy link

wrfly commented Dec 26, 2018

Cross compile failure

vendor/github.com/siddontang/go-mysql/client/auth.go:11:2: 
    build constraints exclude all Go files in .../vendor/github.com/go-mysql/packet
make: *** [searcher] Error 1

Build under go version go1.10.4 darwin/amd64 with GOOS=linux.

Since the packet package (and others) imports "C":

https://github.com/siddontang/go-mysql/blob/master/packet/conn.go#L1-L8

package packet

import "C"
import (
	"bytes"
	"io"
	"net"
...

And cgo is disabled with cross compile, see golang/go#24068

Enable CGO via CGO_ENABLED=1 cannot help.

So, is there any way to pass this compile failure? (Do not want to build under docker cause of the build cache.)

Or give an explaination in README to inform others.

Thanks.

@wrfly
Copy link
Author

wrfly commented Dec 26, 2018

Solved by (If you are useing dep too):

# quite odd, see https://github.com/golang/dep/issues/1231
[[override]]
  name = "github.com/siddontang/go-mysql"
  revision = "319e088eeeb06d9fe902abdef988cd8914e673a6"

constraint not work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant