-
Notifications
You must be signed in to change notification settings - Fork 17.9k
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 list -mod=readonly' erroneously resolves imports from replaced modules #41577
Labels
FrozenDueToAge
modules
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Comments
Change https://golang.org/cl/258220 mentions this issue: |
gopherbot
pushed a commit
that referenced
this issue
Oct 16, 2020
'go mod tidy' has been able to use replaced versions since CL 152739, but 'go get' failed for many of the same paths. Now that we are recommending 'go get' more aggressively due to #40728, we should make that work too. In the future, we might consider factoring out the new replacementRepo type so that 'go list' can report the new versions as well. For #41577 For #41416 For #37438 Updates #26241 Change-Id: I9140c556424b584fdd9bdd0a747842774664a7d8 Reviewed-on: https://go-review.googlesource.com/c/go/+/258220 Trust: Bryan C. Mills <[email protected]> Trust: Jay Conrod <[email protected]> Run-TryBot: Bryan C. Mills <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Michael Matloob <[email protected]> Reviewed-by: Jay Conrod <[email protected]>
Change https://golang.org/cl/263266 mentions this issue: |
gopherbot
pushed a commit
that referenced
this issue
Oct 17, 2020
…sions In CL 258220 I added replacement versions to the repo versions used in the modload.Query functions. The versions are computed from a map in the modfile index, which has a nondeterministic iteration order. I added a short-circuit condition to skip sorting in the (vastly common) case where no replacement versions are added. However, while cleaning up the change I accidentally deleted the line of code that sets that condition. As a result, the test of that functionality (mod_get_replaced) has been failing nondeterministically. This change fixes the condition by comparing the slices before and after adding versions, rather than by setting a separate variable. The test now passes reliably (tested with -count=200). Updates #41577 Updates #41416 Updates #37438 Updates #26241 Change-Id: I49a66a3a5510da00ef42b47f20a168de66100db6 Reviewed-on: https://go-review.googlesource.com/c/go/+/263266 Trust: Bryan C. Mills <[email protected]> Run-TryBot: Bryan C. Mills <[email protected]> TryBot-Result: Go Bot <[email protected]> Reviewed-by: Daniel Martí <[email protected]>
Fixed by CL 258220. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
FrozenDueToAge
modules
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
When
-mod=readonly
is set,go list
should refuse to resolve missing dependencies, and normally does.However, if the dependency can be satisfied by adding a requirement on a module mentioned in a
replace
directive, the usuallookup disabled
error message is suppressed, andgo list
instead fails withupdates to go.mod needed
:The text was updated successfully, but these errors were encountered: