Skip to content
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: complains about inconsistent vendoring in the standard library #40250

Closed
FiloSottile opened this issue Jul 16, 2020 · 8 comments
Closed
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Milestone

Comments

@FiloSottile
Copy link
Contributor

image

To reproduce, simply open the $GOROOT/src directory of current master.

  • vscode-go version: 2020.7.820
  • gopls version: golang.org/x/tools/gopls@v0.4.2 h1:SPpw/YOMhYKB5TjtZj77ddcTDQkpkUZtw4+0jtVYwro=
  • go version: devel +6ba3e6a8c7

My config

    "go.gopath": "~",
    "go.toolsGopath": "~/.vscode/gopath",
    "go.autocompleteUnimportedPackages": true, // https://golang.org/issue/31906
    "go.useLanguageServer": true,
    "go.enableCodeLens": {
        "runtest": false,
        "references": false
    },
    "[go]": {
        "editor.snippetSuggestions": "none",
        "editor.codeActionsOnSave": {
            "source.organizeImports": true
        },
    },
    "gopls": { // https://github.com/golang/tools/blob/master/gopls/doc/settings.md
        "staticcheck": true,
        "hoverKind": "FullDocumentation",
        "deepCompletion": true,
        "completeUnimported": true, // https://golang.org/issue/31906
    },

My workspace config

{
    "go.alternateTools": {
        "go": "~/go/bin/go"
    },
    "go.toolsGopath": "~/.vscode/godev",
    "html.format.enable": false,
    "editor.codeActionsOnSave": {
        "source.organizeImports": false
    },
    "gopls": {
        "analyses": {
            "ST1003": false,
        },
    },
    "go.languageServerFlags": [
        "-rpc.trace"
    ],
}
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Jul 16, 2020
@gopherbot gopherbot added this to the Unreleased milestone Jul 16, 2020
@stamblerre
Copy link
Contributor

I'm not able to reproduce this. Can you share the gopls logs? (https://github.com/golang/tools/blob/master/gopls/doc/troubleshooting.md#capturing-logs) Does running go mod vendor fix the issue?

@FiloSottile
Copy link
Contributor Author

It's been happening on and off for a few days and I am not seeing it right now. (Maybe since I rebuilt the go binary? I do that a lot.) I'll collect logs when it happens again.

go mod vendor does not make any change. (There are TryBots to check that the stdlib is always clean.)

@stamblerre
Copy link
Contributor

Hm, you're right that it probably has something to do with the go binary. Let me know if you catch it again.

@josharian
Copy link
Contributor

This has been happening to me as well; it's not just @FiloSottile. I haven't dug into why, but I'd love for it to be fixed. :)

@stamblerre
Copy link
Contributor

/cc @heschik for vendoring, @jayconrod for go command - all gopls does is run go list -e -json -compiled ./src/... in the standard library. I don't know enough about vendoring to understand how this would happen, unless the go.mod file was changing.

@jayconrod
Copy link
Contributor

The go command reports this error when go.mod is inconsistent with vendor/modules.txt. If neither file has changed since the last go mod vendor run, this error shouldn't be reported.

Could there be some mismatch between the go binary being used, the GOROOT directory, and the GOROOT environment (if set explicitly)?

@stamblerre
Copy link
Contributor

I just checked, and I can't reproduce this with Go 1.14 or when my go binary matches the stdlib.
So, @FiloSottile and @josharian, the next step would be to grab your gopls logs when this happens, and then to run go list -e -json -compiled -test ./src/... to see if it's reproducible.

@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.5.0 Jul 20, 2020
@stamblerre stamblerre added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Jul 20, 2020
@stamblerre stamblerre modified the milestones: gopls/v0.5.0, gopls/v1.0.0 Jul 22, 2020
@gopherbot
Copy link

Timed out in state WaitingForInfo. Closing.

(I am just a bot, though. Please speak up if this is a mistake or you have the requested information.)

@golang golang locked and limited conversation to collaborators Aug 25, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

5 participants