-
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: tries to download v2.2.2 (no suffix) when checking a replaced v2.2.2+incompatible for a missing import #33795
Comments
/cc @bcmills |
I tried this on Go 1.12.9, and the |
…1642) Make @bartekn's fork of the `throttled` dependency the primary dependency for that dependency instead of being just a custom source, which is now hosted at `github.com/stellar/throttled`. This is part of the initiative to move to Modules (#1634) and is a small change to simplify our Gopkg.toml/lock files to make that transition possible and simpler. Using the fork seems to be confusing the go tooling in go1.12 and go1.13rc1, with both behaving a little differently. There is an issue open golang/go#33795 about it. The issue seems to be limited to replacing modules that don't have a `go.mod`, which is the case with the `throttled` module. Since this fork is the only fork of a dependency we use and it is simple package, it is straight forward for us to switch to using the fork fully in name rather than to try and make it work consistently with both versions, and we did that in bartekn/throttled#2. See that issue for more details about why we felt like this is the right move. For context, in modules a `replace` directive is how we tell the go toolchain that we want to use a fork of a module. However, a replace statement only applies when go commands are executed inside this repo as the main module and so importers of our repo won't be using the fork. This doesn't really matter for `throttled` because we only use it in `internal` and `main` modules of `horizon`, but because of this the go toolchain does care about the original source since importers of our repo will get the original source, not the replacement. The revision of `stellar/throttled` that we are importing did change. You can see the diff here: stellar/throttled@c99eef3...89d7581
When you say that |
For reference, here is what @heschik and I observe with
It's trying to resolve I see the same problem (albeit with a worse diagnostic) using
|
Hmm, trying with a clean modcache in a new container I'm now seeing the exact same error as you when running with go1.12.9. Possibly something in my environment state was causing this to not to happen before? I no longer have the container I was running those tests in unfortunately to inspect it. It does seem like somewhere the |
From what I can see, if you start with the FTR, the proximate cause of the problem seems to be that tidy is looking at upstream |
The full output of what I see when I run
Doing same on
Noteworthy is the line in both outputs that references @heschik I don't see success on the first attempt like you, with either |
Sorry -- with GOSUMDB=off the first succeeds, then I get the loopy error on the second. |
Found the bug. It's another variation on #32700. |
Change https://golang.org/cl/212200 mentions this issue: |
With the fix, I get a successful
|
This seems like a small and obvious enough fix to make Go 1.14. The bug has been present since CL 152739, but was masked by the lack of error reporting in |
Change https://golang.org/cl/212201 mentions this issue: |
I noticed the missing diagnostic when writing a regression test for #33795. Change-Id: Ic3249436a6109d71f9ff720b7096f9b872f6a94b Reviewed-on: https://go-review.googlesource.com/c/go/+/212201 Run-TryBot: Bryan C. Mills <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Jay Conrod <[email protected]>
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 run
go mod tidy
on the following code.go.mod
:main.go
:What did you expect to see?
I expected
go mod tidy
to exit status code of success (0
).What did you see instead?
The
go mod tidy
command had a failure exit status code (1
) and a410 Gone
error message.If I visit the URL https://sum.golang.org/lookup/github.com/throttled/[email protected] it returns the text:
If I remove the
replace
directive,go mod tidy
returns success and there is no verifying error message. The output in the section above where the exit status is0
is what I see when thereplace
statement is removed. The problem I'm experiencing is isolated to when thereplace
directive is in use.The version of the throttled package is
v2.2.2+incompatible
and so if the tool wants to query the sumdb about it, it should be attempting to query the URL https://sum.golang.org/lookup/github.com/throttled/[email protected]+incompatible, but for some reason it is attempting to go to the URL without the+incompatible
suffix.It also seems strange that it is attempting to download the source package when I have a replace directive present pointing to the fork. Possibly it shouldn't be doing that either?
Context
The above example is a reduced example of an error I'm seeing while I'm trying to migrate a larger Go repo from dep to Modules (stellar/go#1634).
The text was updated successfully, but these errors were encountered: