-
Notifications
You must be signed in to change notification settings - Fork 248
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
Q: Do we want shims to automatically execute older binaries after finding them? #249
Comments
Unsure I understand the ask here. Are you saying you want to stay on an older patch version of a particular release? For example, if go 1.15.2 was used, dont use 1.15.15? |
@ChronosMasterOfAllTime When we execute
Do we want to modify the shim code such that, instead of acting like This new behavior might be enabled by a feature flag -- I'm suggesting GOENV_RUNOLD above, but am open to other env variable names. |
In the case of
Perhaps some of these schemes are relevant to |
I hope this question hasn't come up before: The closest I can find is the discussion in #30.
Right now, goenv follows the pyenv precedent of saying this:
https://github.com/syndbg/goenv/blob/ece1aba5651a73c891d2beb75d37ea35d1c5fb2a/libexec/goenv-which#L94
That behavior -- not running executables associated with older versions -- makes sense for an interpreted language in which libraries need to match executables at runtime. But one of the whole points of migrating from e.g. Python to Go is to get away from that constraint. By carrying forward that behavior from pyenv we are causing ourselves more work than we need to. Each time we use goenv to upgrade to a new Go version, we either manually update PATH to include older versions of GO binaries, or we run
go install
for everything we already had installed.We should be able to simply let the shims run the old binaries instead.
In my own case, I finally wrote a little bash script that walks through all of the older go/*/bin directories in semver order and creates symlinks in a go/basket/bin, which I then put in PATH. That works great except when I want to use goenv to set my local or shell Go version to an earlier version of binaries, in which case I manually edit PATH anyway to remove go/bin/basket. But that means I lose not only the newer binaries but the older binaries as well -- it's not a great solution.
Which of the following options makes more sense?
I'm leaning toward submitting a PR for (2) -- any strong opinions, and is there anything I'm missing?
The text was updated successfully, but these errors were encountered: