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: unable to upgrade gopls #45133

Closed
iamshreeram opened this issue Mar 19, 2021 · 3 comments
Closed

x/tools/gopls: unable to upgrade gopls #45133

iamshreeram opened this issue Mar 19, 2021 · 3 comments
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

@iamshreeram
Copy link

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

$ go version
go version go1.15.2 darwin/amd64

Does this issue reproduce with the latest release?

Yes. I'm seeing this issue after upgrading the golang version.

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

go env
$ go env
GO111MODULE="on"
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/sram/Library/Caches/go-build"
GOENV="/Users/sram/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOINSECURE=""
GOMODCACHE="/Users/sram/ram/project/go/pkg/mod"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/sram/ram/project/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
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 -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/sn/pw7xq23n2vj_wnq16lkgdrxh0000gn/T/go-build150007759=/tmp/go-build -gno-record-gcc-switches -fno-common"

What did you do?

go get golang.org/x/tools/gopls@latest

What did you expect to see?

Successful update of gopls version to 0.6.8

What did you see instead?

Below error -

go: golang.org/x/tools/gopls latest => v0.6.8
# os/user
/usr/local/go/src/os/user/cgo_lookup_unix.go:20:10: fatal error: 'unistd.h' file not found
#include <unistd.h>
         ^~~~~~~~~~
1 error generated.
@gopherbot gopherbot added the gopls Issues related to the Go language server, gopls. label Mar 19, 2021
@iamshreeram iamshreeram changed the title Unable to upgrade gopls x/tools/gopls: unable to upgrade gopls Mar 19, 2021
@gopherbot gopherbot added the Tools This label describes issues relating to any tools in the x/tools repository. label Mar 19, 2021
@gopherbot gopherbot added this to the Unreleased milestone Mar 19, 2021
@cherrymui
Copy link
Member

How did you install the Go toolchain? Does your system have a C toolchain (Xcode) installed?

@cherrymui cherrymui added the WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided. label Mar 19, 2021
@iamshreeram
Copy link
Author

@cherrymui , I have installed go using brew. Yes, I do have xcode installed.

@iamshreeram
Copy link
Author

Hi, I was able to fix this issue by updating clang version from 4.0.1 to 12.0.0.

Details:

  1. I had older version (4.0.1) of clang running on my system that came with anaconda.
  2. After removing the anaconda's clang, the system was able to point to the clang (version 12.0.0) of xcode

go get golang.org/x/tools/gopls@latest worked well after above steps.

@golang golang locked and limited conversation to collaborators Mar 21, 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. WaitingForInfo Issue is not actionable because of missing required information, which needs to be provided.
Projects
None yet
Development

No branches or pull requests

3 participants