Giter Site home page Giter Site logo

Comments (16)

codeskyblue avatar codeskyblue commented on August 26, 2024

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.

karalabe avatar karalabe commented on August 26, 2024

v5

Definitely needs separate docker containers as both Go installations as well as C cross compilation toolkits conflict each other.

from xgo.

codeskyblue avatar codeskyblue commented on August 26, 2024

what about put go in different directories?

from xgo.

hasty avatar hasty commented on August 26, 2024

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.

karalabe avatar karalabe commented on August 26, 2024

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.

hasty avatar hasty commented on August 26, 2024

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.

hasty avatar hasty commented on August 26, 2024

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.

hasty avatar hasty commented on August 26, 2024

Yeah, it was the missing GOARM=5. I'll submit a PR.

from xgo.

karalabe avatar karalabe commented on August 26, 2024

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.

hasty avatar hasty commented on August 26, 2024

Submitted. Also threw in another one to bump up to 1.4.

from xgo.

karalabe avatar karalabe commented on August 26, 2024

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.

karalabe avatar karalabe commented on August 26, 2024

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.

karalabe avatar karalabe commented on August 26, 2024

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.

hasty avatar hasty commented on August 26, 2024

Yep, OSX crosscompile happily works for me, though I'm on an i7, so wouldn't expect to see that error.

from xgo.

karalabe avatar karalabe commented on August 26, 2024

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.

jens-a-e avatar jens-a-e commented on August 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.