mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
src: do not emit warning when GOROOT_BOOTSTRAP is unset
Fixes #48155 Change-Id: I610a20d3af55035bb0b1047509361b204253801e Reviewed-on: https://go-review.googlesource.com/c/go/+/347273 Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com> Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
parent
7609b50701
commit
9633195ae1
2 changed files with 13 additions and 5 deletions
|
|
@ -152,14 +152,17 @@ if [ "$1" = "-v" ]; then
|
||||||
shift
|
shift
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
goroot_bootstrap_set=${GOROOT_BOOTSTRAP+"true"}
|
||||||
export GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4}
|
export GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4}
|
||||||
export GOROOT="$(cd .. && pwd)"
|
export GOROOT="$(cd .. && pwd)"
|
||||||
IFS=$'\n'; for go_exe in $(type -ap go); do
|
IFS=$'\n'; for go_exe in $(type -ap go); do
|
||||||
if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
|
if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
|
||||||
goroot=$(GOROOT='' GOOS='' GOARCH='' "$go_exe" env GOROOT)
|
goroot=$(GOROOT='' GOOS='' GOARCH='' "$go_exe" env GOROOT)
|
||||||
if [ "$goroot" != "$GOROOT" ]; then
|
if [ "$goroot" != "$GOROOT" ]; then
|
||||||
printf 'WARNING: %s does not exist, found %s from env\n' "$GOROOT_BOOTSTRAP/bin/go" "$go_exe" >&2
|
if [ "$goroot_bootstrap_set" = "true" ]; then
|
||||||
printf 'WARNING: set %s as GOROOT_BOOTSTRAP\n' "$goroot" >&2
|
printf 'WARNING: %s does not exist, found %s from env\n' "$GOROOT_BOOTSTRAP/bin/go" "$go_exe" >&2
|
||||||
|
printf 'WARNING: set %s as GOROOT_BOOTSTRAP\n' "$goroot" >&2
|
||||||
|
fi
|
||||||
GOROOT_BOOTSTRAP=$goroot
|
GOROOT_BOOTSTRAP=$goroot
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
11
src/make.rc
11
src/make.rc
|
|
@ -51,15 +51,20 @@ GOENV=off
|
||||||
GOFLAGS=()
|
GOFLAGS=()
|
||||||
GO111MODULE=()
|
GO111MODULE=()
|
||||||
GOROOT = `{cd .. && pwd}
|
GOROOT = `{cd .. && pwd}
|
||||||
if(! ~ $#GOROOT_BOOTSTRAP 1)
|
goroot_bootstrap_set = 'true'
|
||||||
|
if(! ~ $#GOROOT_BOOTSTRAP 1){
|
||||||
|
goroot_bootstrap_set = 'false'
|
||||||
GOROOT_BOOTSTRAP = $home/go1.4
|
GOROOT_BOOTSTRAP = $home/go1.4
|
||||||
|
}
|
||||||
for(p in $path){
|
for(p in $path){
|
||||||
if(! test -x $GOROOT_BOOTSTRAP/bin/go){
|
if(! test -x $GOROOT_BOOTSTRAP/bin/go){
|
||||||
if(go_exe = `{path=$p whatis go}){
|
if(go_exe = `{path=$p whatis go}){
|
||||||
goroot = `{GOROOT='' $go_exe env GOROOT}
|
goroot = `{GOROOT='' $go_exe env GOROOT}
|
||||||
if(! ~ $goroot $GOROOT){
|
if(! ~ $goroot $GOROOT){
|
||||||
echo 'WARNING: '$GOROOT_BOOTSTRAP'/bin/go does not exist, found '$go_exe' from env' >[1=2]
|
if(~ $goroot_bootstrap_set 'true'){
|
||||||
echo 'WARNING: set '$goroot' as GOROOT_BOOTSTRAP' >[1=2]
|
echo 'WARNING: '$GOROOT_BOOTSTRAP'/bin/go does not exist, found '$go_exe' from env' >[1=2]
|
||||||
|
echo 'WARNING: set '$goroot' as GOROOT_BOOTSTRAP' >[1=2]
|
||||||
|
}
|
||||||
GOROOT_BOOTSTRAP = $goroot
|
GOROOT_BOOTSTRAP = $goroot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue