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: upgrade check doesn't work with vendor directory #44756

Closed
hummerd opened this issue Mar 3, 2021 · 1 comment
Closed

x/tools/gopls: upgrade check doesn't work with vendor directory #44756

hummerd opened this issue Mar 3, 2021 · 1 comment
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.
Milestone

Comments

@hummerd
Copy link

hummerd commented Mar 3, 2021

What version of Go are you using (go version)?

golang.org/x/tools/gopls v0.6.6
    golang.org/x/tools/gopls@v0.6.6 h1:GmCsAKZMEb1BD1BTWnQrMyx4FmNThlEsmuFiJbLBXio=

go version go1.16 linux/amd64

What operating system and processor architecture are you using (go env)?

go env Output
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/dima/.cache/go-build"
GOENV="/home/dima/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/dima/dvl/go/pkg/mod"
GONOPROXY="..."
GONOSUMDB=".."
GOOS="linux"
GOPATH="/home/dima/dvl/go"
GOPRIVATE="..."
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GOVCS=""
GOVERSION="go1.16"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/dev/null"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build1594619228=/tmp/go-build -gno-record-gcc-switches"

What did you do?

Clicked "Check for upgrade" lens in go.mod file

What did you expect to see?

Available upgrades

What did you see instead?

Error message Running the contributed command: '_vscode_delegate_cmd_klt93z4u' failed.

gopls server logs

[Error - 2:12:12 PM] Request workspace/executeCommand failed.
  Message: err: exit status 1: stderr: go list -m: can't determine available upgrades using the vendor directory
	(Use -mod=mod or -mod=readonly to bypass.)

  Code: 0 
[Error - 2:12:12 PM] 2021/03/03 14:12:12 command error: err: exit status 1: stderr: go list -m: can't determine available upgrades using the vendor directory
	(Use -mod=mod or -mod=readonly to bypass.)

Here is my VSCode settings for gopls

    "gopls": {
        // Add parameter placeholders when completing a function.
        "usePlaceholders": true,

        // If true, enable additional analyses with staticcheck.
        // Warning: This will significantly increase memory usage.
        // "staticcheck": true,
        "codelenses": {
            "generate": false,  // Don't run `go generate`.
            "gc_details": true  // Show a code lens toggling the display of gc's choices.
        },
    },

Shouldn't gopls run go list -m with -mod=readonly flag?

@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 Mar 3, 2021
@gopherbot gopherbot added this to the Unreleased milestone Mar 3, 2021
@stamblerre stamblerre modified the milestones: Unreleased, gopls/v0.6.7 Mar 3, 2021
@stamblerre stamblerre changed the title x/tools/gopls: Check for upgrades does not work in go.mod x/tools/gopls: upgrade check doesn't work with vendor directory Mar 3, 2021
@stamblerre stamblerre added this to To Do in gopls on-deck Apr 15, 2021
@heschi heschi self-assigned this Apr 16, 2021
@gopherbot
Copy link

Change https://golang.org/cl/311909 mentions this issue: internal/lsp: support Check For Upgrades in vendor mode

@stamblerre stamblerre moved this from To Do to Done in gopls on-deck Jul 15, 2021
@golang golang locked and limited conversation to collaborators Apr 23, 2022
@rsc rsc unassigned heschi Jun 23, 2022
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.
Projects
No open projects
Development

No branches or pull requests

4 participants