-
Notifications
You must be signed in to change notification settings - Fork 18k
cmd/go: loading dependencies with go test -i
does not correctly handle *.go
import paths
#34653
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
Issue was detected on this repo when modifying its CI. My preliminary analysis has given me the following:
The particular issue lies in this piece of the I see two issues here, that will likely need to be addressed separately:
NB: the second code path through which this specific case could be hit is via cc @jirenius - as he raised this issue on Slack - https://gophers.slack.com/archives/C9BMAAFFB/p1570004894155200 cc @Skarlso @bcmills as it looks like you were the last to touch / review the code-path in question. |
If people agree with my assessment above I'd be happy to deal with issue 1. and raise a PR. If there are suggestions on how we could locally deal with 2. I'd take those as well and raise another PR for that. |
Yep, I remember this. It was so that errors of these kinds are surfaced properly in the Err section. This fixed some of the logic of the compare too because it was only ever checking the first file and never the second. Is it possible that the test which triggers it is wrong? |
My bad. It looks to be in |
Wait, sorry, I don't understand the question. Also, read Cl as Ci not CL. :D I thought this problem occurd on a testing infrastructure. |
No the CI was indeed for Continuous Integration (but on the project where the issue was detected, not |
Okay, let me know if you find something. |
It does not appear that the test you added was wrong @Skarlso. This issue involves an edge-case that does not yet appear to be covered by tests. I am writing new tests right now to get a reproduction after which I can start looking at writing the actual fix. I was able to to trigger the error as well through
|
Is this a duplicate of #32483? (Did it work with Go 1.12.10, and is it fixed at head?) |
Let me check with a |
Have verified with the latest The #32483 covers issue 2. that I identified above. I'll focus on creating a fix for the issue related to specifying mixed patterns to |
Change https://golang.org/cl/198459 mentions this issue: |
@andybons FWIW, this issue is not specific to modules but independent of whether modules are used or not. |
@gopherbot please backport to 1.13, this was a regression |
Backport issue(s) opened: #34694 (for 1.13). Remember to create the cherry-pick CL(s) as soon as the patch is submitted to master, according to https://golang.org/wiki/MinorReleases. |
Change https://golang.org/cl/198957 mentions this issue: |
Passing ambiguous patterns, ending in `.go`, to `go list` results in them being interpreted as Go files despite potentially being package references. This can then result in errors on other package references. The parsing logic is modified to check for a locally present file corresponding to any pattern ending in `.go`. If no such file is present the pattern is considered to be a package reference. We're also adding a variety of non-regression tests that fail with the original parsing code but passes after applying the fix. Updates #34653 Fixes #34694 Change-Id: I073871da0dfc5641a359643f95ac14608fdca09b GitHub-Last-Rev: 5abc200 GitHub-Pull-Request: #34663 Reviewed-on: https://go-review.googlesource.com/c/go/+/198459 Run-TryBot: Bryan C. Mills <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Bryan C. Mills <[email protected]> (cherry picked from commit 33683f1d64df0cef2c598a84b741abb5af8abe5e) Reviewed-on: https://go-review.googlesource.com/c/go/+/198957 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?
Running
go test -i
to prefetch dependencies for tests.What did you expect to see?
The command ending with a
0
exit-code.What did you see instead?
An error message:
The text was updated successfully, but these errors were encountered: