]> Cypherpunks repositories - gostls13.git/commitdiff
build: quiet make.bash, make.bat, make.rc
authorRuss Cox <rsc@golang.org>
Sat, 28 Oct 2017 13:00:35 +0000 (09:00 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 31 Oct 2017 13:48:53 +0000 (13:48 +0000)
The signal-to-noise ratio is too low.
Stop printing the name of every package.
Can still get the old output with make.bash -v.

Change-Id: Ib2c82e037166e6d2ddc31ae2a4d29af5becce574
Reviewed-on: https://go-review.googlesource.com/74351
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
src/cmd/dist/build.go
src/cmd/dist/buildtool.go
src/make.bash
src/make.bat
src/make.rc

index 10035ccf8dcec11593bc9fbb03ca0f3ed2fcc245..7334fca7fddd7679518a91b56f412effb2eb510b 100644 (file)
@@ -1103,7 +1103,7 @@ func cmdbootstrap() {
        os.Setenv("GOOS", goos)
 
        timelog("build", "go_bootstrap")
-       xprintf("##### Building go_bootstrap.\n")
+       xprintf("Building Go bootstrap cmd/go (go_bootstrap) using Go toolchain1.\n")
        for _, dir := range buildlist {
                installed[dir] = make(chan struct{})
        }
@@ -1111,7 +1111,9 @@ func cmdbootstrap() {
                go install(dir)
        }
        <-installed["cmd/go"]
-       xprintf("\n")
+       if vflag > 0 {
+               xprintf("\n")
+       }
 
        gogcflags = os.Getenv("GO_GCFLAGS") // we were using $BOOT_GO_GCFLAGS until now
        goldflags = os.Getenv("GO_LDFLAGS")
@@ -1139,7 +1141,10 @@ func cmdbootstrap() {
        //      toolchain2 = mk(new toolchain, toolchain1, go_bootstrap)
        //
        timelog("build", "toolchain2")
-       xprintf("\n##### Building Go toolchain2 using go_bootstrap and Go toolchain1.\n")
+       if vflag > 0 {
+               xprintf("\n")
+       }
+       xprintf("Building Go toolchain2 using go_bootstrap and Go toolchain1.\n")
        os.Setenv("CC", defaultcc)
        if goos == oldgoos && goarch == oldgoarch {
                // Host and target are same, and we have historically
@@ -1171,7 +1176,10 @@ func cmdbootstrap() {
        //      toolchain3 = mk(new toolchain, toolchain2, go_bootstrap)
        //
        timelog("build", "toolchain3")
-       xprintf("\n##### Building Go toolchain3 using go_bootstrap and Go toolchain2.\n")
+       if vflag > 0 {
+               xprintf("\n")
+       }
+       xprintf("Building Go toolchain3 using go_bootstrap and Go toolchain2.\n")
        goInstall(append([]string{"-a"}, toolchain...)...)
        if debug {
                run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
@@ -1183,19 +1191,28 @@ func cmdbootstrap() {
        if goos == oldgoos && goarch == oldgoarch {
                // Common case - not setting up for cross-compilation.
                timelog("build", "toolchain")
-               xprintf("\n##### Building packages and commands for %s/%s\n", goos, goarch)
+               if vflag > 0 {
+                       xprintf("\n")
+               }
+               xprintf("Building packages and commands for %s/%s.\n", goos, goarch)
        } else {
                // GOOS/GOARCH does not match GOHOSTOS/GOHOSTARCH.
                // Finish GOHOSTOS/GOHOSTARCH installation and then
                // run GOOS/GOARCH installation.
                timelog("build", "host toolchain")
-               xprintf("\n##### Building packages and commands for host, %s/%s\n", goos, goarch)
+               if vflag > 0 {
+                       xprintf("\n")
+               }
+               xprintf("Building packages and commands for host, %s/%s.\n", goos, goarch)
                goInstall("std", "cmd")
                checkNotStale(goBootstrap, "std", "cmd")
                checkNotStale(cmdGo, "std", "cmd")
 
                timelog("build", "target toolchain")
-               xprintf("\n##### Building packages and commands for target, %s/%s\n", goos, goarch)
+               if vflag > 0 {
+                       xprintf("\n")
+               }
+               xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch)
                goos = oldgoos
                goarch = oldgoarch
                os.Setenv("GOOS", goos)
@@ -1236,7 +1253,10 @@ func cmdbootstrap() {
 }
 
 func goInstall(args ...string) {
-       installCmd := []string{pathf("%s/go_bootstrap", tooldir), "install", "-v", "-gcflags=" + gogcflags, "-ldflags=" + goldflags}
+       installCmd := []string{pathf("%s/go_bootstrap", tooldir), "install", "-gcflags=" + gogcflags, "-ldflags=" + goldflags}
+       if vflag > 0 {
+               installCmd = append(installCmd, "-v")
+       }
 
        // Force only one process at a time on vx32 emulation.
        if gohostos == "plan9" && os.Getenv("sysname") == "vx32" {
@@ -1383,7 +1403,9 @@ func cmdbanner() {
 }
 
 func banner() {
-       xprintf("\n")
+       if vflag > 0 {
+               xprintf("\n")
+       }
        xprintf("---\n")
        xprintf("Installed Go for %s/%s in %s\n", goos, goarch, goroot)
        xprintf("Installed commands in %s\n", gobin)
index 4292e638bbaec26505c2bee63ea5062efecd3b9e..98d0b205964922ce4e6dfa1a491595eef5bf76e0 100644 (file)
@@ -106,7 +106,7 @@ func bootstrapBuildTools() {
        if goroot_bootstrap == "" {
                goroot_bootstrap = pathf("%s/go1.4", os.Getenv("HOME"))
        }
-       xprintf("##### Building Go toolchain1 using %s.\n", goroot_bootstrap)
+       xprintf("Building Go toolchain1 using %s.\n", goroot_bootstrap)
 
        mkzbootstrap(pathf("%s/src/cmd/internal/objabi/zbootstrap.go", goroot))
 
@@ -183,7 +183,9 @@ func bootstrapBuildTools() {
                "install",
                "-gcflags=-l",
                "-tags=math_big_pure_go compiler_bootstrap",
-               "-v",
+       }
+       if vflag > 0 {
+               cmd = append(cmd, "-v")
        }
        if tool := os.Getenv("GOBOOTSTRAP_TOOLEXEC"); tool != "" {
                cmd = append(cmd, "-toolexec="+tool)
@@ -202,7 +204,9 @@ func bootstrapBuildTools() {
                }
        }
 
-       xprintf("\n")
+       if vflag > 0 {
+               xprintf("\n")
+       }
 }
 
 var ssaRewriteFileSubstring = filepath.FromSlash("src/cmd/compile/internal/ssa/rewrite")
index 9827abd331725d0d91310cdf71159fe922843623..f3614f8e5b383d3f8af158b114dded88d05f0991 100755 (executable)
@@ -125,10 +125,20 @@ rm -f ./runtime/runtime_defs.go
 
 # Finally!  Run the build.
 
-echo '##### Building Go bootstrap tool.'
-echo cmd/dist
-export GOROOT="$(cd .. && pwd)"
+verbose=false
+vflag=""
+if [ "$1" = "-v" ]; then
+       verbose=true
+       vflag=-v
+       shift
+fi
+
 export GOROOT_BOOTSTRAP=${GOROOT_BOOTSTRAP:-$HOME/go1.4}
+echo "Building Go cmd/dist using $GOROOT_BOOTSTRAP."
+if $verbose; then
+       echo cmd/dist
+fi
+export GOROOT="$(cd .. && pwd)"
 for go_exe in $(type -ap go); do
        if [ ! -x "$GOROOT_BOOTSTRAP/bin/go" ]; then
                goroot=$(GOROOT='' $go_exe env GOROOT)
@@ -156,7 +166,9 @@ if [ "$FAIL" = true ]; then
        exit 1
 fi
 
-echo
+if $verbose; then
+       echo
+fi
 
 if [ "$1" = "--dist-tool" ]; then
        # Stop after building dist tool.
@@ -177,7 +189,7 @@ 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 "$@"
+./cmd/dist/dist bootstrap $buildall $vflag $GO_DISTFLAGS "$@"
 rm -f ./cmd/dist/dist
 
 # DO NOT ADD ANY NEW CODE HERE.
index 101fc4bb1aad1a0f2ec5a1acd2817191b4d3c955..be164e8df14db2def3e541e209d8b606c85bb072 100644 (file)
@@ -41,6 +41,8 @@
 :: unless invoked with --no-local.
 if x%1==x--no-local goto nolocal
 if x%2==x--no-local goto nolocal
+if x%3==x--no-local goto nolocal
+if x%4==x--no-local goto nolocal
 setlocal
 :nolocal
 
@@ -58,12 +60,17 @@ del /F ".\pkg\runtime\runtime_defs.go" 2>NUL
 cd ..
 set GOROOT=%CD%
 cd src
+set vflag=
+if x%1==x-v set vflag=-v
+if x%2==x-v set vflag=-v
+if x%3==x-v set vflag=-v
+if x%4==x-v set vflag=-v
 
-echo ##### Building Go bootstrap tool.
-echo cmd/dist
 if not exist ..\bin\tool mkdir ..\bin\tool
 if "x%GOROOT_BOOTSTRAP%"=="x" set GOROOT_BOOTSTRAP=%HOMEDRIVE%%HOMEPATH%\Go1.4
 if not exist "%GOROOT_BOOTSTRAP%\bin\go.exe" goto bootstrapfail
+echo Building Go cmd/dist using %GOROOT_BOOTSTRAP%
+if x%vflag==x-v echo cmd/dist
 setlocal
 set GOROOT=%GOROOT_BOOTSTRAP%
 set GOOS=
@@ -76,21 +83,27 @@ if errorlevel 1 goto fail
 if errorlevel 1 goto fail
 call env.bat
 del env.bat
-echo.
+if x%vflag==x-v echo.
 
 if x%1==x--dist-tool goto copydist
 if x%2==x--dist-tool goto copydist
+if x%3==x--dist-tool goto copydist
+if x%4==x--dist-tool goto copydist
 
 set buildall=-a
 if x%1==x--no-clean set buildall=
 if x%2==x--no-clean set buildall=
+if x%3==x--no-clean set buildall=
+if x%4==x--no-clean set buildall=
 if x%1==x--no-banner set buildall=%buildall% --no-banner
 if x%2==x--no-banner set buildall=%buildall% --no-banner
+if x%3==x--no-banner set buildall=%buildall% --no-banner
+if x%4==x--no-banner set buildall=%buildall% --no-banner
 
 :: 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
+.\cmd\dist\dist bootstrap %vflag% %buildall% 
 if errorlevel 1 goto fail
 del .\cmd\dist\dist.exe
 goto end
index 7704b1241738bee9cd7bb9dd333a5c6df2a4fc76..7ae6221b38c8d09f4e29df394f94354e9249039c 100755 (executable)
@@ -41,8 +41,13 @@ rm -f ./runtime/runtime_defs.go
 # Determine the host compiler toolchain.
 eval `{grep '^(CC|LD|O)=' /$objtype/mkfile}
 
-echo '##### Building Go bootstrap tool.'
-echo cmd/dist
+vflag=()
+if(~ $1 -v) {
+       vflag=(-v)
+       shift
+}
+
+
 GOROOT = `{cd .. && pwd}
 if(! ~ $#GOROOT_BOOTSTRAP 1)
        GOROOT_BOOTSTRAP = $home/go1.4
@@ -66,11 +71,15 @@ if(~ $GOROOT_BOOTSTRAP $GOROOT){
        echo 'Set $GOROOT_BOOTSTRAP to a working Go tree >= Go 1.4.' >[1=2]
        exit bootstrap
 }
-rm -f cmd/dist/dist
+
+echo 'Building Go cmd/dist using '^$GOROOT_BOOTSTRAP
+if(~ $#vflag 1)
+       echo cmd/dist
 GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' $GOROOT_BOOTSTRAP/bin/go build -o cmd/dist/dist ./cmd/dist
 
 eval `{./cmd/dist/dist env -9}
-echo
+if(~ $#vflag 1)
+       echo
 
 if(~ $1 --dist-tool){
        # Stop after building dist tool.
@@ -89,7 +98,7 @@ if(~ $1 --no-clean) {
 # 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 -v $buildall $*
+./cmd/dist/dist bootstrap $vflag $buildall $*
 rm -f ./cmd/dist/dist
 
 # DO NOT ADD ANY NEW CODE HERE.