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

Updates to go.mod needed #68076

Closed
master255 opened this issue Jun 19, 2024 · 18 comments
Closed

Updates to go.mod needed #68076

master255 opened this issue Jun 19, 2024 · 18 comments

Comments

@master255
Copy link

master255 commented Jun 19, 2024

Go version

1.22.1

What did you do?

I'm trying to compile a project.
And I want to use github.com/quic-go/quic-go v0.40.1
The compiler tells me that I can't use this version and I have to update it to at least 0.43.0
I don't need that. And I want to use 0.40.1 version.

Why does the program dictate to me what version I should use????

@ianlancetaylor
Copy link
Member

We don't use GitHub for discussions or questions. Please use a forum instead. See https://go.dev/wiki/Questions. Thanks.

If you are absolutely certain that this is a bug, you will need to explain how to reproduce the problem. We won't be able to do anything without that sort of information.

@ianlancetaylor ianlancetaylor closed this as not planned Won't fix, can't repro, duplicate, stale Jun 19, 2024
@master255
Copy link
Author

@ianlancetaylor This is not a discussion. To reproduce the bug install the version:
github.com/quic-go/quic-go v0.40.1
in go.mod
Then try to synchronize the project. Synchronization will automatically update the version to 0.44.0

But I need 0.40.1

@randall77
Copy link
Contributor

I am able to build a project which imports quic-go at version v0.40.1 with no trouble.

We'll need more info.
"the project" = what project, exactly? Something might depend on other entries in your go.mod, or some source file.
"try to synchronize" = what is that, exactly? "go mod tidy", or something else? What exact command did you run?
How do you know the version is updated? Did it change in the go.mod file, or are you seeing this version change some other way?

@master255
Copy link
Author

master255 commented Jun 19, 2024

@randall77 Project - gomobile
Command for synchronization: go mod tidy or go get golang.org/x/mobile/bind

How do you know the version is updated?

I see it in go.mod

@master255
Copy link
Author

bandicam.2024-06-20.00-50-08-883.mp4

I literally can't do anything. Even in Goland.

@randall77
Copy link
Contributor

git clone https://github.com/golang/mobile
cd mobile
go mod tidy
grep quic go.mod

Returns no result. What am I missing?

@master255
Copy link
Author

@randall77 Okay. Use the project https://github.com/libp2p/go-libp2p

@master255
Copy link
Author

And I can't not update the version on the command line and in Goland. So the problem is in Go.

@randall77
Copy link
Contributor

go mod graph (https://go.dev/ref/mod#go-mod-graph) reports this edge:

github.com/quic-go/[email protected] github.com/quic-go/[email protected]

Sure enough, 0.43.0 is required by that module.
https://github.com/quic-go/webtransport-go/blob/master/go.mod
Which was bumped by that project at quic-go/webtransport-go#150 less than 2 months ago.

Your require line is a minimum version spec. Any of your dependencies can require a later version, and Go will pick the minimum version that satisfies everyone (https://research.swtch.com/vgo-mvs).

@randall77
Copy link
Contributor

If you really want to use an earlier version of quic-go, you'll also need an earlier (or modified) version of webtransport-go.

@master255
Copy link
Author

@randall77 Okay. Thank you! But there has to be some kind of message here, I think. From the programmer's side, it seems that Go dictates the version to be used. And it's very time-consuming.
Something needs to be done about it.

@randall77
Copy link
Contributor

From the programmer's side, it seems that Go dictates the version to be used.

Go is not doing the dictating. Your dependencies are doing the dictating.

Something needs to be done about it.

We're open to suggestions. I think changing the selection algorithm is out of the question, but possibly there could be a tool (maybe a mode of go mod tidy?) that describes why it is picking that version. It was pretty easy for me to do that with go mod graph and grep.

@master255
Copy link
Author

@randall77 It is necessary to display the message in the command:
go mod tidy
If the version of one component has been updated because of another component.

@master255
Copy link
Author

@randall77 Or at least some kind of go mod tidy mode that will display a log of its work.

@master255
Copy link
Author

Otherwise, the programming looks very strange #68076 (comment)

@seankhliao
Copy link
Member

The go command reports:

$ go build                                         
go: updates to go.mod needed; to update it:
	go mod tidy

For what you're experiencing, I think that should be a bug report to GoLand for better feedback on changing to incompatible versions.

@seankhliao
Copy link
Member

If you actually used the command line to use the lower version, it would have performed all the necessary downgrades for you:

$ go get github.com/quic-go/[email protected]
go: downloading github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572
go: downloading github.com/google/pprof v0.0.0-20240207164012-fb44976bdcd5
go: downloading golang.org/x/time v0.0.0-20181108054448-85acf8d2951c
go: downloading github.com/quic-go/webtransport-go v0.6.0
go: downgraded github.com/quic-go/quic-go v0.43.0 => v0.41.0
go: downgraded github.com/quic-go/webtransport-go v0.8.0 => v0.6.0

@master255
Copy link
Author

@seankhliao

If you actually used the command line to use the lower version, it would have performed all the necessary downgrades for you:

This is too complicated for Android programmer. And I use gomobile, which recommends me to use : go get golang.org/x/mobile/bind to synchronize components.
I do that and the version is up.
But how to get the version that was there before the automatic upgrade is not written anywhere. And I didn't know it was even possible to start searching.
There is something that needs to be fixed. Make sure that Goland does not ask for additional fixes later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants