Building golang project on ARM board gets "imports runtime: C source files not allowed when not using cgo or SWIG" error
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snapcraft |
Expired
|
Undecided
|
Unassigned |
Bug Description
I have used my own snappy project at https:/
https:/
When I am trying to build my snap app, and I come with the following error:
ubuntu@
Pulling webserver
env GOPATH=
package github.
imports runtime: C source files not allowed when not using cgo or SWIG: defs.c float.c heapdump.c lfstack.c malloc.c mcache.c mcentral.c mem_linux.c mfixalloc.c mgc0.c mheap.c msize.c os_linux.c os_linux_arm.c panic.c parfor.c proc.c runtime.c signal.c signal_arm.c signal_unix.c softfloat_arm.c stack.c string.c sys_arm.c vlrt.c
Failed doing pull for webserver: Command '['/bin/sh', '/tmp/tmpr13qjaa9', 'env', 'GOPATH=
http://
The same problem happens on a real ARM board compilation. The golang and golang-go have been successfully installed on the system. The dockerfile can be found at
http://
A simple workaround solution is to do the following command:
bash < <(curl -s -S -L https:/
source ./.gvm/scripts/gvm
Then everything becomes OK.
Thanks & best regards,
XiaoGuo
Hello!
I tried this in a xenial lxc inside my beagle bone. I didn't get this error. I got plenty of problems, but not this one.
I had to ifup eth0, set a nameserver, install snapcraft (which prints an error but seems to work alright afterwards).
Then I got your yaml and your png, and run snapcraft. On the first run, it failed to install the dependencies (same thing as with snapcraft, something to do with systemd). On the second run, I got the snap:
Generated 'go-webserver_ 1.0.7_armhf. snap' snap
So, not a nice journey, but doesn't fail with that import runtime error.