Skip to content
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

INSTALL.md rehack? #98

Closed
stevegt opened this issue Oct 7, 2019 · 4 comments
Closed

INSTALL.md rehack? #98

stevegt opened this issue Oct 7, 2019 · 4 comments

Comments

@stevegt
Copy link
Contributor

stevegt commented Oct 7, 2019

Can INSTALL.md accept a complete refactoring at this point, or should we keep adding exceptions and notes for e.g. zsh and Ubuntu? I know that the existing INSTALL.md is pretty much a direct port of the one from pyenv; I'm wondering if we're purposely staying with that template, or if we can stray. I ask because I may have another note to add to it...

On Ubuntu (or any other distro that points BASH_ENV at .bashrc), if you follow the instructions in INSTALL.md, it currently tells you to put the goenv init - command in .bash_profile to prevent a loop. This can create a problem though, because if you do that, the goenv init - command isn't run when starting a subshell from editors or IDEs.

I ran into this problem when using vim-go, for instance, because vim-go needs to be able to shell out to run guru etc. When the subshell is started, it doesn't run goenv init -, so GOPATH may not be set right, depending on what else is in your dotfiles.

Here's a general fix: Rather than call goenv init - from .bash_profile as INSTALL.md currently recommends, I instead put this at the bottom of my .bashrc:

if [ -z "$GOENV_INIT_DONE" ]
then
    export GOENV_INIT_DONE=1
    export GOENV_ROOT="$HOME/.goenv"
    export PATH="$GOENV_ROOT/bin:$PATH"
    eval "$(goenv init -)"
    export PATH="$GOROOT/bin:$PATH"
    export PATH="$GOPATH/bin:$PATH"
fi

For me, this fixed the problem I had, and I wonder if this sort of fix would prevent many of the problems others run into. So rephrasing the question above -- should we add this sort of thing as yet another Ubuntu note, in addition to the existing Ubuntu and zsh notes, or should INSTALL.md be reworked completely?

For instance, should we perhaps provide the above code as a script that is sourced from .bashrc, rather than continue with the multiple appends we're doing now?

@syndbg
Copy link
Member

syndbg commented Oct 7, 2019

I started with the template from pyenv but there are no restrictions whatsoever to change it as we see fit.

For instance, should we perhaps provide the above code as a script that is sourced from .bashrc, rather than continue with the multiple appends we're doing now?

.bashrc (.zshrc) append is what I personally use but I hear good stuff about the sourcing of scripts.

Overall it's personal preference at this point.

@gagepost
Copy link

gagepost commented Oct 10, 2019

I made a slight change to the if statement to run on Ubuntu. In my case this worked in my .bashrc, I'm on Ubuntu 18.04 which does not set BASH_ENV.

if [ -z "$GOENV_INIT_DONE" ]
then
    export GOENV_INIT_DONE=1
    export GOENV_ROOT="$HOME/.goenv"
    export PATH="$GOENV_ROOT/bin:$PATH"
    eval "$(goenv init -)"
    export PATH="$GOROOT/bin:$PATH"
    export PATH="$PATH:$GOPATH/bin"
fi

This also fixes #99.

@syndbg
Copy link
Member

syndbg commented Feb 14, 2020

I'll be closing this, since I see no foreseeable work at the moment.

If there's work to be done, feel free to re-open ⛅

@syndbg syndbg closed this as completed Feb 14, 2020
@stevegt
Copy link
Contributor Author

stevegt commented May 4, 2020

Been busy with COVID-related work but have not forgotten about this -- just walked several members of a new remote team through INSTALL.md and wished I'd taken the time to fix it already. ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants