Skip to content
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

Closed
xiaoxubeii opened this issue Sep 3, 2018 · 2 comments
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone

Comments

@xiaoxubeii
Copy link
Contributor

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
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
runClean when cleanCache should not execute remove commands when cfg.BuildN = true, but only print them.
Fixes golang#27469.
@gopherbot
Copy link

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

@andybons andybons added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. modules labels Sep 4, 2018
@andybons andybons added this to the Unplanned milestone Sep 4, 2018
@andybons
Copy link
Member

andybons commented Sep 4, 2018

@bcmills @rsc

xiaoxubeii added a commit to xiaoxubeii/go that referenced this issue Sep 6, 2018
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 cmd/go: go clean -n -cache should not remove caches but print remove commands cmd/go: clean -n -cache should only print cache removal commands, not run them Oct 24, 2018
@andybons andybons modified the milestones: Go1.12, Go1.13 Feb 12, 2019
@xiaoxubeii xiaoxubeii reopened this Apr 2, 2019
@golang golang locked and limited conversation to collaborators Apr 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Projects
None yet
Development

No branches or pull requests

4 participants