Skip to content

Commit dea23e9

Browse files
committed
src/make.*: make --no-clean flag a no-op that prints a warning
This flag is undocumented and is no longer useful. Users who want to install additional toolchains without cleaning the installed packages should just use `go install`. This CL changes cmd/dist to print a warning that --no-clean is deprecated and to advise users to use `go install std cmd` instead, and then otherwise ignores it: ``` $ ./make.bash --no-clean Building Go cmd/dist using $GOROOT_BOOTSTRAP. (devel +b7a85e0003 linux/amd64) warning: --no-clean is deprecated and has no effect; use 'go install std cmd' instead Building Go toolchain1 using $GOROOT_BOOTSTRAP. ``` Fixes #47204. Change-Id: I275031832098401a49e491e324e8de3427973630 Reviewed-on: https://go-review.googlesource.com/c/go/+/341392 Trust: Matthew Dempsky <[email protected]> Run-TryBot: Matthew Dempsky <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Ian Lance Taylor <[email protected]>
1 parent d4c0ed2 commit dea23e9

File tree

4 files changed

+18
-24
lines changed

4 files changed

+18
-24
lines changed

src/cmd/dist/build.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -1263,14 +1263,19 @@ func cmdbootstrap() {
12631263
timelog("start", "dist bootstrap")
12641264
defer timelog("end", "dist bootstrap")
12651265

1266-
var noBanner bool
1266+
var noBanner, noClean bool
12671267
var debug bool
12681268
flag.BoolVar(&rebuildall, "a", rebuildall, "rebuild all")
12691269
flag.BoolVar(&debug, "d", debug, "enable debugging of bootstrap process")
12701270
flag.BoolVar(&noBanner, "no-banner", noBanner, "do not print banner")
1271+
flag.BoolVar(&noClean, "no-clean", noClean, "print deprecation warning")
12711272

12721273
xflagparse(0)
12731274

1275+
if noClean {
1276+
xprintf("warning: --no-clean is deprecated and has no effect; use 'go install std cmd' instead\n")
1277+
}
1278+
12741279
// Set GOPATH to an internal directory. We shouldn't actually
12751280
// need to store files here, since the toolchain won't
12761281
// depend on modules outside of vendor directories, but if

src/make.bash

+1-7
Original file line numberDiff line numberDiff line change
@@ -203,16 +203,10 @@ if [ "$1" = "--dist-tool" ]; then
203203
exit 0
204204
fi
205205

206-
buildall="-a"
207-
if [ "$1" = "--no-clean" ]; then
208-
buildall=""
209-
shift
210-
fi
211-
212206
# Run dist bootstrap to complete make.bash.
213207
# Bootstrap installs a proper cmd/dist, built with the new toolchain.
214208
# Throw ours, built with Go 1.4, away after bootstrap.
215-
./cmd/dist/dist bootstrap $buildall $vflag $GO_DISTFLAGS "$@"
209+
./cmd/dist/dist bootstrap -a $vflag $GO_DISTFLAGS "$@"
216210
rm -f ./cmd/dist/dist
217211

218212
# DO NOT ADD ANY NEW CODE HERE.

src/make.bat

+10-10
Original file line numberDiff line numberDiff line change
@@ -112,20 +112,20 @@ if x%2==x--dist-tool goto copydist
112112
if x%3==x--dist-tool goto copydist
113113
if x%4==x--dist-tool goto copydist
114114

115-
set buildall=-a
116-
if x%1==x--no-clean set buildall=
117-
if x%2==x--no-clean set buildall=
118-
if x%3==x--no-clean set buildall=
119-
if x%4==x--no-clean set buildall=
120-
if x%1==x--no-banner set buildall=%buildall% --no-banner
121-
if x%2==x--no-banner set buildall=%buildall% --no-banner
122-
if x%3==x--no-banner set buildall=%buildall% --no-banner
123-
if x%4==x--no-banner set buildall=%buildall% --no-banner
115+
set bootstrapflags=
116+
if x%1==x--no-clean set bootstrapflags=--no-clean
117+
if x%2==x--no-clean set bootstrapflags=--no-clean
118+
if x%3==x--no-clean set bootstrapflags=--no-clean
119+
if x%4==x--no-clean set bootstrapflags=--no-clean
120+
if x%1==x--no-banner set bootstrapflags=%bootstrapflags% --no-banner
121+
if x%2==x--no-banner set bootstrapflags=%bootstrapflags% --no-banner
122+
if x%3==x--no-banner set bootstrapflags=%bootstrapflags% --no-banner
123+
if x%4==x--no-banner set bootstrapflags=%bootstrapflags% --no-banner
124124

125125
:: Run dist bootstrap to complete make.bash.
126126
:: Bootstrap installs a proper cmd/dist, built with the new toolchain.
127127
:: Throw ours, built with Go 1.4, away after bootstrap.
128-
.\cmd\dist\dist.exe bootstrap %vflag% %buildall%
128+
.\cmd\dist\dist.exe bootstrap -a %vflag% %bootstrapflags%
129129
if errorlevel 1 goto fail
130130
del .\cmd\dist\dist.exe
131131
goto end

src/make.rc

+1-6
Original file line numberDiff line numberDiff line change
@@ -92,15 +92,10 @@ if(~ $1 --dist-tool){
9292
exit
9393
}
9494
95-
buildall = -a
96-
if(~ $1 --no-clean) {
97-
buildall = ()
98-
shift
99-
}
10095
# Run dist bootstrap to complete make.bash.
10196
# Bootstrap installs a proper cmd/dist, built with the new toolchain.
10297
# Throw ours, built with Go 1.4, away after bootstrap.
103-
./cmd/dist/dist bootstrap $vflag $buildall $*
98+
./cmd/dist/dist bootstrap -a $vflag $*
10499
rm -f ./cmd/dist/dist
105100
106101
# DO NOT ADD ANY NEW CODE HERE.

0 commit comments

Comments
 (0)