-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: GOPROXY default can make 'get -u' lag upstream repository #32870
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
Comments
@mvdan @rogpeppe and I were discussing this offline including various alternatives to the I think there is a change in workflow here that might affect a not-insignificant number of users. That's just a feeling, because I don't have specific numbers. In 1.12, In 1.13, are we saying |
Not that this adds much to the discussion, but I'd be one of those users. Thanks for raising this issue. |
One option would be for the proxy not to serve branch names at all. It could serve a 404 or 410 for the We would lose some of the efficiency benefits of the proxy that way, but those benefits are most important for transitive dependencies — and transitive dependencies should always be pre-resolved to proper versions or pseudo-versions anyway. |
This would presumably include |
@bcmills That is an interesting idea. Will the fallback to 'direct' mode be permanent? It seems like go commands are starting to depend on the fallback more and more. @myitcv Is If you meant the former, most go users will start fetching modules, packages, programs without version specified and the go command will treat them (and some of the dependencies) as -- That will cause the module I am working on to be fetched directly (without any roundtrip to the proxy) but does verification against We are also planning to improve data freshness by utilizing the new 1.13 feature (#32239) to detect the latest pseudo version. |
I really like this idea. I'm slightly concerned about different versions of |
I'm not sure this issue is specific to pseudo versions is it? Because it occurs whenever a VCS releases a new version that the proxy has not yet seen, pseudo-version or otherwise. The issue (at least the aspect I'm worried about) is that in in 1.13, we are saying users either have to:
to avoid getting a stale latest version. Both solutions work, but both represent a change to what is, I suspect, a common workflow. I just want to be sure a) my understanding is correct and b) we are comfortable with pushing this change in workflow. |
@myitcv For non-pseudo versions, proxy.golang.org includes it in the Once the semver-tagged module lands in the proxy.golang.org, it should be available to other users almost immediately (a couple of minutes in worst case). Otherwise, please file a bug. |
I'm not sure. I certainly expect it to be around for a while, at least.
It seems fairly harmless to let those drop to
That would be fine for |
Probably not, for the reasons @hyangah mentioned. Plus, |
@bcmills my personal preference is also for proxy.golang.org not to accept |
Ah, now I think I understand your reference to #32239 (I couldn't understand why that field would be useful to the user, but it is to the proxy). So just to clarify. Under your proposal:
Is that about right? |
Thanks for confirming @hyangah. This is, if memory serves, very much along the lines of a conversation we had before, so great to hear it's going live! So, assuming we are post the release of a proxy fix that includes #32239, the change in workflow here is: when a new (pseudo) version is released, someone/something (i.e. That's definitely more understandable, but still worth flagging up in the release notes I suspect. (On a related note: given that many (most?) people release new versions via one of the GitHub interfaces (e.g. "Draft new release") it might be worth kicking off a conversation with GitHub folks about integrating some sort of hook with the proxy?) |
I hit this multiple times in my personal infrastructure. I usually push changes to a repository, and then rebuild a Docker container with
The proxy cache means that I can't deploy more than once every cache period. My temporary solution is to set
|
We have a section on |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
No, because Go 1.12 doesn't have a GOPROXY set up by default.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Module A and B live in separate repositories, and they are both v0. A depends on B.
I push a commit to B, and then run
go get -u
in A to update the dependency to that new master commit. Alternatively, triedgo get B@master
.What did you expect to see?
A's
go.mod
updated to show B's latest pseudo-version with the master commit just pushed.What did you see instead?
B's version staying at an older version, pushed hours or days before. Presumably because
proxy.golang.org
caches the version for@latest
and@master
.This went unnoticed for a while and someone was scratching their head until they realised
go get -u
hadn't done what they were used to.GOPROXY=direct go get -u
had to be used to work around this issue in the end. The other option was to manually copy the commit hash to force the proxy to fetch that git ref, which is a bit cumbersome.In the end, I worry that the new
GOPROXY
default in 1.13 is going to confuse people who are used to pushing to multiple repos that depend on each other. I understand why the proxy server can't fetch from git repeatedly every single time, but I wonder if there's something we can do to not silently break this./cc @bcmills @heschik @jayconrod
The text was updated successfully, but these errors were encountered: