fgo icon indicating copy to clipboard operation
fgo copied to clipboard

Cannot build app, error Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.

Open asannikov opened this issue 4 years ago • 1 comments

I'm not sure i understand correct what GOROOT_BOOTSTRAP is, but i tried to do different cases:

i get an error on fgo build:

  1. export GOROOT_BOOTSTRAP=/usr/local/bin/go.

error:

ERROR: Cannot find /usr/local/bin/go/bin/go. Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.

  1. export GOROOT_BOOTSTRAP=/usr/local/ (as /usr/local/opt/go/libexec/src/make.bash has a check):
export GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4}
export GOROOT="$(cd .. && pwd)"
IFS=$'\n'; for go_exe in $(type -ap go); do
	if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
		goroot=$(GOROOT='' GOOS='' GOARCH='' "$go_exe" env GOROOT)
		if [ "$goroot" != "$GOROOT" ]; then
			GOROOT_BOOTSTRAP=$goroot
		fi
	fi
done; unset IFS
if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
	echo "ERROR: Cannot find $GOROOT_BOOTSTRAP/bin/go." >&2
	echo "Set \$GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4." >&2
	exit 1
fi

error:

cmd/dist/test.go:17:2: cannot find package "reflect" in any of: /usr/local/src/reflect (from $GOROOT)

seems, it does not see go libs at all.

i investigated the code a bit and generate the command manually: make build release VERSION=1.5.0 GHRFLAGS= it produces the same errors.

go env:

go env GO111MODULE="" GOARCH="amd64" GOBIN="" GOCACHE="/Users/sa/Library/Caches/go-build" GOENV="/Users/sa/Library/Application Support/go/env" GOEXE="" GOFLAGS="" GOHOSTARCH="amd64" GOHOSTOS="darwin" GOINSECURE="" GOMODCACHE="/Users/sa/go/pkg/mod" GONOPROXY="" GONOSUMDB="" GOOS="darwin" GOPATH="/Users/sa/go" GOPRIVATE="" GOPROXY="https://proxy.golang.org,direct" GOROOT="/usr/local/opt/go/libexec" GOSUMDB="sum.golang.org" GOTMPDIR="" GOTOOLDIR="/usr/local/opt/go/libexec/pkg/tool/darwin_amd64" GCCGO="gccgo" AR="ar" CC="clang" CXX="clang++" CGO_ENABLED="1" GOMOD="" CGO_CFLAGS="-g -O2" CGO_CPPFLAGS="" CGO_CXXFLAGS="-g -O2" CGO_FFLAGS="-g -O2" CGO_LDFLAGS="-g -O2" PKG_CONFIG="pkg-config" GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/4j/5xf34w1x06x0048qrkj3bgcr0000gn/T/go-build381389970=/tmp/go-build -gno-record-gcc-switches -fno-common"

asannikov avatar Jan 07 '21 21:01 asannikov

it seems the last version of fgo does not support go1.15, as this command make build release VERSION=1.5.0 GHRFLAGS= does not work with go1.15.

I found a workaround by installing go1.14:

brew install [email protected] brew unlink go brew link [email protected] echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc

Why make build does not work with go1.15 is described here https://docs.google.com/document/d/1OaatvGhEAq7VseQ9kkavxKNAfepWy2yhPUBs96FGV28/edit

asannikov avatar Jan 08 '21 22:01 asannikov