Building golang project on ARM board gets "imports runtime: C source files not allowed when not using cgo or SWIG" error

Bug #1514650 reported by XiaoGuo, Liu
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Snapcraft
Expired
Undecided
Unassigned

Bug Description

I have used my own snappy project at https://github.com/liu-xiao-guo/go-webserver. I have used an armhf image inside a docker:

https://hub.docker.com/r/kickinz1/snappy-dev-cli-armhf/

When I am trying to build my snap app, and I come with the following error:

ubuntu@34fc56495ebb:~/work$ snapcraft
Pulling webserver
env GOPATH=/home/ubuntu/work/parts/webserver/build go get -t -d github.com/liu-xiao-guo/golang-http
package github.com/liu-xiao-guo/golang-http
 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=/home/ubuntu/work/parts/webserver/build', 'go', 'get', '-t', '-d', 'github.com/liu-xiao-guo/golang-http']' returned non-zero exit status 1

http://paste.ubuntu.com/13207936/

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://bazaar.launchpad.net/~kick-d/+junk/snappy-dev-docker/view/head:/tools/Dockerfile.cli.armhf

A simple workaround solution is to do the following command:

bash < <(curl -s -S -L https://raw.githubusercontent.com/moovweb/gvm/master/binscripts/gvm-installer)
source ./.gvm/scripts/gvm

Then everything becomes OK.

Thanks & best regards,
XiaoGuo

Revision history for this message
Leo Arias (elopio) wrote :

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.

Revision history for this message
Sergio Schvezov (sergiusens) wrote : Re: [Bug 1514650] Re: Building golang project on ARM board gets "imports runtime: C source files not allowed when not using cgo or SWIG" error

On Thu, Nov 12, 2015 at 6:33 PM, Leo Arias <email address hidden> wrote:

> 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).
>

What error was this? A separate bug if worthy would be nice.

> 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:
>

Due to build-packages or stage-packages?
Can you try building and installing snapcraft from master?

Revision history for this message
XiaoGuo, Liu (liu-xiao-guo) wrote :

@leo, I have shared you a document about setting up my environment. It is pretty straightforward. Would you please try and see whether you can duplicate the problem? thanks!

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

This should just work in the classic dimension, are you seeing errors there?

Changed in snapcraft:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for Snapcraft because there has been no activity for 60 days.]

Changed in snapcraft:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.