-
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: 'go mod download' fails with xyz+incompatible replacement targets while 'go mod verifies' works #34254
Comments
To clarify, the symptom you saw that I think is clearly a bug is the one when using
which you reported to produce the error:
|
Is there any work around on this? |
The first entry here:
really is incorrect, and the |
Change https://golang.org/cl/206761 mentions this issue: |
The second entry here:
is also incorrect, because the module has a |
What will work, as of CL 206761, is:
|
This should be fixed at head. The fix likely patches cleanly onto Go 1.13, but I do not believe that it meets our backporting criteria: I have only been able to find two affected modules ( One possible workaround is to check out the replacement source into a local directory, and target the |
Work for me after removing the +incompatible suffix and adding Example import on go mod:
Go version 1.13.4 GOPRIVATE="company.repo.com" |
works for me as well with the tip Go with this replace:
that's sad (for those of us affected 😄 ) - maybe an exception could be considered since |
We've literally had only the two reports of this issue. (I suspect that most people are not carrying their own patches to |
Change https://golang.org/cl/212105 mentions this issue: |
The 'go' command normally requires the 'go.mod' files for replacement modules to have a major version compatible with the module they are replacing. However, prior to CL 206761, the 'go' command erroneously allowed unversioned paths (which imply major version 0 or 1) to replace 'gopkg.in' paths with any major-version suffix. An analysis of proxy.golang.org suggests that these replacements, while uncommon, are not unheard-of. Rather than breaking the modules that rely on them, we will continue to allow the erroneous replacement paths for this particular pairing. Updates #34254 Change-Id: Icb4e745981803edaa96060f17a8720a058219ab1 Reviewed-on: https://go-review.googlesource.com/c/go/+/212105 Run-TryBot: Bryan C. Mills <bcmills@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Jay Conrod <jayconrod@google.com>
What version of Go are you using (
go version
)?go version go1.13 darwin/amd64
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?GOHOSTARCH="amd64"
GOHOSTOS="darwin"
What did you do?
my
go.mod
file contains replacement targets like:I ran
go mod verify
andgo mod download
.What did you expect to see?
Since the project used to build with go1.12 and still builds / tests run fine, I expect both commands to work without errors.
What did you see instead?
go mod verify
showsall modules verified
(as expected), butgo mod download
fails with:This seems related to #34217; on slack @bcmills said that it is likely a bug.
The text was updated successfully, but these errors were encountered: