Commit ed936a3f authored by Russ Cox's avatar Russ Cox

cmd/go: implement go get + bug fixes

Move error information into Package struct, so that
a package can be returned even if a dependency failed
to load or did not exist.  This makes it possible to run
'go fix' or 'go fmt' on packages with broken dependencies
or missing imports.  It also enables go get -fix.
The new go list -e flag lets go list process those package
errors as normal data.

Change p.Doc to be first sentence of package doc, not
entire package doc.  Makes go list -json or
go list -f '{{.ImportPath}} {{.Doc}}' much more reasonable.

The go tool now depends on http, which means also
net and crypto/tls, both of which use cgo.  Trying to
make the build scripts that build the go tool understand
and handle cgo is too much work.  Instead, we build
a stripped down version of the go tool, compiled as go_bootstrap,
that substitutes an error stub for the usual HTTP code.
The buildscript builds go_bootstrap, go_bootstrap builds
the standard packages and commands, including the full
including-HTTP-support go tool, and then go_bootstrap
gets deleted.

Also handle the case where the buildscript needs updating
during all.bash: if it fails but a go command can be found on
the current $PATH, try to regenerate it.  This gracefully
handles situations like adding a new file to a package
used by the go tool.

R=r, adg
CC=golang-dev
https://golang.org/cl/5553059
parent b5777571
......@@ -29,10 +29,11 @@ set -e
# \ paths into / paths. This avoids the \ being interpreted
# as a shell escape but also makes sure that we generate the
# same scripts on Unix and Windows systems.
go install -a -n cmd/go | sed '
s/$GOBIN/"$GOBIN"/g
s/$GOROOT/"$GOROOT"/g
s/$WORK/"$WORK"/g
go install -a -n -t cmd_go_bootstrap cmd/go | sed '
s/\$GOBIN/"$GOBIN"/g
s/\$GOROOT/"$GOROOT"/g
s/\$WORK/"$WORK"/g
s;"\$GOBIN"/go;&_bootstrap;g
s;\\;/;g
'
)>$targ
......
......@@ -323,7 +323,7 @@ cp "$WORK"/bufio.a "$GOROOT"/pkg/darwin_386/bufio.a
mkdir -p "$WORK"/encoding/gob/_obj/
cd "$GOROOT"/src/pkg/encoding/gob
8g -o "$WORK"/encoding/gob/_obj/_go_.8 -p encoding/gob -I "$WORK" ./debug.go ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
8g -o "$WORK"/encoding/gob/_obj/_go_.8 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.8
cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/darwin_386/encoding/gob.a
......@@ -400,6 +400,26 @@ cd "$GOROOT"/src/pkg/log
gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.8
cp "$WORK"/log.a "$GOROOT"/pkg/darwin_386/log.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
8g -o "$WORK"/path/_obj/_go_.8 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.8
cp "$WORK"/path.a "$GOROOT"/pkg/darwin_386/path.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
8g -o "$WORK"/go/build/_obj/_go_.8 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.8
cp "$WORK"/go/build.a "$GOROOT"/pkg/darwin_386/go/build.a
#
# os/exec
#
......@@ -411,16 +431,6 @@ gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.8
mkdir -p "$GOROOT"/pkg/darwin_386/os/
cp "$WORK"/os/exec.a "$GOROOT"/pkg/darwin_386/os/exec.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
8g -o "$WORK"/path/_obj/_go_.8 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.8
cp "$WORK"/path.a "$GOROOT"/pkg/darwin_386/path.a
#
# regexp/syntax
#
......@@ -442,16 +452,6 @@ cd "$GOROOT"/src/pkg/regexp
gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.8
cp "$WORK"/regexp.a "$GOROOT"/pkg/darwin_386/regexp.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
8g -o "$WORK"/go/build/_obj/_go_.8 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.8
cp "$WORK"/go/build.a "$GOROOT"/pkg/darwin_386/go/build.a
#
# net/url
#
......@@ -491,8 +491,8 @@ cp "$WORK"/text/template.a "$GOROOT"/pkg/darwin_386/text/template.a
mkdir -p "$WORK"/cmd/go/_obj/
cd "$GOROOT"/src/cmd/go
8g -o "$WORK"/cmd/go/_obj/_go_.8 -p cmd/go -I "$WORK" ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./version.go ./vet.go
8g -o "$WORK"/cmd/go/_obj/_go_.8 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.8
8l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
mkdir -p "$GOBIN"/
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
......@@ -322,7 +322,7 @@ cp "$WORK"/bufio.a "$GOROOT"/pkg/darwin_amd64/bufio.a
mkdir -p "$WORK"/encoding/gob/_obj/
cd "$GOROOT"/src/pkg/encoding/gob
6g -o "$WORK"/encoding/gob/_obj/_go_.6 -p encoding/gob -I "$WORK" ./debug.go ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
6g -o "$WORK"/encoding/gob/_obj/_go_.6 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.6
cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/darwin_amd64/encoding/gob.a
......@@ -399,6 +399,26 @@ cd "$GOROOT"/src/pkg/log
gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.6
cp "$WORK"/log.a "$GOROOT"/pkg/darwin_amd64/log.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
6g -o "$WORK"/path/_obj/_go_.6 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.6
cp "$WORK"/path.a "$GOROOT"/pkg/darwin_amd64/path.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
6g -o "$WORK"/go/build/_obj/_go_.6 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.6
cp "$WORK"/go/build.a "$GOROOT"/pkg/darwin_amd64/go/build.a
#
# os/exec
#
......@@ -410,16 +430,6 @@ gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.6
mkdir -p "$GOROOT"/pkg/darwin_amd64/os/
cp "$WORK"/os/exec.a "$GOROOT"/pkg/darwin_amd64/os/exec.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
6g -o "$WORK"/path/_obj/_go_.6 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.6
cp "$WORK"/path.a "$GOROOT"/pkg/darwin_amd64/path.a
#
# regexp/syntax
#
......@@ -441,16 +451,6 @@ cd "$GOROOT"/src/pkg/regexp
gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.6
cp "$WORK"/regexp.a "$GOROOT"/pkg/darwin_amd64/regexp.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
6g -o "$WORK"/go/build/_obj/_go_.6 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.6
cp "$WORK"/go/build.a "$GOROOT"/pkg/darwin_amd64/go/build.a
#
# net/url
#
......@@ -490,8 +490,8 @@ cp "$WORK"/text/template.a "$GOROOT"/pkg/darwin_amd64/text/template.a
mkdir -p "$WORK"/cmd/go/_obj/
cd "$GOROOT"/src/cmd/go
6g -o "$WORK"/cmd/go/_obj/_go_.6 -p cmd/go -I "$WORK" ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./version.go ./vet.go
6g -o "$WORK"/cmd/go/_obj/_go_.6 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.6
6l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
mkdir -p "$GOBIN"/
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
......@@ -323,7 +323,7 @@ cp "$WORK"/bufio.a "$GOROOT"/pkg/freebsd_386/bufio.a
mkdir -p "$WORK"/encoding/gob/_obj/
cd "$GOROOT"/src/pkg/encoding/gob
8g -o "$WORK"/encoding/gob/_obj/_go_.8 -p encoding/gob -I "$WORK" ./debug.go ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
8g -o "$WORK"/encoding/gob/_obj/_go_.8 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.8
cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/freebsd_386/encoding/gob.a
......@@ -400,6 +400,26 @@ cd "$GOROOT"/src/pkg/log
gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.8
cp "$WORK"/log.a "$GOROOT"/pkg/freebsd_386/log.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
8g -o "$WORK"/path/_obj/_go_.8 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.8
cp "$WORK"/path.a "$GOROOT"/pkg/freebsd_386/path.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
8g -o "$WORK"/go/build/_obj/_go_.8 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.8
cp "$WORK"/go/build.a "$GOROOT"/pkg/freebsd_386/go/build.a
#
# os/exec
#
......@@ -411,16 +431,6 @@ gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.8
mkdir -p "$GOROOT"/pkg/freebsd_386/os/
cp "$WORK"/os/exec.a "$GOROOT"/pkg/freebsd_386/os/exec.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
8g -o "$WORK"/path/_obj/_go_.8 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.8
cp "$WORK"/path.a "$GOROOT"/pkg/freebsd_386/path.a
#
# regexp/syntax
#
......@@ -442,16 +452,6 @@ cd "$GOROOT"/src/pkg/regexp
gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.8
cp "$WORK"/regexp.a "$GOROOT"/pkg/freebsd_386/regexp.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
8g -o "$WORK"/go/build/_obj/_go_.8 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.8
cp "$WORK"/go/build.a "$GOROOT"/pkg/freebsd_386/go/build.a
#
# net/url
#
......@@ -491,8 +491,8 @@ cp "$WORK"/text/template.a "$GOROOT"/pkg/freebsd_386/text/template.a
mkdir -p "$WORK"/cmd/go/_obj/
cd "$GOROOT"/src/cmd/go
8g -o "$WORK"/cmd/go/_obj/_go_.8 -p cmd/go -I "$WORK" ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./version.go ./vet.go
8g -o "$WORK"/cmd/go/_obj/_go_.8 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.8
8l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
mkdir -p "$GOBIN"/
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
......@@ -322,7 +322,7 @@ cp "$WORK"/bufio.a "$GOROOT"/pkg/freebsd_amd64/bufio.a
mkdir -p "$WORK"/encoding/gob/_obj/
cd "$GOROOT"/src/pkg/encoding/gob
6g -o "$WORK"/encoding/gob/_obj/_go_.6 -p encoding/gob -I "$WORK" ./debug.go ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
6g -o "$WORK"/encoding/gob/_obj/_go_.6 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.6
cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/freebsd_amd64/encoding/gob.a
......@@ -399,6 +399,26 @@ cd "$GOROOT"/src/pkg/log
gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.6
cp "$WORK"/log.a "$GOROOT"/pkg/freebsd_amd64/log.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
6g -o "$WORK"/path/_obj/_go_.6 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.6
cp "$WORK"/path.a "$GOROOT"/pkg/freebsd_amd64/path.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
6g -o "$WORK"/go/build/_obj/_go_.6 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.6
cp "$WORK"/go/build.a "$GOROOT"/pkg/freebsd_amd64/go/build.a
#
# os/exec
#
......@@ -410,16 +430,6 @@ gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.6
mkdir -p "$GOROOT"/pkg/freebsd_amd64/os/
cp "$WORK"/os/exec.a "$GOROOT"/pkg/freebsd_amd64/os/exec.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
6g -o "$WORK"/path/_obj/_go_.6 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.6
cp "$WORK"/path.a "$GOROOT"/pkg/freebsd_amd64/path.a
#
# regexp/syntax
#
......@@ -441,16 +451,6 @@ cd "$GOROOT"/src/pkg/regexp
gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.6
cp "$WORK"/regexp.a "$GOROOT"/pkg/freebsd_amd64/regexp.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
6g -o "$WORK"/go/build/_obj/_go_.6 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.6
cp "$WORK"/go/build.a "$GOROOT"/pkg/freebsd_amd64/go/build.a
#
# net/url
#
......@@ -490,8 +490,8 @@ cp "$WORK"/text/template.a "$GOROOT"/pkg/freebsd_amd64/text/template.a
mkdir -p "$WORK"/cmd/go/_obj/
cd "$GOROOT"/src/cmd/go
6g -o "$WORK"/cmd/go/_obj/_go_.6 -p cmd/go -I "$WORK" ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./version.go ./vet.go
6g -o "$WORK"/cmd/go/_obj/_go_.6 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.6
6l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
mkdir -p "$GOBIN"/
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
......@@ -323,7 +323,7 @@ cp "$WORK"/bufio.a "$GOROOT"/pkg/linux_386/bufio.a
mkdir -p "$WORK"/encoding/gob/_obj/
cd "$GOROOT"/src/pkg/encoding/gob
8g -o "$WORK"/encoding/gob/_obj/_go_.8 -p encoding/gob -I "$WORK" ./debug.go ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
8g -o "$WORK"/encoding/gob/_obj/_go_.8 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.8
cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/linux_386/encoding/gob.a
......@@ -400,6 +400,26 @@ cd "$GOROOT"/src/pkg/log
gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.8
cp "$WORK"/log.a "$GOROOT"/pkg/linux_386/log.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
8g -o "$WORK"/path/_obj/_go_.8 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.8
cp "$WORK"/path.a "$GOROOT"/pkg/linux_386/path.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
8g -o "$WORK"/go/build/_obj/_go_.8 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.8
cp "$WORK"/go/build.a "$GOROOT"/pkg/linux_386/go/build.a
#
# os/exec
#
......@@ -411,16 +431,6 @@ gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.8
mkdir -p "$GOROOT"/pkg/linux_386/os/
cp "$WORK"/os/exec.a "$GOROOT"/pkg/linux_386/os/exec.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
8g -o "$WORK"/path/_obj/_go_.8 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.8
cp "$WORK"/path.a "$GOROOT"/pkg/linux_386/path.a
#
# regexp/syntax
#
......@@ -442,16 +452,6 @@ cd "$GOROOT"/src/pkg/regexp
gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.8
cp "$WORK"/regexp.a "$GOROOT"/pkg/linux_386/regexp.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
8g -o "$WORK"/go/build/_obj/_go_.8 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.8
cp "$WORK"/go/build.a "$GOROOT"/pkg/linux_386/go/build.a
#
# net/url
#
......@@ -491,8 +491,8 @@ cp "$WORK"/text/template.a "$GOROOT"/pkg/linux_386/text/template.a
mkdir -p "$WORK"/cmd/go/_obj/
cd "$GOROOT"/src/cmd/go
8g -o "$WORK"/cmd/go/_obj/_go_.8 -p cmd/go -I "$WORK" ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./version.go ./vet.go
8g -o "$WORK"/cmd/go/_obj/_go_.8 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.8
8l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
mkdir -p "$GOBIN"/
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
......@@ -322,7 +322,7 @@ cp "$WORK"/bufio.a "$GOROOT"/pkg/linux_amd64/bufio.a
mkdir -p "$WORK"/encoding/gob/_obj/
cd "$GOROOT"/src/pkg/encoding/gob
6g -o "$WORK"/encoding/gob/_obj/_go_.6 -p encoding/gob -I "$WORK" ./debug.go ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
6g -o "$WORK"/encoding/gob/_obj/_go_.6 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.6
cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/linux_amd64/encoding/gob.a
......@@ -399,6 +399,26 @@ cd "$GOROOT"/src/pkg/log
gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.6
cp "$WORK"/log.a "$GOROOT"/pkg/linux_amd64/log.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
6g -o "$WORK"/path/_obj/_go_.6 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.6
cp "$WORK"/path.a "$GOROOT"/pkg/linux_amd64/path.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
6g -o "$WORK"/go/build/_obj/_go_.6 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.6
cp "$WORK"/go/build.a "$GOROOT"/pkg/linux_amd64/go/build.a
#
# os/exec
#
......@@ -410,16 +430,6 @@ gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.6
mkdir -p "$GOROOT"/pkg/linux_amd64/os/
cp "$WORK"/os/exec.a "$GOROOT"/pkg/linux_amd64/os/exec.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
6g -o "$WORK"/path/_obj/_go_.6 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.6
cp "$WORK"/path.a "$GOROOT"/pkg/linux_amd64/path.a
#
# regexp/syntax
#
......@@ -441,16 +451,6 @@ cd "$GOROOT"/src/pkg/regexp
gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.6
cp "$WORK"/regexp.a "$GOROOT"/pkg/linux_amd64/regexp.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
6g -o "$WORK"/go/build/_obj/_go_.6 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.6
cp "$WORK"/go/build.a "$GOROOT"/pkg/linux_amd64/go/build.a
#
# net/url
#
......@@ -490,8 +490,8 @@ cp "$WORK"/text/template.a "$GOROOT"/pkg/linux_amd64/text/template.a
mkdir -p "$WORK"/cmd/go/_obj/
cd "$GOROOT"/src/cmd/go
6g -o "$WORK"/cmd/go/_obj/_go_.6 -p cmd/go -I "$WORK" ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./version.go ./vet.go
6g -o "$WORK"/cmd/go/_obj/_go_.6 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.6
6l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
mkdir -p "$GOBIN"/
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
......@@ -326,7 +326,7 @@ cp "$WORK"/bufio.a "$GOROOT"/pkg/linux_arm/bufio.a
mkdir -p "$WORK"/encoding/gob/_obj/
cd "$GOROOT"/src/pkg/encoding/gob
5g -o "$WORK"/encoding/gob/_obj/_go_.5 -p encoding/gob -I "$WORK" ./debug.go ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
5g -o "$WORK"/encoding/gob/_obj/_go_.5 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.5
cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/linux_arm/encoding/gob.a
......@@ -403,6 +403,26 @@ cd "$GOROOT"/src/pkg/log
gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.5
cp "$WORK"/log.a "$GOROOT"/pkg/linux_arm/log.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
5g -o "$WORK"/path/_obj/_go_.5 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.5
cp "$WORK"/path.a "$GOROOT"/pkg/linux_arm/path.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
5g -o "$WORK"/go/build/_obj/_go_.5 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.5
cp "$WORK"/go/build.a "$GOROOT"/pkg/linux_arm/go/build.a
#
# os/exec
#
......@@ -414,16 +434,6 @@ gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.5
mkdir -p "$GOROOT"/pkg/linux_arm/os/
cp "$WORK"/os/exec.a "$GOROOT"/pkg/linux_arm/os/exec.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
5g -o "$WORK"/path/_obj/_go_.5 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.5
cp "$WORK"/path.a "$GOROOT"/pkg/linux_arm/path.a
#
# regexp/syntax
#
......@@ -445,16 +455,6 @@ cd "$GOROOT"/src/pkg/regexp
gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.5
cp "$WORK"/regexp.a "$GOROOT"/pkg/linux_arm/regexp.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
5g -o "$WORK"/go/build/_obj/_go_.5 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.5
cp "$WORK"/go/build.a "$GOROOT"/pkg/linux_arm/go/build.a
#
# net/url
#
......@@ -494,8 +494,8 @@ cp "$WORK"/text/template.a "$GOROOT"/pkg/linux_arm/text/template.a
mkdir -p "$WORK"/cmd/go/_obj/
cd "$GOROOT"/src/cmd/go
5g -o "$WORK"/cmd/go/_obj/_go_.5 -p cmd/go -I "$WORK" ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./version.go ./vet.go
5g -o "$WORK"/cmd/go/_obj/_go_.5 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.5
5l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
mkdir -p "$GOBIN"/
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
......@@ -323,7 +323,7 @@ cp "$WORK"/bufio.a "$GOROOT"/pkg/netbsd_386/bufio.a
mkdir -p "$WORK"/encoding/gob/_obj/
cd "$GOROOT"/src/pkg/encoding/gob
8g -o "$WORK"/encoding/gob/_obj/_go_.8 -p encoding/gob -I "$WORK" ./debug.go ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
8g -o "$WORK"/encoding/gob/_obj/_go_.8 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.8
cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/netbsd_386/encoding/gob.a
......@@ -400,6 +400,26 @@ cd "$GOROOT"/src/pkg/log
gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.8
cp "$WORK"/log.a "$GOROOT"/pkg/netbsd_386/log.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
8g -o "$WORK"/path/_obj/_go_.8 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.8
cp "$WORK"/path.a "$GOROOT"/pkg/netbsd_386/path.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
8g -o "$WORK"/go/build/_obj/_go_.8 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.8
cp "$WORK"/go/build.a "$GOROOT"/pkg/netbsd_386/go/build.a
#
# os/exec
#
......@@ -411,16 +431,6 @@ gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.8
mkdir -p "$GOROOT"/pkg/netbsd_386/os/
cp "$WORK"/os/exec.a "$GOROOT"/pkg/netbsd_386/os/exec.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
8g -o "$WORK"/path/_obj/_go_.8 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.8
cp "$WORK"/path.a "$GOROOT"/pkg/netbsd_386/path.a
#
# regexp/syntax
#
......@@ -442,16 +452,6 @@ cd "$GOROOT"/src/pkg/regexp
gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.8
cp "$WORK"/regexp.a "$GOROOT"/pkg/netbsd_386/regexp.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
8g -o "$WORK"/go/build/_obj/_go_.8 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.8
cp "$WORK"/go/build.a "$GOROOT"/pkg/netbsd_386/go/build.a
#
# net/url
#
......@@ -491,8 +491,8 @@ cp "$WORK"/text/template.a "$GOROOT"/pkg/netbsd_386/text/template.a
mkdir -p "$WORK"/cmd/go/_obj/
cd "$GOROOT"/src/cmd/go
8g -o "$WORK"/cmd/go/_obj/_go_.8 -p cmd/go -I "$WORK" ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./version.go ./vet.go
8g -o "$WORK"/cmd/go/_obj/_go_.8 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.8
8l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
mkdir -p "$GOBIN"/
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
......@@ -322,7 +322,7 @@ cp "$WORK"/bufio.a "$GOROOT"/pkg/netbsd_amd64/bufio.a
mkdir -p "$WORK"/encoding/gob/_obj/
cd "$GOROOT"/src/pkg/encoding/gob
6g -o "$WORK"/encoding/gob/_obj/_go_.6 -p encoding/gob -I "$WORK" ./debug.go ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
6g -o "$WORK"/encoding/gob/_obj/_go_.6 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.6
cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/netbsd_amd64/encoding/gob.a
......@@ -399,6 +399,26 @@ cd "$GOROOT"/src/pkg/log
gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.6
cp "$WORK"/log.a "$GOROOT"/pkg/netbsd_amd64/log.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
6g -o "$WORK"/path/_obj/_go_.6 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.6
cp "$WORK"/path.a "$GOROOT"/pkg/netbsd_amd64/path.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
6g -o "$WORK"/go/build/_obj/_go_.6 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.6
cp "$WORK"/go/build.a "$GOROOT"/pkg/netbsd_amd64/go/build.a
#
# os/exec
#
......@@ -410,16 +430,6 @@ gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.6
mkdir -p "$GOROOT"/pkg/netbsd_amd64/os/
cp "$WORK"/os/exec.a "$GOROOT"/pkg/netbsd_amd64/os/exec.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
6g -o "$WORK"/path/_obj/_go_.6 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.6
cp "$WORK"/path.a "$GOROOT"/pkg/netbsd_amd64/path.a
#
# regexp/syntax
#
......@@ -441,16 +451,6 @@ cd "$GOROOT"/src/pkg/regexp
gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.6
cp "$WORK"/regexp.a "$GOROOT"/pkg/netbsd_amd64/regexp.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
6g -o "$WORK"/go/build/_obj/_go_.6 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.6
cp "$WORK"/go/build.a "$GOROOT"/pkg/netbsd_amd64/go/build.a
#
# net/url
#
......@@ -490,8 +490,8 @@ cp "$WORK"/text/template.a "$GOROOT"/pkg/netbsd_amd64/text/template.a
mkdir -p "$WORK"/cmd/go/_obj/
cd "$GOROOT"/src/cmd/go
6g -o "$WORK"/cmd/go/_obj/_go_.6 -p cmd/go -I "$WORK" ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./version.go ./vet.go
6g -o "$WORK"/cmd/go/_obj/_go_.6 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.6
6l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
mkdir -p "$GOBIN"/
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
......@@ -323,7 +323,7 @@ cp "$WORK"/bufio.a "$GOROOT"/pkg/openbsd_386/bufio.a
mkdir -p "$WORK"/encoding/gob/_obj/
cd "$GOROOT"/src/pkg/encoding/gob
8g -o "$WORK"/encoding/gob/_obj/_go_.8 -p encoding/gob -I "$WORK" ./debug.go ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
8g -o "$WORK"/encoding/gob/_obj/_go_.8 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.8
cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/openbsd_386/encoding/gob.a
......@@ -400,6 +400,26 @@ cd "$GOROOT"/src/pkg/log
gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.8
cp "$WORK"/log.a "$GOROOT"/pkg/openbsd_386/log.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
8g -o "$WORK"/path/_obj/_go_.8 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.8
cp "$WORK"/path.a "$GOROOT"/pkg/openbsd_386/path.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
8g -o "$WORK"/go/build/_obj/_go_.8 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.8
cp "$WORK"/go/build.a "$GOROOT"/pkg/openbsd_386/go/build.a
#
# os/exec
#
......@@ -411,16 +431,6 @@ gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.8
mkdir -p "$GOROOT"/pkg/openbsd_386/os/
cp "$WORK"/os/exec.a "$GOROOT"/pkg/openbsd_386/os/exec.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
8g -o "$WORK"/path/_obj/_go_.8 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.8
cp "$WORK"/path.a "$GOROOT"/pkg/openbsd_386/path.a
#
# regexp/syntax
#
......@@ -442,16 +452,6 @@ cd "$GOROOT"/src/pkg/regexp
gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.8
cp "$WORK"/regexp.a "$GOROOT"/pkg/openbsd_386/regexp.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
8g -o "$WORK"/go/build/_obj/_go_.8 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.8
cp "$WORK"/go/build.a "$GOROOT"/pkg/openbsd_386/go/build.a
#
# net/url
#
......@@ -491,8 +491,8 @@ cp "$WORK"/text/template.a "$GOROOT"/pkg/openbsd_386/text/template.a
mkdir -p "$WORK"/cmd/go/_obj/
cd "$GOROOT"/src/cmd/go
8g -o "$WORK"/cmd/go/_obj/_go_.8 -p cmd/go -I "$WORK" ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./version.go ./vet.go
8g -o "$WORK"/cmd/go/_obj/_go_.8 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.8
8l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
mkdir -p "$GOBIN"/
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
......@@ -322,7 +322,7 @@ cp "$WORK"/bufio.a "$GOROOT"/pkg/openbsd_amd64/bufio.a
mkdir -p "$WORK"/encoding/gob/_obj/
cd "$GOROOT"/src/pkg/encoding/gob
6g -o "$WORK"/encoding/gob/_obj/_go_.6 -p encoding/gob -I "$WORK" ./debug.go ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
6g -o "$WORK"/encoding/gob/_obj/_go_.6 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.6
cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/openbsd_amd64/encoding/gob.a
......@@ -399,6 +399,26 @@ cd "$GOROOT"/src/pkg/log
gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.6
cp "$WORK"/log.a "$GOROOT"/pkg/openbsd_amd64/log.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
6g -o "$WORK"/path/_obj/_go_.6 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.6
cp "$WORK"/path.a "$GOROOT"/pkg/openbsd_amd64/path.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
6g -o "$WORK"/go/build/_obj/_go_.6 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.6
cp "$WORK"/go/build.a "$GOROOT"/pkg/openbsd_amd64/go/build.a
#
# os/exec
#
......@@ -410,16 +430,6 @@ gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.6
mkdir -p "$GOROOT"/pkg/openbsd_amd64/os/
cp "$WORK"/os/exec.a "$GOROOT"/pkg/openbsd_amd64/os/exec.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
6g -o "$WORK"/path/_obj/_go_.6 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.6
cp "$WORK"/path.a "$GOROOT"/pkg/openbsd_amd64/path.a
#
# regexp/syntax
#
......@@ -441,16 +451,6 @@ cd "$GOROOT"/src/pkg/regexp
gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.6
cp "$WORK"/regexp.a "$GOROOT"/pkg/openbsd_amd64/regexp.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
6g -o "$WORK"/go/build/_obj/_go_.6 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.6
cp "$WORK"/go/build.a "$GOROOT"/pkg/openbsd_amd64/go/build.a
#
# net/url
#
......@@ -490,8 +490,8 @@ cp "$WORK"/text/template.a "$GOROOT"/pkg/openbsd_amd64/text/template.a
mkdir -p "$WORK"/cmd/go/_obj/
cd "$GOROOT"/src/cmd/go
6g -o "$WORK"/cmd/go/_obj/_go_.6 -p cmd/go -I "$WORK" ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./version.go ./vet.go
6g -o "$WORK"/cmd/go/_obj/_go_.6 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.6
6l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
mkdir -p "$GOBIN"/
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
......@@ -323,7 +323,7 @@ cp "$WORK"/bufio.a "$GOROOT"/pkg/plan9_386/bufio.a
mkdir -p "$WORK"/encoding/gob/_obj/
cd "$GOROOT"/src/pkg/encoding/gob
8g -o "$WORK"/encoding/gob/_obj/_go_.8 -p encoding/gob -I "$WORK" ./debug.go ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
8g -o "$WORK"/encoding/gob/_obj/_go_.8 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.8
cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/plan9_386/encoding/gob.a
......@@ -400,6 +400,26 @@ cd "$GOROOT"/src/pkg/log
gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.8
cp "$WORK"/log.a "$GOROOT"/pkg/plan9_386/log.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
8g -o "$WORK"/path/_obj/_go_.8 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.8
cp "$WORK"/path.a "$GOROOT"/pkg/plan9_386/path.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
8g -o "$WORK"/go/build/_obj/_go_.8 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.8
cp "$WORK"/go/build.a "$GOROOT"/pkg/plan9_386/go/build.a
#
# os/exec
#
......@@ -411,16 +431,6 @@ gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.8
mkdir -p "$GOROOT"/pkg/plan9_386/os/
cp "$WORK"/os/exec.a "$GOROOT"/pkg/plan9_386/os/exec.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
8g -o "$WORK"/path/_obj/_go_.8 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.8
cp "$WORK"/path.a "$GOROOT"/pkg/plan9_386/path.a
#
# regexp/syntax
#
......@@ -442,16 +452,6 @@ cd "$GOROOT"/src/pkg/regexp
gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.8
cp "$WORK"/regexp.a "$GOROOT"/pkg/plan9_386/regexp.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
8g -o "$WORK"/go/build/_obj/_go_.8 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.8
cp "$WORK"/go/build.a "$GOROOT"/pkg/plan9_386/go/build.a
#
# net/url
#
......@@ -491,8 +491,8 @@ cp "$WORK"/text/template.a "$GOROOT"/pkg/plan9_386/text/template.a
mkdir -p "$WORK"/cmd/go/_obj/
cd "$GOROOT"/src/cmd/go
8g -o "$WORK"/cmd/go/_obj/_go_.8 -p cmd/go -I "$WORK" ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./version.go ./vet.go
8g -o "$WORK"/cmd/go/_obj/_go_.8 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.8
8l -o "$WORK"/cmd/go/_obj/a.out -L "$WORK" "$WORK"/cmd/go.a
mkdir -p "$GOBIN"/
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go
cp "$WORK"/cmd/go/_obj/a.out "$GOBIN"/go_bootstrap
......@@ -325,7 +325,7 @@ cp "$WORK"/bufio.a "$GOROOT"/pkg/windows_386/bufio.a
mkdir -p "$WORK"/encoding/gob/_obj/
cd "$GOROOT"/src/pkg/encoding/gob
8g -o "$WORK"/encoding/gob/_obj/_go_.8 -p encoding/gob -I "$WORK" ./debug.go ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
8g -o "$WORK"/encoding/gob/_obj/_go_.8 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.8
cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/windows_386/encoding/gob.a
......@@ -402,6 +402,26 @@ cd "$GOROOT"/src/pkg/log
gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.8
cp "$WORK"/log.a "$GOROOT"/pkg/windows_386/log.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
8g -o "$WORK"/path/_obj/_go_.8 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.8
cp "$WORK"/path.a "$GOROOT"/pkg/windows_386/path.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
8g -o "$WORK"/go/build/_obj/_go_.8 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.8
cp "$WORK"/go/build.a "$GOROOT"/pkg/windows_386/go/build.a
#
# os/exec
#
......@@ -413,16 +433,6 @@ gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.8
mkdir -p "$GOROOT"/pkg/windows_386/os/
cp "$WORK"/os/exec.a "$GOROOT"/pkg/windows_386/os/exec.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
8g -o "$WORK"/path/_obj/_go_.8 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.8
cp "$WORK"/path.a "$GOROOT"/pkg/windows_386/path.a
#
# regexp/syntax
#
......@@ -444,16 +454,6 @@ cd "$GOROOT"/src/pkg/regexp
gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.8
cp "$WORK"/regexp.a "$GOROOT"/pkg/windows_386/regexp.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
8g -o "$WORK"/go/build/_obj/_go_.8 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.8
cp "$WORK"/go/build.a "$GOROOT"/pkg/windows_386/go/build.a
#
# net/url
#
......@@ -493,8 +493,8 @@ cp "$WORK"/text/template.a "$GOROOT"/pkg/windows_386/text/template.a
mkdir -p "$WORK"/cmd/go/_obj/
cd "$GOROOT"/src/cmd/go
8g -o "$WORK"/cmd/go/_obj/_go_.8 -p cmd/go -I "$WORK" ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./version.go ./vet.go
8g -o "$WORK"/cmd/go/_obj/_go_.8 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.8
8l -o "$WORK"/cmd/go/_obj/a.out.exe -L "$WORK" "$WORK"/cmd/go.a
mkdir -p "$GOBIN"/
cp "$WORK"/cmd/go/_obj/a.out.exe "$GOBIN"/go.exe
cp "$WORK"/cmd/go/_obj/a.out.exe "$GOBIN"/go_bootstrap.exe
......@@ -324,7 +324,7 @@ cp "$WORK"/bufio.a "$GOROOT"/pkg/windows_amd64/bufio.a
mkdir -p "$WORK"/encoding/gob/_obj/
cd "$GOROOT"/src/pkg/encoding/gob
6g -o "$WORK"/encoding/gob/_obj/_go_.6 -p encoding/gob -I "$WORK" ./debug.go ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
6g -o "$WORK"/encoding/gob/_obj/_go_.6 -p encoding/gob -I "$WORK" ./decode.go ./decoder.go ./doc.go ./encode.go ./encoder.go ./error.go ./type.go
gopack grc "$WORK"/encoding/gob.a "$WORK"/encoding/gob/_obj/_go_.6
cp "$WORK"/encoding/gob.a "$GOROOT"/pkg/windows_amd64/encoding/gob.a
......@@ -401,6 +401,26 @@ cd "$GOROOT"/src/pkg/log
gopack grc "$WORK"/log.a "$WORK"/log/_obj/_go_.6
cp "$WORK"/log.a "$GOROOT"/pkg/windows_amd64/log.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
6g -o "$WORK"/path/_obj/_go_.6 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.6
cp "$WORK"/path.a "$GOROOT"/pkg/windows_amd64/path.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
6g -o "$WORK"/go/build/_obj/_go_.6 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.6
cp "$WORK"/go/build.a "$GOROOT"/pkg/windows_amd64/go/build.a
#
# os/exec
#
......@@ -412,16 +432,6 @@ gopack grc "$WORK"/os/exec.a "$WORK"/os/exec/_obj/_go_.6
mkdir -p "$GOROOT"/pkg/windows_amd64/os/
cp "$WORK"/os/exec.a "$GOROOT"/pkg/windows_amd64/os/exec.a
#
# path
#
mkdir -p "$WORK"/path/_obj/
cd "$GOROOT"/src/pkg/path
6g -o "$WORK"/path/_obj/_go_.6 -p path -I "$WORK" ./match.go ./path.go
gopack grc "$WORK"/path.a "$WORK"/path/_obj/_go_.6
cp "$WORK"/path.a "$GOROOT"/pkg/windows_amd64/path.a
#
# regexp/syntax
#
......@@ -443,16 +453,6 @@ cd "$GOROOT"/src/pkg/regexp
gopack grc "$WORK"/regexp.a "$WORK"/regexp/_obj/_go_.6
cp "$WORK"/regexp.a "$GOROOT"/pkg/windows_amd64/regexp.a
#
# go/build
#
mkdir -p "$WORK"/go/build/_obj/
cd "$GOROOT"/src/pkg/go/build
6g -o "$WORK"/go/build/_obj/_go_.6 -p go/build -I "$WORK" ./build.go ./dir.go ./path.go ./syslist.go
gopack grc "$WORK"/go/build.a "$WORK"/go/build/_obj/_go_.6
cp "$WORK"/go/build.a "$GOROOT"/pkg/windows_amd64/go/build.a
#
# net/url
#
......@@ -492,8 +492,8 @@ cp "$WORK"/text/template.a "$GOROOT"/pkg/windows_amd64/text/template.a
mkdir -p "$WORK"/cmd/go/_obj/
cd "$GOROOT"/src/cmd/go
6g -o "$WORK"/cmd/go/_obj/_go_.6 -p cmd/go -I "$WORK" ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./version.go ./vet.go
6g -o "$WORK"/cmd/go/_obj/_go_.6 -p cmd/go -I "$WORK" ./bootstrap.go ./build.go ./fix.go ./fmt.go ./get.go ./help.go ./list.go ./main.go ./pkg.go ./run.go ./test.go ./testflag.go ./vcs.go ./version.go ./vet.go
gopack grc "$WORK"/cmd/go.a "$WORK"/cmd/go/_obj/_go_.6
6l -o "$WORK"/cmd/go/_obj/a.out.exe -L "$WORK" "$WORK"/cmd/go.a
mkdir -p "$GOBIN"/
cp "$WORK"/cmd/go/_obj/a.out.exe "$GOBIN"/go.exe
cp "$WORK"/cmd/go/_obj/a.out.exe "$GOBIN"/go_bootstrap.exe
......@@ -11,6 +11,7 @@ GOFILES=\
get.go\
fmt.go\
help.go\
http.go\
list.go\
main.go\
pkg.go\
......@@ -19,5 +20,6 @@ GOFILES=\
testflag.go\
version.go\
vet.go\
vcs.go\
include ../../Make.cmd
......@@ -22,7 +22,7 @@ import (
)
var cmdBuild = &Command{
UsageLine: "build [-a] [-n] [-v] [-x] [-o output] [-p n] [importpath... | gofiles...]",
UsageLine: "build [-a] [-n] [-o output] [-p n] [-v] [-x] [importpath... | gofiles...]",
Short: "compile packages and dependencies",
Long: `
Build compiles the packages named by the import paths,
......@@ -68,9 +68,10 @@ var buildN bool // -n flag
var buildP = runtime.NumCPU() // -p flag
var buildV bool // -v flag
var buildX bool // -x flag
var buildO = cmdBuild.Flag.String("o", "", "output file")
var buildContext = build.DefaultContext
// addBuildFlags adds the flags common to the build and install commands.
func addBuildFlags(cmd *Command) {
cmd.Flag.BoolVar(&buildA, "a", false, "")
......@@ -78,6 +79,25 @@ func addBuildFlags(cmd *Command) {
cmd.Flag.IntVar(&buildP, "p", buildP, "")
cmd.Flag.BoolVar(&buildV, "v", false, "")
cmd.Flag.BoolVar(&buildX, "x", false, "")
// TODO(rsc): This -t flag is used by buildscript.sh but
// not documented. Should be documented but the
// usage lines are getting too long. Probably need to say
// that these flags are applicable to every command and
// document them in one help message instead of on every
// command's help message.
cmd.Flag.Var((*stringsFlag)(&buildContext.BuildTags), "t", "")
}
type stringsFlag []string
func (v *stringsFlag) Set(s string) error {
*v = append(*v, s)
return nil
}
func (v *stringsFlag) String() string {
return "<stringsFlag>"
}
func runBuild(cmd *Command, args []string) {
......@@ -89,7 +109,7 @@ func runBuild(cmd *Command, args []string) {
pkg := goFilesPackage(args, "")
pkgs = append(pkgs, pkg)
} else {
pkgs = packages(args)
pkgs = packagesForBuild(args)
}
if len(pkgs) == 1 && pkgs[0].Name == "main" && *buildO == "" {
......@@ -116,7 +136,7 @@ func runBuild(cmd *Command, args []string) {
}
var cmdInstall = &Command{
UsageLine: "install [-a] [-n] [-v] [-x] [-p n] [importpath...]",
UsageLine: "install [-a] [-n] [-p n] [-v] [-x] [importpath...]",
Short: "compile and install packages and dependencies",
Long: `
Install compiles and installs the packages named by the import paths,
......@@ -137,10 +157,12 @@ See also: go build, go get, go clean.
}
func runInstall(cmd *Command, args []string) {
pkgs := packagesForBuild(args)
var b builder
b.init()
a := &action{}
for _, p := range packages(args) {
for _, p := range pkgs {
a.deps = append(a.deps, b.action(modeInstall, modeInstall, p))
}
b.do(a)
......@@ -213,8 +235,8 @@ func (b *builder) init() {
var err error
b.actionCache = make(map[cacheKey]*action)
b.mkdirCache = make(map[string]bool)
b.goarch = build.DefaultContext.GOARCH
b.goos = build.DefaultContext.GOOS
b.goarch = buildContext.GOARCH
b.goos = buildContext.GOOS
b.goroot = build.Path[0].Path
b.gobin = build.Path[0].BinDir()
if b.goos == "windows" {
......@@ -267,12 +289,13 @@ func goFilesPackage(gofiles []string, target string) *Package {
}
dir = append(dir, fi)
}
ctxt := build.DefaultContext
ctxt := buildContext
ctxt.ReadDir = func(string) ([]os.FileInfo, error) { return dir, nil }
pwd, _ := os.Getwd()
pkg, err := scanPackage(&ctxt, &build.Tree{Path: "."}, "<command line>", "<command line>", pwd)
if err != nil {
fatalf("%s", err)
var stk importStack
pkg := scanPackage(&ctxt, &build.Tree{Path: "."}, "<command line>", "<command line>", pwd+"/.", &stk)
if pkg.Error != nil {
fatalf("%s", pkg.Error)
}
if target != "" {
pkg.target = target
......@@ -306,9 +329,10 @@ func (b *builder) action(mode buildMode, depMode buildMode, p *Package) *action
}
if len(p.CgoFiles) > 0 {
p1, err := loadPackage("cmd/cgo")
if err != nil {
fatalf("load cmd/cgo: %v", err)
var stk importStack
p1 := loadPackage("cmd/cgo", &stk)
if p1.Error != nil {
fatalf("load cmd/cgo: %v", p1.Error)
}
a.cgo = b.action(depMode, depMode, p1)
a.deps = append(a.deps, a.cgo)
......@@ -983,7 +1007,7 @@ func (b *builder) gccCmd(objdir string) []string {
}
// gcc-4.5 and beyond require explicit "-pthread" flag
// for multithreading with pthread library.
if build.DefaultContext.CgoEnabled {
if buildContext.CgoEnabled {
switch b.goos {
case "windows":
a = append(a, "-mthreads")
......
......@@ -2,24 +2,39 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// TODO: Dashboard upload
package main
import (
"fmt"
"go/build"
"os"
"path/filepath"
"runtime"
"strconv"
"strings"
)
var cmdGet = &Command{
Run: runGet,
UsageLine: "get [importpath...]",
UsageLine: "get [-a] [-d] [-fix] [-n] [-p n] [-u] [-v] [-x] [importpath...]",
Short: "download and install packages and dependencies",
Long: `
Get downloads and installs the packages named by the import paths,
along with their dependencies.
After downloading the code, 'go get' looks for a tag beginning
with "go." that corresponds to the local Go version.
For Go "release.r58" it looks for a tag named "go.r58".
For "weekly.2011-06-03" it looks for "go.weekly.2011-06-03".
If the specific "go.X" tag is not found, it uses the latest earlier
version it can find. Otherwise, it uses the default version for
the version control system: HEAD for git, tip for Mercurial,
and so on.
The -a, -n, -v, -x, and -p flags have the same meaning as in 'go build'
and 'go install'. See 'go help install'.
The -d flag instructs get to stop after downloading the packages; that is,
it instructs get not to install the packages.
The -fix flag instructs get to run gofix on the downloaded packages
before resolving dependencies or building the code.
The -u flag instructs get to use the network to update the named packages
and their dependencies. By default, get uses the network to check out
missing packages but does not use it to look for updates to existing packages.
TODO: Explain versions better.
......@@ -32,8 +47,223 @@ See also: go build, go install, go clean.
`,
}
var getD = cmdGet.Flag.Bool("d", false, "")
var getU = cmdGet.Flag.Bool("u", false, "")
var getFix = cmdGet.Flag.Bool("fix", false, "")
func init() {
addBuildFlags(cmdGet)
cmdGet.Run = runGet // break init loop
}
func runGet(cmd *Command, args []string) {
// Phase 1. Download/update.
args = importPaths(args)
_ = args
panic("get not implemented")
var stk importStack
for _, arg := range args {
download(arg, &stk)
}
exitIfErrors()
if *getD {
// download only
return
}
// Phase 2. Install.
// Code we downloaded and all code that depends on it
// needs to be evicted from the package cache so that
// the information will be recomputed. Instead of keeping
// track of the reverse dependency information, evict
// everything.
for name := range packageCache {
delete(packageCache, name)
}
runInstall(cmd, args)
}
// downloadCache records the import paths we have already
// considered during the download, to avoid duplicate work when
// there is more than one dependency sequence leading to
// a particular package.
var downloadCache = map[string]bool{}
// downloadRootCache records the version control repository
// root directories we have already considered during the download.
// For example, all the packages in the code.google.com/p/codesearch repo
// share the same root (the directory for that path), and we only need
// to run the hg commands to consider each repository once.
var downloadRootCache = map[string]bool{}
// download runs the download half of the get command
// for the package named by the argument.
func download(arg string, stk *importStack) {
p := loadPackage(arg, stk)
// There's nothing to do if this is a package in the standard library.
if p.Standard {
return
}
// Only process each package once.
if downloadCache[arg] {
return
}
downloadCache[arg] = true
// Download if the package is missing, or update if we're using -u.
if p.Dir == "" || *getU {
// The actual download.
stk.push(p.ImportPath)
defer stk.pop()
if err := downloadPackage(p); err != nil {
errorf("%s", &PackageError{stk.copy(), err.Error()})
return
}
// Reread the package information from the updated files.
p = reloadPackage(arg, stk)
if p.Error != nil {
errorf("%s", p.Error)
return
}
}
if *getFix {
run(stringList("gofix", relPaths(p.gofiles)))
// The imports might have changed, so reload again.
p = reloadPackage(arg, stk)
if p.Error != nil {
errorf("%s", p.Error)
return
}
}
// Process dependencies, now that we know what they are.
for _, dep := range p.deps {
download(dep.ImportPath, stk)
}
}
// downloadPackage runs the create or download command
// to make the first copy of or update a copy of the given package.
func downloadPackage(p *Package) error {
// Analyze the import path to determine the version control system,
// repository, and the import path for the root of the repository.
vcs, repo, rootPath, err := vcsForImportPath(p.ImportPath)
if err != nil {
return err
}
if p.t == nil {
// Package not found. Put in first directory of $GOPATH or else $GOROOT.
p.t = build.Path[0] // $GOROOT
if len(build.Path) > 1 {
p.t = build.Path[1] // first in $GOPATH
}
p.Dir = filepath.Join(p.t.SrcDir(), p.ImportPath)
}
root := filepath.Join(p.t.SrcDir(), rootPath)
// If we've considered this repository already, don't do it again.
if downloadRootCache[root] {
return nil
}
downloadRootCache[root] = true
if buildV {
fmt.Fprintf(os.Stderr, "%s (download)\n", rootPath)
}
// Check that this is an appropriate place for the repo to be checked out.
// The target directory must either not exist or have a repo checked out already.
meta := filepath.Join(root, "."+vcs.cmd)
st, err := os.Stat(meta)
if err == nil && !st.IsDir() {
return fmt.Errorf("%s exists but is not a directory", meta)
}
if err != nil {
// Metadata directory does not exist. Prepare to checkout new copy.
// Some version control tools require the target directory not to exist.
// We require that too, just to avoid stepping on existing work.
if _, err := os.Stat(root); err == nil {
return fmt.Errorf("%s exists but %s does not - stale checkout?", root, meta)
}
// Some version control tools require the parent of the target to exist.
parent, _ := filepath.Split(root)
if err := os.MkdirAll(parent, 0777); err != nil {
return err
}
if err = vcs.create(root, repo); err != nil {
return err
}
} else {
// Metadata directory does exist; download incremental updates.
if err = vcs.download(root); err != nil {
return err
}
}
// Select and sync to appropriate version of the repository.
tags, err := vcs.tags(root)
if err != nil {
return err
}
vers := runtime.Version()
if i := strings.Index(vers, " "); i >= 0 {
vers = vers[:i]
}
tag := selectTag(vers, tags)
if tag == "" {
tag = vcs.tagDefault
}
if err := vcs.tagSync(root, tag); err != nil {
return err
}
return nil
}
// selectTag returns the closest matching tag for a given version.
// Closest means the latest one that is not after the current release.
// Version "release.rN" matches tags of the form "go.rN" (N being a decimal).
// Version "weekly.YYYY-MM-DD" matches tags like "go.weekly.YYYY-MM-DD".
func selectTag(goVersion string, tags []string) (match string) {
const rPrefix = "release.r"
if strings.HasPrefix(goVersion, rPrefix) {
p := "go.r"
v, err := strconv.ParseFloat(goVersion[len(rPrefix):], 64)
if err != nil {
return ""
}
var matchf float64
for _, t := range tags {
if !strings.HasPrefix(t, p) {
continue
}
tf, err := strconv.ParseFloat(t[len(p):], 64)
if err != nil {
continue
}
if matchf < tf && tf <= v {
match, matchf = t, tf
}
}
}
const wPrefix = "weekly."
if strings.HasPrefix(goVersion, wPrefix) {
p := "go.weekly."
v := goVersion[len(wPrefix):]
for _, t := range tags {
if !strings.HasPrefix(t, p) {
continue
}
if match < t && t[len(p):] <= v {
match = t
}
}
}
return match
}
......@@ -11,16 +11,16 @@ import (
)
var cmdList = &Command{
UsageLine: "list [-f format] [-json] [importpath...]",
UsageLine: "list [-e] [-f format] [-json] [importpath...]",
Short: "list packages",
Long: `
List lists the packages named by the import paths, one per line.
The default output shows the package name and file system location:
The default output shows the package import path:
books /home/you/src/code.google.com/p/google-api-go-client/books/v1
oauth /home/you/src/code.google.com/p/goauth2/oauth
sqlite /home/you/src/code.google.com/p/sqlite
code.google.com/p/google-api-go-client/books/v1
code.google.com/p/goauth2/oauth
code.google.com/p/sqlite
The -f flag specifies an alternate format for the list,
using the syntax of package template. The default output
......@@ -47,11 +47,26 @@ being passed to the template is:
// Dependency information
Imports []string // import paths used by this package
Deps []string // all (recursively) imported dependencies
// Error information
Incomplete bool // this package or a dependency has an error
Error *PackageError // error loading package
DepsErrors []*PackageError // errors loading dependencies
}
The -json flag causes the package data to be printed in JSON format
instead of using the template format.
The -e flag changes the handling of erroneous packages, those that
cannot be found or are malformed. By default, the list command
prints an error to standard error for each erroneous package and
omits the packages from consideration during the usual printing.
With the -e flag, the list command never prints errors to standard
error and instead processes the erroneous packages with the usual
printing. Erroneous packages will have a non-empty ImportPath and
a non-nil Error field; other information may or may not be missing
(zeroed).
For more about import paths, see 'go help importpath'.
`,
}
......@@ -60,6 +75,7 @@ func init() {
cmdList.Run = runList // break init cycle
}
var listE = cmdList.Flag.Bool("e", false, "")
var listFmt = cmdList.Flag.String("f", "{{.ImportPath}}", "")
var listJson = cmdList.Flag.Bool("json", false, "")
var nl = []byte{'\n'}
......@@ -87,7 +103,12 @@ func runList(cmd *Command, args []string) {
}
}
for _, pkg := range packages(args) {
load := packages
if *listE {
load = packagesAndErrors
}
for _, pkg := range load(args) {
do(pkg)
}
}
......@@ -246,9 +246,11 @@ func run(cmdargs ...interface{}) {
}
}
func runOut(cmdargs ...interface{}) []byte {
func runOut(dir string, cmdargs ...interface{}) []byte {
cmdline := stringList(cmdargs...)
out, err := exec.Command(cmdline[0], cmdline[1:]...).CombinedOutput()
cmd := exec.Command(cmdline[0], cmdline[1:]...)
cmd.Dir = dir
out, err := cmd.CombinedOutput()
if err != nil {
os.Stderr.Write(out)
errorf("%v", err)
......@@ -283,7 +285,7 @@ func allPackages(pattern string) []string {
have := map[string]bool{
"builtin": true, // ignore pseudo-package that exists only for documentation
}
if !build.DefaultContext.CgoEnabled {
if !buildContext.CgoEnabled {
have["runtime/cgo"] = true // ignore during walk
}
var pkgs []string
......
This diff is collapsed.
......@@ -4,12 +4,10 @@
package main
import (
"strings"
)
import "strings"
var cmdRun = &Command{
UsageLine: "run [-a] [-n] [-x] gofiles... [-- arguments...]",
UsageLine: "run [-a] [-n] [-x] gofiles... [arguments...]",
Short: "compile and run Go program",
Long: `
Run compiles and runs the main package comprising the named Go source files.
......@@ -33,11 +31,15 @@ func init() {
func runRun(cmd *Command, args []string) {
var b builder
b.init()
files, args := splitArgs(args)
i := 0
for i < len(args) && strings.HasSuffix(args[i], ".go") {
i++
}
files, cmdArgs := args[:i], args[i:]
p := goFilesPackage(files, "")
p.target = "" // must build - not up to date
a1 := b.action(modeBuild, modeBuild, p)
a := &action{f: (*builder).runProgram, args: args, deps: []*action{a1}}
a := &action{f: (*builder).runProgram, args: cmdArgs, deps: []*action{a1}}
b.do(a)
}
......@@ -53,19 +55,3 @@ func (b *builder) runProgram(a *action) error {
run(a.deps[0].target, a.args)
return nil
}
// Return the argument slices before and after the "--"
func splitArgs(args []string) (before, after []string) {
dashes := len(args)
for i, arg := range args {
if arg == "--" {
dashes = i
break
}
}
before = args[:dashes]
if dashes < len(args) {
after = args[dashes+1:]
}
return
}
......@@ -28,7 +28,7 @@ func init() {
var cmdTest = &Command{
CustomFlags: true,
UsageLine: "test [-c] [-x] [-file a.go -file b.go ...] [-p n] [importpath...] [flags for test binary]",
UsageLine: "test [-c] [-file a.go -file b.go ...] [-p n] [-x] [importpath...] [flags for test binary]",
Short: "test packages",
Long: `
'Go test' automates testing the packages named by the import paths.
......@@ -184,18 +184,6 @@ See the documentation of the testing package for more information.
`,
}
// TODO(rsc): Rethink the flag handling.
// It might be better to do
// go test [go-test-flags] [importpaths] [flags for test binary]
// If there are no import paths then the two flag sections
// run together, but we can deal with that. Right now,
// go test -x (ok)
// go test -x math (NOT OK)
// go test math -x (ok)
// which is weird, because the -x really does apply to go test, not to math.
// It is also possible that -file can go away.
// For now just use the gotest code.
var (
testC bool // -c flag
testP int // -p flag
......@@ -216,7 +204,7 @@ func runTest(cmd *Command, args []string) {
// or when the -v flag has been given.
testShowPass = len(pkgArgs) == 0 || testV
pkgs := packages(pkgArgs)
pkgs := packagesForBuild(pkgArgs)
if len(pkgs) == 0 {
fatalf("no packages to test")
}
......@@ -316,13 +304,16 @@ func (b *builder) test(p *Package) (buildAction, runAction, printAction *action,
// XTestGoFiles, so we build one list and use it for both
// ptest and pxtest. No harm done.
var imports []*Package
var stk importStack
stk.push(p.ImportPath + "_test")
for _, path := range p.info.TestImports {
p1, err := loadPackage(path)
if err != nil {
return nil, nil, nil, err
p1 := loadPackage(path, &stk)
if p1.Error != nil {
return nil, nil, nil, p1.Error
}
imports = append(imports, p1)
}
stk.pop()
// The ptest package needs to be importable under the
// same import path that p has, but we cannot put it in
......@@ -408,13 +399,14 @@ func (b *builder) test(p *Package) (buildAction, runAction, printAction *action,
}
// The generated main also imports testing and regexp.
ptesting, err := loadPackage("testing")
if err != nil {
return nil, nil, nil, err
}
pregexp, err := loadPackage("regexp")
if err != nil {
return nil, nil, nil, err
stk.push("testmain")
ptesting := loadPackage("testing", &stk)
if ptesting.Error != nil {
return nil, nil, nil, ptesting.Error
}
pregexp := loadPackage("regexp", &stk)
if pregexp.Error != nil {
return nil, nil, nil, pregexp.Error
}
pmain.imports = append(pmain.imports, ptesting, pregexp)
......
This diff is collapsed.
......@@ -92,11 +92,21 @@ echo; echo; echo %%%% making runtime generated files %%%%; echo
if $USE_GO_TOOL; then
echo
echo '# Building go command from bootstrap script.'
./buildscript/${GOOS}_$GOARCH.sh
echo '# Building go_bootstrap command from bootstrap script.'
if ! ./buildscript/${GOOS}_$GOARCH.sh; then
echo '# Bootstrap script failed.'
if [ ! -x "$GOBIN/go" ]; then
exit 1
fi
echo '# Regenerating bootstrap script using pre-existing go binary.'
./buildscript.sh
./buildscript/${GOOS}_$GOARCH.sh
fi
echo '# Building Go code.'
go install -a -v std
go_bootstrap install -a -v std
rm -f "$GOBIN/go_bootstrap"
else
echo; echo; echo %%%% making pkg %%%%; echo
gomake -C pkg install
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment