-
Notifications
You must be signed in to change notification settings - Fork 17.8k
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: module dependencies not updated with go get -u
in 1.17
#47768
Comments
go get -u
in 1.17
@niallnsec is this new in 1.17? Can you reproduce with 1.16? CC @bcmills @jayconrod @matloob via https://dev.golang.org/owners |
Yes this only seems to happen with go 1.17. I don't think I made it very clear above (sorry about that), but the two code blocks in the report above show me using Go 1.16.4 worked as expected, 1.17 appeared to ignore most of the available updates, even though it had downloaded updated code for two of them. |
This comment has been minimized.
This comment has been minimized.
@niallnsec Thanks for reporting this. It sounds like there might be a bug here, but we need more information to understand what's going on.
|
I have not got a public repo example at the moment, but will keep looking or try to create a test case that has the same behaviour. In the mean time, to answer your other questions:
Yes, for both go1.16.7 and go1.17 the output of
The modules not updated are imported both directly and indirectly.
When I upgraded to go 1.17 I update the go directive to 1.17, then did a I am using a private company Go proxy in my environment, so I disabled that before running the tests to make sure it wasn't playing a part. I get the same results with it in use or not. |
Thanks, that helps cross out a few possible causes, but we'll probably still need a reproducible example to figure out what's going on. |
I have created a small demo project here: https://github.com/niallnsec/demo_auth I took the go.mod and go.sum files from my private module exactly as they were following the initial update to Go 1.17. The only edits done manually on these two files (ever) is to remove references to three other internal projects. Otherwise, the module is still importing all of the same public module as in my previous tests. Using that repository, when using Go 1.16
However, Go 1.17 does not update all of the packages in the same way when I run the command:
In this specific case, all of the modules not updated are indirect imports. The three private modules I removed are all direct imports of the original module these files were taken from and they did not update either when using Go 1.17, although one of them was downloaded. |
Thanks, that's really helpful. I was able to reproduce this and narrow it down a bit. Working to find the root cause. It's likely we'll want to backport the fix to 1.17.1. |
Change https://golang.org/cl/343879 mentions this issue: |
@gopherbot Please backport to 1.17. This is a bug in new functionality. |
Backport issue(s) opened: #47857 (for 1.17). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
I see the same issue as @niallnsec. Private modules are not updated in go.mod file with
|
@tsipo Could you confirm that 1) the main module has If one of those is not true, please open a new issue with enough info to reproduce. It may be a separate bug. |
@jayconrod Yes, I can confirm these are all 1.17. I first upgraded all of my libraries in their dependency order (some of the private libraries depend on others), then I upgraded all of my "main modules" which depend on these libraries.
|
Thanks for confirming. I think https://golang.org/cl/343879 should fix this for you. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I ran
go get -u
What did you expect to see?
I expected the module dependencies to be update as usual.
What did you see instead?
Only a small number of dependencies were updated. Even directly imported packages with new versions were not updated. The command appeared to download the new versions but did not update the go.mod file.
After running the above command, go.mod still has a require line for
private2.repo/project/mfa v0.2.4
andprivate2.repo/project/webauthn v1.0.2
instead of upgrading them to the new version it just downloaded. Also, many package updates are completely ignored.If I use go 1.16.4 instead I get the following and go.mod is updated as expected with all the appropriate new versions.
The text was updated successfully, but these errors were encountered: