mirror of
https://github.com/golang/go.git
synced 2025-05-29 03:11:26 +00:00
cmd/dist: don't use "uname -v" to recognize GOHOSTARCH
We can use processor architecture or hardware platform as part of hostname and it leads to misconfiguration of GOHOSARCH. For example, $ uname -m -v FreeBSD 10.1-RELEASE-p5 #0: Tue Jan 27 08:52:50 UTC 2015 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC i386 Change-Id: I499efd98338beff6a27c03f03273331ecb6fd698 Reviewed-on: https://go-review.googlesource.com/4944 Reviewed-by: Minux Ma <minux@golang.org>
This commit is contained in:
parent
194ad16b83
commit
18f273ff92
4
src/cmd/dist/util.go
vendored
4
src/cmd/dist/util.go
vendored
@ -376,7 +376,7 @@ func main() {
|
|||||||
|
|
||||||
if gohostarch == "" {
|
if gohostarch == "" {
|
||||||
// Default Unix system.
|
// Default Unix system.
|
||||||
out := run("", CheckExit, "uname", "-m", "-v")
|
out := run("", CheckExit, "uname", "-m")
|
||||||
switch {
|
switch {
|
||||||
case strings.Contains(out, "x86_64"), strings.Contains(out, "amd64"):
|
case strings.Contains(out, "x86_64"), strings.Contains(out, "amd64"):
|
||||||
gohostarch = "amd64"
|
gohostarch = "amd64"
|
||||||
@ -389,7 +389,7 @@ func main() {
|
|||||||
case strings.Contains(out, "ppc64"):
|
case strings.Contains(out, "ppc64"):
|
||||||
gohostarch = "ppc64"
|
gohostarch = "ppc64"
|
||||||
case gohostos == "darwin":
|
case gohostos == "darwin":
|
||||||
if strings.Contains(out, "RELEASE_ARM_") {
|
if strings.Contains(run("", CheckExit, "uname", "-v"), "RELEASE_ARM_") {
|
||||||
gohostarch = "arm"
|
gohostarch = "arm"
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user