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 -modcache" and then "go install <package>@<version(ex: latest)>" does not reflect the latest version. #52695

Closed
shinshin86 opened this issue May 3, 2022 · 3 comments

Comments

@shinshin86
Copy link

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

$ go version
go version go1.18.1 darwin/arm64

Does this issue reproduce with the latest release?

Yes

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

go env Output
$ go env
GO111MODULE=""
GOARCH="arm64"
GOBIN=""
GOCACHE="/Users/yukishindo/Library/Caches/go-build"
GOENV="/Users/yukishindo/Library/Application Support/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="arm64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/yukishindo/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/yukishindo/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_arm64"
GOVCS=""
GOVERSION="go1.18.1"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/dev/null"
GOWORK=""
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -arch arm64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/nb/5pgql3j15bl1rwghw7sb5hrw0000gn/T/go-build3389596706=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

Full reproduction procedures cannot be described because it is necessary to modify the actual remote package to be installed in order to reproduce the problem.

I will describe the reproduction procedure with supplementary text.

1. Install Remote Package

First, install the package by specifying the version.

# This is an actual package that I have published and that actually exists.
go install github.com/shinshin86/go-te@latest

2. Fix remote packages

Next, modify this remote package and push it.
(If you install this package at this stage using @latest, I would expect the latest version to be installed.)

3. Install the latest version again

Install the latest version again. However, at this point, the latest version is not yet reflected.

go install github.com/shinshin86/go-te@latest

4. Clean cache

I think it might be because I have cache left, so I run the following command.

go clean -modcache

5. Install the latest version again

Install with @latest again.

go install github.com/shinshin86/go-te@latest

The logs indicate that it is installed, but when run, it is not the latest version.

What did you expect to see?

I was expecting the latest packages to be installed by doing a "go clean -modcache" and then reinstalling.

What did you see instead?

I referred to the following document.

I have also examined the source code of Go itself, but could not anticipate the relevant section.
Therefore, I have registered an issue with the hope that anyone with an idea of the problem will comment on this.

@seankhliao
Copy link
Member

By default, go uses a module mirror/caching proxy to speed things up. For efficiency, references are cached for a short period of time. See GOPROXY, GOPRIVATE, https://go.dev/ref/mod (search for "proxy") and https://proxy.golang.org/

Unlike many projects, the Go project does not use GitHub Issues for general discussion or asking questions. GitHub Issues are used for tracking bugs and proposals only.

For questions please refer to https://github.com/golang/go/wiki/Questions

@bcmills
Copy link
Contributor

bcmills commented May 4, 2022

Duplicate of #38065

@bcmills bcmills marked this as a duplicate of #38065 May 4, 2022
@shinshin86
Copy link
Author

@seankhliao Thanks for the reply.
I see. So in this case, this behavior was caused by a cached for a short period of time.
I understand. Thank you!

@golang golang locked and limited conversation to collaborators May 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants