Skip to content

dist: add binary download for cross compilation #6597

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
adg opened this issue Oct 16, 2013 · 9 comments
Closed

dist: add binary download for cross compilation #6597

adg opened this issue Oct 16, 2013 · 9 comments

Comments

@adg
Copy link
Contributor

adg commented Oct 16, 2013

A recent post to the mailing list:
https://groups.google.com/d/msg/golang-nuts/oFIs6Puj0_Q/0_seVYRtOyYJ
suggests we include binary downloads of a cross-compiled toolchain.

It's relatively easy to do, and would benefit people who run build farms. Probably we
should only offer it for the most popular platforms (darwin/linux/windows amd64 only).
@minux
Copy link
Member

minux commented Oct 16, 2013

Comment 1:

we probably should consider the impact of not support cgo.
(a particular annoying problem is os/user.Current doesn't work without cgo
on unix)
also, i suggest we add distributions for arm cross toolchains too.
i have an idea:
1. we make misc/dist build all part of toolchain for all distribution tarballs (e.g.
windows/amd64 tarball should
contain 5g, 5c, 8g, 8c, etc)
2. we release an additional cross compilation tarball that contains compiled pkgs for
all supported platforms.
so that people can download that and properly extract into there $GOROOT/pkg and
immediately get
cross compilation capabilities without ever compiling the Go source code.
as a refinement to 2, we can divide that into cross compliation "addon" for different
OSes, e.g.
windows.zip contains pkg/windows_amd64 and pkg/windows_386
linux.zip contains pkg/linux_amd64, pkg/linux_386, and pkg/linux_arm, etc.
in this way we don't need to provide O(N^2) (N is supported platforms) tarballs to
support every case,
and yet we add full (non-cgo) cross compilation support for binary distribution users.

@rsc
Copy link
Contributor

rsc commented Nov 27, 2013

Comment 2:

Labels changed: added go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 4:

Labels changed: added release-none, removed go1.3maybe.

@rsc
Copy link
Contributor

rsc commented Dec 4, 2013

Comment 5:

Labels changed: added repo-main.

@mattn
Copy link
Member

mattn commented Jul 2, 2014

Comment 6:

pw_dir in struct passwd on OSX is at different offset of linux's one.
So if we use cross compilation, HomeDir should be broken that derefered from broken
offset pointer.

@mattn
Copy link
Member

mattn commented Jul 2, 2014

Comment 7:

We write often codes that get configuration via ~/.config/xxx. And We use cross
compilation for that. But we can't provide OSX binaries because os/user.Current()
doesn't work with cross compilation.

@minux
Copy link
Member

minux commented Jul 2, 2014

Comment 8:

Re #7, for os/user and net on platforms with binary distribution,
there is a way to cross compile packages using those packages
without setting up a gcc/clang cross-compiler.
for example, see gonative:
https://inconshreveable.com/04-30-2014/cross-compiling-golang-programs-with-native-libraries/

@adg adg self-assigned this Jul 2, 2014
@rsc rsc added this to the Unplanned milestone Apr 10, 2015
@dominikh
Copy link
Member

Is this still relevant, now that Go cross compilation works without having to do anything special?

@bradfitz
Copy link
Contributor

Probably not relevant. Most of this bug has been discussing os/user not working without cgo, but that was fixed in #14626 too.

Closing.

@golang golang locked and limited conversation to collaborators Mar 26, 2017
@rsc rsc unassigned adg Jun 22, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants