Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

GVM support? #74

Closed
runcom opened this issue Oct 11, 2014 · 13 comments
Closed

GVM support? #74

runcom opened this issue Oct 11, 2014 · 13 comments

Comments

@runcom
Copy link

runcom commented Oct 11, 2014

It would be nice to have https://github.com/moovweb/gvm support. GVM set the gopath to something like /home/antonio/.gvm/pkgsets/go1.3.3/global so you could derive the current go installation and tools

@joefitzgerald
Copy link
Owner

This seems like a reasonable feature. Is there anything go-plus is doing that is specifically causing issues, or should we be detecting GVM use somehow and then invoking it to determine go / GOPATH paths?

@mishak87
Copy link

👍

@dougnukem
Copy link

I had to specify my go executable as my "Go Installation" for it to work, otherwise it was reporting no go installation.

I tried setting my Go installation to $HOME/.gvm/gos/go1.3.1/, but I still got "No Go Installation Found"

@mishak87
Copy link

Using Atom 1.1 when I have instance already running with another project launching

gvm use go1.5
# Now using version go1.5
export GOPATH="$(pwd):$GOPATH"
atom .

Seems like environment variables are not passed. When working with single project commands above are enough to get gvm working with go-plus.

Also I usually do first run without adding GOPATH to install tools globally. Would be handy to have list of commands for manual install as an alternative to automatic install.

@joefitzgerald
Copy link
Owner

When Atom is already running, any subsequent attempts to launch atom result in a new window being launched from the original process. So you're right, the environment for Windows 2...n will be ignored in favor of the environment for Window 1. There may be a workaround to this, but I'm not aware of it if there is.

@alecthomas
Copy link

Looking at goexecutable.coffee, it seems like go-plus doesn't inspect GOROOT (as per the Go install documentation) to find the Go installation.? If it did so, I'm assuming gvm would "just work".

@mishak87
Copy link

mishak87 commented Dec 2, 2015

GVM adds go binaries to PATH no need for GOROOT.

➜  ~  echo "$PATH"
/home/mishak/.gvm/bin:/home/mishak/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
➜  ~  gvm use go1.5
Now using version go1.5
➜  ~  echo "$PATH" 
/home/mishak/.gvm/pkgsets/go1.5/global/bin:/home/mishak/.gvm/gos/go1.5/bin:/home/mishak/.gvm/pkgsets/go1.5/global/overlay/bin:/home/mishak/.gvm/bin:/home/mishak/.gvm/bin:/home/mishak/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

@alecthomas
Copy link

I don't think that's relevant. GVM also updates GOROOT, and it is the "standard" way to locate the Go binaries, so supporting it would make all tools (including GVM) work.

@joefitzgerald
Copy link
Owner

GOROOT is required to be set when you put a runtime built for a standard location in a non-standard location. If you set the appropriate environment variables when building from source to your desired target location, GOROOT does not need to be set.

Regardless, go-plus doesn't care. You should ensure you launch atom from the terminal - in which your environment is set as you need - and things should just work. I agree I could add inspection of GOROOT to the detection logic, but in general the PATH should be used to specify the path to your desired runtime (and precedence among multiple installed runtimes).

You should remove the various paths from your configuration, check the option for environment overrides configuration, and make sure you launch atom from terminal or iterm2 instead of Dock/Finder/Spotlight/open.

joefitzgerald added a commit to joefitzgerald/go-config that referenced this issue Dec 5, 2015
@watzon
Copy link

watzon commented Jan 29, 2016

+1 on this. I am able to set my GOPATH manually in the settings, but I keep getting the following warning: Warning: File [/home/chris/Documents/projects/personal/go/printf.go] does not reside within a "src" directory in your GOPATH [/home/chris/.gvm/pkgsets/go1.6rc1/global] - please review http://golang.org/doc/code.html#Workspaces

@mbbroberg
Copy link

I had trouble at first and then relaunched from terminal with no problem. Using gvm w/go1.5.3. Thanks @joefitzgerald!

@mishak87
Copy link

@iDev0urer workspaces are experimental feature in Go 1.5 in 1.6 they will be enabled.
Some tool you are using is setting export GO15VENDOREXPERIMENT=1.
https://tip.golang.org/doc/go1.6#go_command
Always work on one Go project in Atom and always launch atom from that projects directory to avoid issues.

@zmb3
Copy link
Collaborator

zmb3 commented Oct 7, 2018

Closing this due to age.

@zmb3 zmb3 closed this as completed Oct 7, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

8 participants