Open AdamIsrael opened 6 years ago
To expand on this issue, problems seem to be rooted here: https://github.com/joefitzgerald/go-plus/blob/72d998a58a2b18fa34da588054f7f019e70db77a/lib/config/locator.js#L269
The paths are statically programmed and don't really work for any alternative package managers on *nix systems (I'm specifically working with snaps on Ubuntu). Would be nice to do lookups in PATH as a fallback.
@bigs
The paths are statically programmed and don't really work for any alternative package managers on *nix systems (I'm specifically working with snaps on Ubuntu). Would be nice to do lookups in PATH as a fallback.
This is not accurate.
Would be nice to do lookups in PATH as a fallback.
This is the PATH lookup you're requesting: https://github.com/joefitzgerald/go-plus/blob/72d998a58a2b18fa34da588054f7f019e70db77a/lib/config/locator.js#L284
@joefitzgerald What would the right approach here be? The snap-installed golang binaries would be in /snap/bin, so that could be added as a lookup path, or as @bigs suggested, falling back to using the user's $PATH.
@AdamIsrael are you certain that /snap/bin
is in the path (as it is seen by Atom)? If you open Atom's developer tools, you can use the console to look at process.env.PATH
.
@joefitzgerald Yep, confirmed.
Ignore the duplicate paths; I clearly need to clean this up a bit:
process.env.PATH "/home/stone/bin:/home/stone/go/bin:/usr/local/bin:/usr/local/sbin:/home/stone/bin:/home/stone/go/bin:/usr/local/bin:/usr/local/sbin:/home/stone/bin:/home/stone/go/bin:/usr/local/bin:/usr/local/sbin:/home/stone/bin:/home/stone/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/stone/.oh-my-zsh/custom/plugins/desk:/home/stone/.oh-my-zsh/custom/plugins/desk:/home/stone/.oh-my-zsh/custom/plugins/desk"
/snap/bin
includes:
Might there be another binary it's looking for that I'm missing there?
Can you paste the output of which -a go
?
$ which -a go
/snap/bin/go
I've been trying to debug this a bit. I haven't found exactly where the failure is coming from within the plugin, but I can confirm that atom installed from .deb works fine, while the snapped version fails. I know that there's some sandboxing involved in the snap version, i.e., it can't write outside of /snap or the user's home directory. I'm not sure why that would affect finding the go tools, but it's another data point.
Yeah the atom team explicitly does not support atom unless it is installed via the official atom release. I suspect there will be other incompatibilities when using the snap distribution, you just haven’t found them yet.
@joefitzgerald ah, odd. got a bit lost in the indirection, but that definitely checks out. i'll try and debug this soon... would be nice to know what was happening if only to give a solid error message.
I am experiencing this issue with atom installed from the official deb package. process.env.PATH includes the path for my go binary. Everything was working until recently.
atom -v && apm -v && which -a go && go env
Atom : 1.32.2
Electron: 2.0.9
Chrome : 61.0.3163.100
Node : 8.9.3
apm 2.1.2
npm 6.2.0
node 8.9.3 x64
atom 1.32.2
python 2.7.15rc1
git 2.17.1
/usr/local/go/bin/go
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/aferm/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build698398182=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
PKG_CONFIG="pkg-config"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
Prerequisites
atom .
from the terminal in your project's directory?go env
is correct? If it is, please include the output in this issue.Description
After a recent update from Ubuntu 16.04 to Ubuntu 18.04, I started getting "Missing Go Tool" when I start atom or run "Update Tools".
I'm running the latest versions of atom and golang installed via snap.
Output from
atom -v && apm -v
Output From
go env
Steps to Reproduce
Start atom or manually run "Update Tools"
Expected Behavior
The tools should be found.
Actual Behavior
"Missing Go Tool" error dialog displays and go-plus tools do not work.