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: latest gopls install fails on MacOS #62162
Comments
I appear to have
|
What is your Xcode version? I think Does the error go away if you temporarily disable cgo, i.e., |
Hi @dmitshur thanks for the response.
Yes! |
It's good that the workaround of disabling cgo works. I'm not sure what's causing the problem when cgo is left enabled. It might be something about the environment you're running this on. Has installing gopls worked on the same machine previously and no longer works, or is it the first time you're trying it? You can check if a simple C program works, for example: #include <stddef.h>
typedef struct { const char *p; ptrdiff_t n; } _GoString_;
int main() {} Does Another thing you can try to get more information is to try to install gopls via a downloaded version of a Go toolchain, as a quick check that the problem isn't your main Go toolchain installation being corrupted somehow. For example, does this work or do you still get the same error this way? $ GOTOOLCHAIN=go1.21rc4 go install golang.org/x/tools/gopls@latest
go: downloading go1.21rc4 (darwin/arm64)
$ echo $?
0 CC @findley, @cherrymui. |
As @dmitshur pointed out, this looks like a problem for C compilation. This would make almost all cgo code unable to build, not just gopls. Could you try @dmitshur 's example
for a simple C compilation, and see if that works? Thanks. |
Yes, it appears to be an issue deeper than anything Go-specific. Trying to compile this trivial C program produces the same error:
Same happens when trying to build other tools, like I just noticed it when trying to install a tree-sitter parser for YAML. Thanks for the help y'all! UPDATE: Somehow I had a 0-byte file |
gopls version
Unable to install gopls
my go version:
go version go1.21.0 darwin/arm64
go env
What did you do?
What did you expect to see?
Successful installation of gopls
What did you see instead?
Failed with this message:
Editor and settings
Editor is N/A but here is my OS info
The text was updated successfully, but these errors were encountered: