New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cmd/go: clean -n -cache should only print cache removal commands, not run them #27469

Open
xiaoxubeii opened this Issue Sep 3, 2018 · 2 comments

Comments

Projects
None yet
4 participants
@xiaoxubeii
Contributor

xiaoxubeii commented Sep 3, 2018

What version of Go are you using (go version)?

bash-3.2$ go version
go version go1.11 darwin/amd64

Does this issue reproduce with the latest release?

Yes.

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/xubei1/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/xubei1/go"
GOPROXY=""
GORACE=""
GOROOT="/Users/xubei1/go/src/github.com/go"
GOTMPDIR=""
GOTOOLDIR="/Users/xubei1/go/src/github.com/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/9q/jxm70wvj5k54t2180nr604_c0000gp/T/go-build544006408=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

$ export GOCACHE=/go/src/github.com/go/cache
$ mkdir -p $GOCACHE/11
$ go clean -cache -n
cd /go/src/github.com/go/src
rm -f src.test src.test.exe
rm -r /go/src/github.com/go/cache/11

What did you expect to see?

$ ls $GOCACHE/11
/go/src/github.com/go/cache/11

What did you see instead?

$ ls $GOCACHE/11
ls: /go/src/github.com/go/cache/11: No such file or directory

xiaoxubeii added a commit to xiaoxubeii/go that referenced this issue Sep 3, 2018

clean: "go clean -n -cache" should respect "-n" option
runClean when cleanCache should not execute remove commands when cfg.BuildN = true, but only print them.

Fixes golang#27469

xiaoxubeii added a commit to xiaoxubeii/go that referenced this issue Sep 3, 2018

clean: clean cache with -n should only print remove commands.
runClean when cleanCache should not execute remove commands when cfg.BuildN = true, but only print them.
Fixes golang#27469.
@gopherbot

This comment has been minimized.

gopherbot commented Sep 3, 2018

Change https://golang.org/cl/133055 mentions this issue: clean: clean cache with -n should only print remove commands.

@andybons andybons added this to the Unplanned milestone Sep 4, 2018

@andybons

This comment has been minimized.

Member

andybons commented Sep 4, 2018

xiaoxubeii added a commit to xiaoxubeii/go that referenced this issue Sep 6, 2018

clean: clean cache with -n should only print remove commands.
runClean when cleanCache should not execute remove commands when cfg.BuildN = true, but only print them.
Fixes golang#27469.

@bcmills bcmills modified the milestones: Unplanned, Go1.12 Sep 11, 2018

@rsc rsc changed the title from cmd/go: `go clean -n -cache` should not remove caches but print remove commands to cmd/go: clean -n -cache should only print cache removal commands, not run them Oct 24, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment