doushi4956 2019-03-15 20:42
浏览 267

在以下任何位置都找不到软件包“ bufio”

I have get go1.11.5 installed by downloading precompiled binary package directly on my ubuntu18.04. Now i want to install go1.12 by building from source, so i follow with Installing Go from source.

I set GOROOT_BOOTSTRAP=~/goroot_bootstrap

$ mkdir -p ~/goroot_bootstrap/bin
$ cp /usr/local/go/bin/go ~/goroot_bootstrap/bin/
$ echo "export GOROOT_BOOTSTRAP=~/goroot_bootstrap" >> ~/.bashrc
$ source ~/.bashrc

Then, get source

$ git clone -b release-branch.go1.12 https://github.com/golang/go.git ~/github.com/golang/go

Build

$ cd ~/github.com/golang/go/src
$ ./all.bash

It failed, and tips:

Building Go cmd/dist using /home/pi/goroot_bootstrap.
cmd/dist/imports.go:12.2: cannot find package "bufio" in any of:
        /home/pi/goroot_bootstrap/src/bufio (from $GOROOT)
        /home/pi/go/src/bufio (from $GOPATH)
...

But if i set GOROOT_BOOTSTRAP=/usr/local/go, it will success.
Then, i read source code at src/make.bash.

166  rm -f cmd/dist/dist
167  GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" GO111MODULE=off "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist

The bootstrap toolchains build cmd/dist with GOROOT="$GOROOT_BOOTSTRAP" at line 167.
If i have GOROOT_BOOTSTRAP=/usr/local/go set and success, which means building still depending old package such as bufio.

So, why it failed when setting GOROOT_BOOTSTRAP=~/goroot_bootstrap?
Do building depends old package if setting GOROOT_BOOTSTRAP=/usr/local/go?
Which one is the right method to install from source?

Any help will be grateful.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥17 pro*C预编译“闪回查询”报错SCN不能识别
    • ¥15 微信会员卡接入微信支付商户号收款
    • ¥15 如何获取烟草零售终端数据
    • ¥15 数学建模招标中位数问题
    • ¥15 phython路径名过长报错 不知道什么问题
    • ¥15 深度学习中模型转换该怎么实现
    • ¥15 HLs设计手写数字识别程序编译通不过
    • ¥15 Stata外部命令安装问题求帮助!
    • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
    • ¥15 TYPCE母转母,插入认方向