Repository navigation
Closed
Labels
FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.Issue is not actionable because of missing required information, which needs to be provided.
Description
Go extension version: 0.14.4
> go version
go version go1.14.3 linux/amd64
> flatpak run com.vscodium.codium -v
1.46.1
cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
x64
> flatpak run com.visualstudio.code-oss -v
flatpak-vscode-oss: Setting up Node.js packages
flatpak-vscode-oss: Setting up Cargo packages
flatpak-vscode-oss: Setting up Python packages
1.46.1
cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
x64
> flatpak run com.visualstudio.code -v
1.46.1
cd9ea6488829f560dc949a8b2fb789f3cdc05f5d
x64
> go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/o/.cache/go-build"
GOENV="/home/o/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/o/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/lib/go-1.14"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/go-1.14/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD=""
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-build809671429=/tmp/go-build -gno-record-gcc-switches"
Describe the bug
Fresh installation of Go, VSCodium (flatpak) and the Go extension (on Ubuntu 20.04).
Nothing configured, no environment variable such as GOPATH.
Bug = the Go extension cannot find the go executable (PATH contains /usr/bin having the go executable).
I have reproduced this same issue with official VisualCode and Code - OSS too.
Steps to reproduce the behavior:
- Install Go:
sudo apt install golang-go(on Ubuntu 20.04) - Check
golocation:which go, result is/usr/bin/go - Check
goversion:go version, result isgo version go1.14.3 linux/amd64 - Install VSCodium:
flatpak install com.vscodium.codium - Run VSCodium:
flatpak run com.vscodium.codium(version 1.46.6) - Install extension: FIle > Preferences > Extensions > Select Go 0.14.4 "Rich Go language support for Visual Studio Code"
- File > Open folder... > select a folder containing Go files
- A notification on the bottom right corner, says:
Failed to run "go env" to find GOPATH as the "go" binary cannot be found in either GOROOT(undefined) or PATH(/app/bin:/usr/bin:/home/o/.var/app/com.vscodium.codium/data/node_modules/bin)
Expected behavior
Go extension should see the go executable located at /usr/bin
(error message says environment variable PATH contains /usr/bin).
I have tested these three flatpak apps facing the same issue:
flatpak run com.vscodium.codiumflatpak run com.visualstudio.code-ossflatpak run com.visualstudio.code
Metadata
Metadata
Assignees
Labels
FrozenDueToAgeWaitingForInfoIssue is not actionable because of missing required information, which needs to be provided.Issue is not actionable because of missing required information, which needs to be provided.
Activity
hyangah commentedon Jun 27, 2020
The relevant code path used to look for the go binary is:
https://github.com/golang/vscode-go/blob/latest/src/goPath.ts#L69 : check process.env['PATH']
https://github.com/golang/vscode-go/blob/latest/src/goPath.ts#L19-L31 : for each path component in the process.env['PATH'], check if there is a usable
gobinaryhttps://github.com/golang/vscode-go/blob/latest/src/goPath.ts#L96-L106 : code that checks if the 'go' binary exists and accessible.
Is there any condition that would cause this code for the go executable search to fail on your system? (e.g. permission, file mode, or incorrectly splitting the path env var, ...)
As a workaround, can you try
"go.alternateTools": { "go": "/usr/bin/go" }in your case? (and if it still fails,executableFileExistswill be the problematic code).micheartin commentedon Jun 27, 2020
Hi @hyangah
Thanks for the advice, but I have still the same error message.
What I did :
{ "window.zoomLevel": 2, "go.alternateTools": { "go": "/usr/bin/go" } }I wonder if Flatpak has isolated the app in order to allow access to only very few paths / executables...
I have also tried the following settings.json content, but no success:
micheartin commentedon Jun 27, 2020
I have just installed Flatseal https://askubuntu.com/q/1086529#1247345
and I can see that "VSCodium", "Code - OSS" and "Visual Studio Code" have all three access to all system files (
filesytem=host) but no access to user files (filesytem=home).I am still investigating on that direction...
hyangah commentedon Jun 29, 2020
@micheartin thanks for the update. Failure even with
"go.alternateTools"setting is clearly a sign that the binary is not accessible from the extension. In addition to thegocommand, this extension requires to run other tools (gopls,dlv, and a few others), so the permission issue should be sorted out first.[-]The Go extension cannot find the `go` executable but PATH contains `/usr/bin` having the `go` executable[/-][+]The extension cannot find the `go` executable in PATH when used with flatpack[/+][-]The extension cannot find the `go` executable in PATH when used with flatpack[/-][+]The extension cannot find the `go` executable in PATH when used with flatpak[/+]hyangah commentedon Jul 21, 2020
@micheartin I don't see any immediately actionable tasks for this extension to help this specific case. I will close this issue now. If you have feature requests or suggestions for improvement, feel free to reopen or file a new issue. Thanks!
micheartin commentedon Jul 21, 2020
All right. I plan to perform similar tests on Fedora Workstation and also some tests using Toolbox
(see https://docs.fedoraproject.org/en-US/fedora-silverblue/toolbox/ and https://github.com/containers/toolbox)
If I found a solution I will post it here.
However I am currently working on other tasks and will check this issue later...
micheartin commentedon Sep 5, 2020
The Flatpak documentations https://docs.flatpak.org/en/latest/sandbox-permissions.html#filesystem-access says:
My understanding: the confined IDE has never access to
godependencies (libraries) in/liband/lib64, even when providing options--filesystem=/lib --filesystem=/lib64(or using Flatseal).Alternatives to use the Go extension (vscode-go) on a GNU/Linux distribution:
/home/$USERlocation. See https://dev.to/satimewallin/go--mess-with-flatpakvscode-ja6--classic(unboxed) installtion. Attention: your IDE will have full access to your filesystem.flatpak install com.vscodium.codiumbysudo snap install codium --classicflatpak run com.visualstudio.codebysudo snap install code --classic