Comments (16)
the current arm is v? btw, really hope can do in one shell, I am good at shell, maybe I can be some help.
from xgo.
v5
Definitely needs separate docker containers as both Go installations as well as C cross compilation toolkits conflict each other.
from xgo.
what about put go in different directories?
from xgo.
Are you sure it's v5? When I use xgo to cross compile, I get:
runtime: this CPU has no floating point hardware, so it cannot run this GOARM=6 binary. Recompile using GOARM=5.
from xgo.
That's a tad odd. I am compiling with Dave Cheney's arm tarballs from here (1.3.3 for now), as speced in the dockerfile. Could you provide the import path of the package you are building so I could debug it?
from xgo.
I think it's because here:
https://github.com/karalabe/xgo/blob/master/docker/base/Dockerfile#L114
you're not setting GOARM=5, and so it's using the default GOARM=6
from xgo.
And here's a simple test package that demonstrates the problem. Uses mattn's SQLite wrapper, which requires CGO, and just keeps inserting rows in a test db and reporting how many are in there.
https://github.com/hasty/go-sqlite-test
from xgo.
Yeah, it was the missing GOARM=5. I'll submit a PR.
from xgo.
Good catch. I am primarily using xgo to cross compile Iris, and I didn't have such problems, alas, Iris has CGO only windows and osx side, but on Linux is pure Go. I'm guessing that's why I got away with the bug :) Send the PR and I'll merge it (if it doesn't break iris on my rpi O:) )
from xgo.
Submitted. Also threw in another one to bump up to 1.4.
from xgo.
Cool, both. I'll merge them, do some tests locally too and on the docker registry too and if all works, I'll push an announce on the golang nuts list :)
from xgo.
I've merged your prs, thanks a million :) I've also found a subtle bug where platform dependent dependencies weren't being pulled in. Fixed that also.
Now the odd thing is, that everything works perfectly on my desktop, but osx cross compilation fails on my laptop. Which is very annoying, given that both runs the same OS, version, Go, docker and I've dumped all images and pulled fresh ones on both. Yet still, one runs always perfectly, the other always fails, returning an annoying Exit status 132 error (gr8, thx).
Could you eventually verify that everything works on your end?
> xgo -go 1.4 github.com/project-iris/iris
[...]
Moving binaries to host...
Or the failing one
> xgo -go 1.4 github.com/project-iris/iris
[...]
Compiling for darwin/amd64...
2014/12/17 17:36:38 Failed to cross compile package: exit status 132.
from xgo.
After debugging a bit, it seams that the osxcross-env fails with an Illegal instruction. A wild hunch is that the docker registry compiles in on a relatively modern CPU, and my Core2 laptop doesn't support some instruction set. Which is imho a bit disappointing, as this will mean that docker containers can randomly blow up from one day to the next.
Yep: moby/moby#9003
from xgo.
Yep, OSX crosscompile happily works for me, though I'm on an i7, so wouldn't expect to see that error.
from xgo.
Thanks for the confirmation! At least the problem is easy-ish to fix, just have to decide whether to fix it or not (i.e. do I want to force Core2 or should we look to the future).
from xgo.
Hi. I ran into the same Illegal Instruction
issue as well. It was fixable by supplying a new OSX SDK (10.10, compiled with min-version 10.6 though). I also made it available for download. What is the best way to submit a patch to the Dockerfile
(base). Sorry i have to ask, as i am quite new to Docker…
from xgo.
Related Issues (20)
- Handle ellipsis (cmd/...) syntax for producing multiple distinct programs HOT 2
- Cleanup leftover docker containers on main process kill
- Outside project not in GOPATH can't use go mod with build tags -mod=vendor
- Using with libgit2 (git2go) HOT 1
- How to set go env `GOPROXY=https://goproxy.cn,direct` in the docker container? HOT 1
- Provide precompiled binary on gh-action
- [Feature Request] Support building MSI
- Can't cross-compile a project because of the need for Go 1.14. Is this project still in development?
- Zig equivalent
- How do I set CGO_CFLAGS?
- compile gon2n error
- No $GOPATH is set or forwarded to xgo HOT 1
- Is this project dead? HOT 1
- Upgrade to Go 1.16 (latest) HOT 2
- provide additional header files HOT 1
- Windows binaries silently fail to execute
- Stable release? HOT 2
- Support for go1.16 HOT 1
- C/C++ equivalent?
- Windows 10 Defender flags exe as trojan HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xgo.