-
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
x/tools/gopls: inconsistent vendoring issue breaks gopls #39100
Comments
Thank you for filing a gopls issue! Please take a look at the Troubleshooting guide, and make sure that you have provided all of the relevant information here. |
This error message comes straight from the As for continuing, unfortunately |
Indeed, Just to confirm, If |
I think it's desirable for e.g. code completion to be forgiving and "fuzzy" rather than unforgiving and strict — I'd rather have some code completion than none even if my code base is partially "broken". If the introduction of this new check in the |
Yes. before
After update that borked
|
The token go/src/cmd/go/internal/modload/vendor.go Line 99 in 6d6e482
Could you publish a repo that shows the actual contents of the files at the named phases? I wonder if something in |
I re-typed that by hand while looking at my git history; the actual file did, in fact, have the space. This is proprietary code so I can't publish the repo, I hope that there's enough information above. |
(I edited my example to be more correct) |
The change from direct to @evanmoses-okta, can you confirm whether your setup may be importing packages symlinked into the main module's source tree, and/or importing packages with normally-ignored components (such as |
Not as far as I know. I was able to reproduce the behavior of the tooling (that is, adding In that repo, I
Running |
Change https://golang.org/cl/235619 mentions this issue: |
In addition to adding a `go mod vendor` command option, which can be exposed via an editor client frontend, we show a suggestion to users who experience the "inconsistent vendoring" error message. The main change made here is that we save the view initialization error, and we return it if the view has absolutely no metadata. This seems reasonable enough, but my fear is that it may lead to us showing outdated error messages. I will spend some time improving the handling of initialization errors in follow-up CLs. Updates golang/go#39100 Change-Id: Iba21fb3fbfa4bca956fdf63736b397c47fc7ae44 Reviewed-on: https://go-review.googlesource.com/c/tools/+/235619 Run-TryBot: Rebecca Stambler <rstambler@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Heschi Kreinick <heschi@google.com>
I don't think there's anything to do here after CL 235619, apart for waiting for #39164 to be resolved in 1.16. |
What version of Go are you using (
go version
)?1.14.1
Does this issue reproduce with the latest release?
yes
What operating system and processor architecture are you using (
go env
)?What did you do?
Using emacs with LSP-mode and gopls, I got this error after pulling my repo:
and all LSP-related functionality broke. Runing
go mod vendor
added the// indirect
annotation to the<redacted>
module ingo.mod
, but did not affect the error.What did you expect to see?
No error, possibly a warning, and LSP/gopls would continue to work. While there was indeed inconsistent vendoring that was resolved by running
go mod tidy
and thengo mod vendor
, it seems like that shouldn't break gopls and it could continue to provide tooling for my editor. The change in the repo that caused the error was the removal of an explicit import of the dependency, which was still included implicitly via another import.This is the same issue as #34657
What did you see instead?
An error that broke all tooling in my editor.
I propose two independent fixes:
go mod tidy
as well asgo mod vendor
to assist users with cleaning up their dependenciesThe text was updated successfully, but these errors were encountered: