duanran3115 2016-09-12 20:13
浏览 33

使用现有的自制程序来引导Golang安装的最佳方法

The Go tool chain was rewritten in Go, requiring a prior Go compiler to exist to perform the install.

You can point to an existing compiler using the GOROOT_BOOTSTRAP environment variable.

In my situation I have Go already installed by Homebrew. Going forward I want to compile from the source and not by 'brew upgrade go'. I want to use the Homebrew install to compile the latest source, as it already exists on the system.

the following throws an error ("Cannot find packages")

cd $GOPATH/src/github.com/golang/go/src
GOROOT_BOOTSTRAP=/usr/local/Cellar/go/1.6.2 ./all.bash

and so does this ("Cannot find /usr/local/Cellar/go/1.6.2/go/bin/go")

GOROOT_BOOTSTRAP=/usr/local/Cellar/go/1.6.2/go ./all.bash

but this works (mostly, except for me it fails with a Python _lldb.so plug-in error)

GOROOT_BOOTSTRAP=/usr/local/Cellar/go/1.6.2/libexec ./all.bash

What does the "libexec" do in this context? and is there a better way to install golang with the prior compiler being from homebrew?

  • 写回答

1条回答 默认 最新

  • dongsheng8158 2018-04-01 21:05
    关注

    Post version 1.4 Go is written in go so you need to install something that can understand and compile go natively, often called the go toolchain.

    Don't change anything else just install the latest 1.4 version and point GOROOT_BOOTSTRAP at this. In my case I installed Go 1.4.3 and placed into a directory C:\Go143 and on windows did this set GOROOT_BOOTSTRAP=C:\Go143

    All worked after that

    评论

报告相同问题?

悬赏问题

  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测
  • ¥15 ETLCloud 处理json多层级问题
  • ¥15 matlab中使用gurobi时报错
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么