Cross compilation guide

How do you cross compile Grafana? The normal golang way does not work. I have found some threads asking similar question, but I have not been able to figure out all the flags that need to be set. For example:

go run build.go -goarch=armv7 -cgo-enabled=1 -cc=arm-linux-gnueabihf-gcc -cxx=arm-linux-gnueabihf-g++ -pkg-arch=armhf -phjs=./phantomjs build pkg-deb

What is the significance of cgo, cxx, and cc? Is there a comprehensive guide?

Last time I checked you could not cross-compile when you used cgo (used for sqlite3)

That may be true, I wouldnt know. My problem is I need to make a Linux build on my Mac. Any idea how to approach that?

Not possible right now, could be made possible if we had build flags to exclude building sqlite3

small possibility that it can work with this lib, not sure

I see. Not the answer I was hoping for but thanks anyway!

1 Like