-
Notifications
You must be signed in to change notification settings - Fork 18k
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
cmd/dist: list all valid combinations of GOOS and GOARCH #12270
Comments
I've wanted this too for the Go builders. |
See also my comment on https://go-review.googlesource.com/#/c/14272/ where the map of GOOS/GOARCH pairs supporting cgo is duplicated. That could move to this internal package. /cc @minux |
so the plan is to move go/build/syslist.go file and cgoEnabled slice into a
new toplevel internal package and also add a list of currently supported
platforms.
The problem is that cmd/dist is first build with the bootstrap compiler, and
I don't how to make that pick up our new internal package.
I have another idea:
we can make cmd/dist be the single point of truth, and generate
go/build/zcgo.go
for the go/build package.
|
CL https://golang.org/cl/14278 mentions this issue. |
Hmm, I don't think the CL satisfy me. (not tested! sorry!)
My point is:
Maybe there are wrong assumptions, if so, please feel free to correct me. Thank you. hiro |
That CL is only the first step towards fixing this.
It first centralizes the information to just one place.
And note that all the entries in the cgoEnabled map
are currently supported platforms (at the time the
CL was proposed.)
|
Where is plan9? |
Let me amend what I said.
The goal is to have every supported platform appear
as key in the map.
|
gccgo? |
The gccgo story will be figured out by gccgo maintainers.
cmd/dist is only for gc.
And note that gc can build for any target supported, but
for gccgo you actually need to build and install a separate
gccgo for any platform you need.
|
Hmm, is this mean gccgo isn't able to cross compile? or need to compile libgo per platforms? Anyway, I think runtime package is an appropriate place to put compiler-dependent information. What do you think? Thank you. hiro |
For example, if you have gccgo for linux/amd64 target, then it's not
possible to build Go programs for solaris/amd64 with that gccgo.
You will have to install a gccgo specific for solaris/amd64.
I don't think the runtime should contain information about supported
platforms.
For one, it's quite reasonable for gc compiled programs to want to
know which platform does gccgo support. And for a Go 1.4 compiled
program to know what platforms another Go version supports. The
property is fundamentally a property of the toolchain, so it should be
part of the toolchain, not part of the compiled programs.
|
Finally, I am convinced by your suggestion. I still think I also suggest
Thank you for your kindly responses. hiro |
CL https://golang.org/cl/18687 mentions this issue. |
Both mips64 architectures share the same runtime/rt0 file, so we have to hardcode them in buildall.bash. Ideally we should have cmd/dist report all supported platforms, see #12270. Change-Id: I08ce35cfe0a831af5e1e8255b305efd38386fa52 Reviewed-on: https://go-review.googlesource.com/18687 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This reduces the amount of duplication. Now there is only one list of platforms supporting cgo. Update #12270. Change-Id: I5dcd55cb6be7c5bb6ce560383c71d90ab1189dc9 Reviewed-on: https://go-review.googlesource.com/14278 Run-TryBot: Minux Ma <minux@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
CL https://golang.org/cl/19837 mentions this issue. |
To easier write tooling for cross compiling it would be good to programmatically get the possible combinations of GOOS and GOARCH.
The only reference I can find is at http://golang.org/doc/install/source#environment
In addition,
go help environment
only gives examples; andgo help build
andgo help install
does not mention GOOS and GOARCH.The text was updated successfully, but these errors were encountered: