-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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 -e does not assign missing import errors to correct package #26909
Comments
It's complicated. The current behavior might even be almost correct. Leaving for Go 1.12. |
@bcmills, @matloob, and I discussed this last week in the context of #36188. There's currently some ambiguity about whether import errors should be attached to the importing package or the imported package in Here's what we came up with:
|
I don't think that's quite right: if the error for a given package is not dependent on the importer, the |
The details of this part are a bit subtle. I think in that case the error should be encoded in the |
@matloob, is this fixed by your recent import-stack CL? I think the relevant TODO is here: go/src/cmd/go/testdata/script/mod_list_bad_import.txt Lines 55 to 58 in 6f52790
|
I just checked, and this isn't fixed at head. I'll take a more in-depth look tomorrow. |
Change https://golang.org/cl/235925 mentions this issue: |
There is a CL out for this issue but nobody has reviewed it. Is this still expected for 1.15, or should we push it to 1.16? Thanks. |
Michael tagged the CL as |
Change https://golang.org/cl/251445 mentions this issue: |
modload.Import previously performed two otherwise-separable tasks: 1. Identify which module in the build list contains the requested package. 2. If no such module exists, search available modules to try to find the missing package. This change splits those two tasks into two separate unexported functions, and reports import-resolution errors by attaching them to the package rather than emitting them directly to stderr. That allows 'list' to report the errors, but 'list -e' to ignore them. With the two tasks now separate, it will be easier to avoid the overhead of resolving missing packages during lazy loading if we discover that some existing dependency needs to be promoted to the top level (potentially altering the main module's selected versions, and thus suppling packages that were previously missing). For #36460 Updates #26909 Change-Id: I32bd853b266d7cd231d1f45f92b0650d95c4bcbd Reviewed-on: https://go-review.googlesource.com/c/go/+/251445 Run-TryBot: Bryan C. Mills <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Jay Conrod <[email protected]> Reviewed-by: Michael Matloob <[email protected]>
Change https://golang.org/cl/258219 mentions this issue: |
For #26909 For #41688 Change-Id: I22f28d426ce499fce6f0f1295dbde425998042aa Reviewed-on: https://go-review.googlesource.com/c/go/+/258219 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: Jay Conrod <[email protected]> Reviewed-by: Michael Matloob <[email protected]>
Moving to Backlog. |
See TODO in testdata/script/mod_lists_bad_import.txt.
The text was updated successfully, but these errors were encountered: