moovweb/gokogiri

Attempting to cross compile for linux/amd64 on OSX fails using gox

Closed this issue · 1 comments

As stated in title. I am unable to cross compile my app after importing gokogiri. Using Gox, and attempting to build for linux/amd64, I get the following error.

--> linux/amd64 error: exit status 1
Stderr: ../github.com/moovweb/gokogiri/gokogiri.go:11:2: C source files not allowed when not using     cgo: helper.c
../github.com/moovweb/gokogiri/html/document.go:16:2: C source files not allowed when not using cgo: helper.c

After some investigation it appears you're not supposed to cross compile go apps that use C libraries. To solve this I just SCP'd the directory of the app to my linux box and built it natively.