這是一個建立於
的文章,其中的資訊可能已經有所發展或是發生改變。
今天有碰到個"local error: no renegotiation"問題,就去嘗試編譯了下Go1.7beta2
記錄下:
1. 安裝 go1.4
[root@ip-172-31-16-112 src]# export GOROOT=/root/go1.4
[root@ip-172-31-16-112 src]# export PATH=$PATH:$GOROOT/bin
[root@ip-172-31-16-112 src]# ./make.bash
##### Building Go bootstrap tool.
cmd/dist
ERROR: Cannot find /root/go1.4/bin/go.
Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.
root@ip-172-31-16-112 src]# export GOROOT=/opt/go14/go
[root@ip-172-31-16-112 src]# export PATH=$PATH:$GOROOT/bin
[root@ip-172-31-16-112 src]# GOROOT_BOOTSTRAP=$GOROOT ./all.bash
##### Building Go bootstrap tool.
cmd/dist
go tool dist: FAILED: not a Git repo; must put a VERSION file in $GOROOT
2. 安裝信賴包
yum install gcc glibc-devel
[root@ip-172-31-16-112 src]# ./make.bash
##### Building Go bootstrap tool.
cmd/dist
go tool dist: FAILED: not a Git repo; must put a VERSION file in $GOROOT
vi $GOROOT/VERSION
[root@ip-172-31-16-112 go-go1.7beta2]# cat VERSION
go1.7beta2
[root@ip-172-31-16-112 src]# ./make.bash
##### Building Go bootstrap tool.
cmd/dist
##### Building Go toolchain using /root/go1.4.
errors
math
container/heap
......
---
Installed Go for linux/amd64 in /opt/go172/go-go1.7beta2
Installed commands in /opt/go172/go-go1.7beta2/bin
[root@ip-172-31-16-112 bin]# ./go version
go version go1.7beta2 linux/amd64
參考: https://golang.org/doc/install/source
https://github.com/golang/go/wiki/InstallFromSource