gimme icon indicating copy to clipboard operation
gimme copied to clipboard

Cross compilation is not working

Open mavlyutov opened this issue 8 years ago • 6 comments

Hi!

I am trying to use gimme cross compilation feature by defining GIMME_OS env var. But it seems windows and darwin builds are not affected =( In the build log of windows branch one could find: GOOS=linux moreover, go 1.6 with GIMME_OS=windows throws an error

$ eval "$(gimme 1.6)"
error: Missing bootstrap installation
error: Unable to compile go from git clone
error: Missing bootstrap installation
error: Unable to compile go from git clone
I don't have any idea what to do with '1.6'.
  (using type 'auto')

here's my config file:

language: go

go:
  - 1.6

env:
  - GIMME_OS=linux GIMME_ARCH=amd64
  - GIMME_OS=darwin GIMME_ARCH=amd64
  - GIMME_OS=windows GIMME_ARCH=amd64

install:
  - go get -d -v ./...

script:
  - go build -v

deploy:
  provider: releases
  api_key:
    secure: "Fx2Kx0KP ** SNIP ** DqGtN4Mqns="
  file: golagraphite_*
  skip_cleanup: true
  on:
    tags: true

build: https://travis-ci.org/mavlyutov/golagraphite/jobs/122741090

mavlyutov avatar Apr 13 '16 10:04 mavlyutov

I have some fixes for this in https://github.com/travis-ci/gimme/pull/45. Current gimme just tries to find an existing bootstrap, so it will fail if you didn't install one. I have a fix that also tries to find a binary bootstrap to use (gimme: Try binary bootstrap).

glevand avatar May 06 '16 19:05 glevand

I too find that none of the following Go versions will work for GIMME_OS values of "darwin" or "windows":

  • 1.6
  • 1.6.2
  • tip

The builds with GIMME_OS set to "linux" work fine for all three of those versions. Is this supposed to work?

seh avatar May 15 '16 13:05 seh

In the end, this fixed it.

Since go 1.5, the standard binaries come shipped with cross-compilation support, so the trick is to just download a recent binary, and then set GOOS and GOARCH. Any values you set for GOOS and GOARCH in the env: section will get lost, thanks to gimme, so use something else, like MY_GOOS and MY_GOARCH instead, as in the link above.

petemoore avatar Aug 01 '16 16:08 petemoore

@petemoore, I read that as, "The fix for gimme not working is to not use gimme."

seh avatar Aug 01 '16 17:08 seh

😃 ... so that is my workaround, yes! At least for go 1.5 onwards, where the standard binaries come shipped with cross compilation support.

petemoore avatar Aug 02 '16 07:08 petemoore

If this is still happening, could someone affected please report the output of gimme --version on such a broken install?

After this bug was filed, some folks did a bunch of work on setting up cross-compilation for the bootstrap binary using $GIMME_HOSTARCH and $GIMME_HOSTOS (both automatically set by gimme, probably should not be overridden).

philpennock avatar Feb 22 '18 02:02 philpennock