aboutsummaryrefslogtreecommitdiff
path: root/src/make.bash
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2017-10-23 21:57:54 -0400
committerRuss Cox <rsc@golang.org>2017-10-25 01:13:01 +0000
commitaedb79f092be44f13faa7a40ed195b1bf0d27855 (patch)
tree703d112495666708114e4f29e3760992d033c173 /src/make.bash
parentd92aaa970791472a1657e878bf686fe802943ebe (diff)
downloadgo-aedb79f092be44f13faa7a40ed195b1bf0d27855.tar.gz
go-aedb79f092be44f13faa7a40ed195b1bf0d27855.zip
build: move final steps of make.bash, make.bat, make.rc into cmd/dist
This CL expands the job of "dist bootstrap" to be "finish make.bash". I need to change that logic in upcoming CLs related to cmd/go changes, and I'd rather not change it in three places in three different shell script languages. Change-Id: I545dc215e408289e4d0b28f7c2ffcd849d89ad3b Reviewed-on: https://go-review.googlesource.com/72870 Reviewed-by: David Crawshaw <crawshaw@golang.org>
Diffstat (limited to 'src/make.bash')
-rwxr-xr-xsrc/make.bash48
1 files changed, 12 insertions, 36 deletions
diff --git a/src/make.bash b/src/make.bash
index 3804b46b03..4e1b7b6bd8 100755
--- a/src/make.bash
+++ b/src/make.bash
@@ -50,6 +50,7 @@
# PKG_CONFIG: Path to pkg-config tool. Default is "pkg-config".
#
# GO_DISTFLAGS: extra flags to provide to "dist bootstrap".
+# (Or just pass them to the make.bash command line.)
set -e
@@ -164,40 +165,15 @@ if [ "$1" = "--no-clean" ]; then
buildall=""
shift
fi
-./cmd/dist/dist bootstrap $buildall $GO_DISTFLAGS -v # builds go_bootstrap
-# Delay move of dist tool to now, because bootstrap may clear tool directory.
-mv cmd/dist/dist "$GOTOOLDIR"/dist
-echo
-
-if [ "$GOHOSTARCH" != "$GOARCH" -o "$GOHOSTOS" != "$GOOS" ]; then
- echo "##### Building packages and commands for host, $GOHOSTOS/$GOHOSTARCH."
- # CC_FOR_TARGET is recorded as the default compiler for the go tool. When building for the host, however,
- # use the host compiler, CC, from `cmd/dist/dist env` instead.
- CC=$CC GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH \
- "$GOTOOLDIR"/go_bootstrap install -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
- echo
-fi
-
-echo "##### Building packages and commands for $GOOS/$GOARCH."
-
-old_bin_files=$(cd $GOROOT/bin && echo *)
-
-CC=$CC_FOR_TARGET "$GOTOOLDIR"/go_bootstrap install $GO_FLAGS -gcflags "$GO_GCFLAGS" -ldflags "$GO_LDFLAGS" -v std cmd
-
-# Check that there are no new files in $GOROOT/bin other than go and gofmt
-# and $GOOS_$GOARCH (a directory used when cross-compiling).
-(cd $GOROOT/bin && for f in *; do
- if ! expr " $old_bin_files go gofmt ${GOOS}_${GOARCH} " : ".* $f " >/dev/null 2>/dev/null; then
- echo 1>&2 "ERROR: unexpected new file in $GOROOT/bin: $f"
- exit 1
- fi
-done)
-
-echo
-
-rm -f "$GOTOOLDIR"/go_bootstrap
-
-if [ "$1" != "--no-banner" ]; then
- "$GOTOOLDIR"/dist banner
-fi
+# Run dist bootstrap to complete make.bash.
+# Bootstrap installs a proper cmd/dist, built with the new toolchain.
+# Throw ours, built with Go 1.4, away after bootstrap.
+./cmd/dist/dist bootstrap $buildall -v $GO_DISTFLAGS "$@"
+rm -f ./cmd/dist/dist
+
+# DO NOT ADD ANY NEW CODE HERE.
+# The bootstrap+rm above are the final step of make.bash.
+# If something must be added, add it to cmd/dist's cmdbootstrap,
+# to avoid needing three copies in three different shell languages
+# (make.bash, make.bat, make.rc).