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

go get #56314

Closed
sunshine69 opened this issue Oct 19, 2022 · 5 comments
Closed

go get #56314

sunshine69 opened this issue Oct 19, 2022 · 5 comments

Comments

@sunshine69
Copy link

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

go version
go version go1.19.2 linux/amd64

Does this issue reproduce with the latest release?

It is the latest version

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

go env Output
go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/stevek/.cache/go-build"
GOENV="/home/stevek/.config/go/env"
GOEXE=""
GOEXPERIMENT=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/stevek/go/pkg/mod"
GONOPROXY="git.neds.sh"
GONOSUMDB="git.neds.sh"
GOOS="linux"
GOPATH="/home/stevek/go"
GOPRIVATE="git.neds.sh"
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/mnt/live/memory/images/002-ubuntu-devtool-x86_64.xzm/opt/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/mnt/live/memory/images/002-ubuntu-devtool-x86_64.xzm/opt/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.19.2"
GCCGO="gccgo"
GOAMD64="v1"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/stevek/src/webnote/go.mod"
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 -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build4033466200=/tmp/go-build -gno-record-gcc-switches"

What did you do?

What did you expect to see?

I expect go should fetch the latest git hash and get the latest code in the module.

What did you see instead?

What I saw in ~/go/pkg/mod/github.com/sunshine69/golang-tools/ the dir still point to old hash
ls ~/go/pkg/mod/github.com/sunshine69/golang-tools/
[email protected]

ls ~/go/pkg/mod/github.com/sunshine69/
golang-tools [email protected] [email protected]

@sunshine69
Copy link
Author

The behavior is strange

If I create a new very simple project from scratch and use that module, run go mod tidy or anything, it fetch the latest code and works.

Just it does not work on the existing project. It might be something in there but I have not found yet.

@sunshine69
Copy link
Author

And now I fixed it in a way that is not ideal.

Edit the go.mod in the faulty project, remove everything in require sections so it will be very clean.

After that run go get -u ./... again

it works

If anyone interested in the content of that go.mod when it causes troubles to debug this issues pls let me know.

sunshine69 pushed a commit to sunshine69/webnote that referenced this issue Oct 19, 2022
When go get -u ./... does not update the proper latest version, - clean
your go.mod files, removing all requires generated section and try go
mod tidy again. It should work

Report that issues in golang/go#56314 but not
sure when someone can look at it.
@seankhliao
Copy link
Member

sounds like proxy catching?

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

@seankhliao seankhliao closed this as not planned Won't fix, can't repro, duplicate, stale Oct 19, 2022
@sunshine69
Copy link
Author

Hi there,

I do not think it is a question as such.

It is a bug. That happened to my case. I should not expect that issue. Thus it should be a bug and need to be investigated.

In general, if it works for a scratch project does not mean that bug report is invalid, because the input/cache is different.

Yes, I did remove all cache package in my ~/go/pkg and retry. Bug still exists. Thus it is even not a cache issue.

My theory is that go handle dependencies wrongly for existing dependencies in go.mod. Clearing these old requirements in go.mod allow it to work again. I wish someone can look into it and fix it so people wont waste time to debug or clear go.mod content.

@sunshine69
Copy link
Author

And it is not proxy catching, as I mentioned above, I set GOPROXY to direct and it does not solve the problems.

Please re-open it as it is a bug, not a questions or discussions. If some one take this ticket and want to re-create it - please comment and let me know. I still hold the branch of my repo when the bug happened and it can be fully repeat the behavior.

Thanks

@golang golang locked and limited conversation to collaborators Oct 19, 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

3 participants