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
Closed

cmd/go: go clean -cache runs module load #26432

saibing opened this issue Jul 18, 2018 · 2 comments
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@saibing
Copy link

saibing 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
@FiloSottile FiloSottile added this to the Go1.11 milestone Jul 19, 2018
@FiloSottile FiloSottile added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. modules labels Jul 19, 2018
@rsc
Copy link
Contributor

rsc 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 The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Jul 19, 2018
@gopherbot
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge modules NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

4 participants