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: go clean -cache runs module load #26432

Closed
saibing opened this issue Jul 18, 2018 · 2 comments

Comments

Projects
None yet
4 participants
@saibing
Copy link

commented Jul 18, 2018

Please answer these questions before submitting your issue. Thanks!

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

go version devel +ce09ce4 Wed Jul 18 01:16:24 2018 +0000 linux/amd64

Does this issue reproduce with the latest release?

yes

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

baas@cae-yun-03:~/bingo/bingo [develop]$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/data1/baas/.cache/go-build"
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/data1/baas/git/go"
GOPROXY="http://10.75.203.36:9090"
GORACE=""
GOROOT="/data1/baas/my/go"
GOTMPDIR=""
GOTOOLDIR="/data1/baas/my/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/data1/baas/bingo/go.mod"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build793325640=/tmp/go-build -gno-record-gcc-switches"

What did you do?

$ export GO111MODULE=on
$ go clean -cache

my go.mod as follow:

module rnd-isource.huawei.com/baas/bingo

What did you expect to see?

no any error

What did you see instead?

baas@cae-yun-03:~/bingo/bingo [develop]$ go clean -cache
go: finding rnd-isource.huawei.com/baas/bingo/bingo latest
go: import "rnd-isource.huawei.com/baas/bingo/bingo": cannot find module providing package rnd-isource.huawei.com/baas/bingo/bingo
@rsc

This comment has been minimized.

Copy link
Contributor

commented Jul 19, 2018

Nice. The problem is that "go clean" originally meant clean the current directory, and so as we've added flags we've kept the original behavior too. But in the case of modules the load is fairly expensive. We should either make the load use -getmode=noauto (#26361) or just skip it entirely when there are flags. Probably the former, once that exists.

@rsc rsc changed the title cmd/go: go clean -cache will find main module cmd/go: go clean -cache runs module load Jul 19, 2018

@rsc rsc added NeedsFix and removed NeedsInvestigation labels Jul 19, 2018

@gopherbot

This comment has been minimized.

Copy link

commented Jul 29, 2018

Change https://golang.org/cl/126655 mentions this issue: cmd/go: split go mod into multiple subcommands

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.