Closed n-ce closed 3 months ago
We have a gopls
package available for Termux, are you using that or are you compiling it yourself?
We have a
gopls
package available for Termux, are you using that or are you compiling it yourself?
I was using go install golang.org/x/tools/gopls@latest
as per helix instructions
and now I did rm -r ~/go/bin/gopls
and pkg install gopls
but the issue remains.
one more thing to consider is fprintln
not working as expected
one more thing to consider is
fprintln
not working as expected
That would be an issue with Golang itself, no?
This is only complication that occured during the installation of go tooling.
go: downloading github.com/sourcegraph/jsonrpc2 v0.0.0-20191222043438-96c4efab7ee2 golangci/golangci-lint info checking GitHub for tag 'v1.59.1' sh: 288: jq: not found golangci/golangci-lint info found version: 1.59.1 for v1.59.1/linux/arm64 golangci/golangci-lint info installed /data/data/com.termux/files/home/go/bin/golangci-lint
Termux is based on Bionic libc. faccessat2
syscall is banned by SELinux due to security issue [1]. It seems that golangci/golangci-lint
is downloaded from GitHub Release rather than complied on device, so it's normal that it doesn't work properly on Android.
one more thing to consider is
fprintln
not working as expected
The prototype of fmt.Fprintln
is func Fprintln(w io.Writer, a ...any) (n int, err error)
, so this is an expected behavior. You probably want fmt.Println
.
[1] https://github.com/golang/go/blob/master/src/syscall/syscall_linux.go#L166C52-L167C70
https://github.com/golangci/golangci-lint/blob/master/install.sh#L193-L238
The install script does not properly detect OS in uname_os()
leading to download linux/arm64 version. Ask upstream to fix their script and also provide the android/arm64 binary in their releases page.
For now you have to build manually instead of follow the instructions.
The syscall issue seems to have been fixed after a restart. I am not sure but I think the gopls
local pkg might have solved this but was in conflict with the previous installation which a restart cleared.
I will re-open in case this surfaces back. And any complications with golangci/golangci-lint
will have to be opened in a new issue preferably in the source repo itself.
I suspect building gopls
from source with default compiler flags misses some options needed to make it work on Termux.
It being fixed after a restart might have something to do with the old version still being active in the backround, but that is just conjecture.
For now you have to build manually instead of follow the instructions.
Is there a tutorial anywhere on building from source?
Anyways, It seems to be working which is why I guess no android user's been complaining about it.
Problem description
I just got started with programming in go, and followed this https://github.com/helix-editor/helix/wiki/Language-Server-Configurations#go for installation with helix. This is only complication that occured during the installation of go tooling.
However I am welcomed with this error on my first program.
What steps will reproduce the bug?
What is the expected behavior?
No LSP error messages on a blank program.
System information