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

Support using "latest" version of a program (asdf {global,local,shell} <plugin> latest) #801

Closed
joschi opened this issue Sep 11, 2020 · 5 comments · Fixed by #802
Closed

Comments

@joschi
Copy link
Contributor

joschi commented Sep 11, 2020

asdf kind of knows what version latest is describing and allows installing the latest version of a program with asdf install <plugin> latest, but setting the latest version of a program in the shell, in a directory, or globally requires specifying the exact version.

Example:

# asdf install jbang latest
# jbang version
No version set for command jbang
Consider adding one of the following versions in your config file at /Users/joschi/.tool-versions
jbang 0.45.0
# asdf shell jbang latest
version latest is not installed for jbang

Describe the solution you'd like

It would be great if asdf {global,local,shell} <plugin> <version> supported latest as version.

# asdf install jbang latest
# asdf shell jbang latest
# jbang version
0.45.0

Ideally the version ending up in .tool-versions would be the resolved latest version of the program, e. g. jbang 0.45.0 in the example above.

asdf already supports this with asdf latest <plugin>.

@jthegedus
Copy link
Contributor

Currently latest is resolved by asdf, though the implementation should defer to the plugin to determine what "latest" means for that plugin's ecosystem, see #763

latest in the .tool-versions file is a bad idea IMO as it removes guarantees asdf provides that each person is on a specific version.

Examples of potential problems with this feature:

  • If I have no network access, asdf is unable to perform asdf list all <tool> to determine latest, what happens in this case?
  • If I have an older version of the plugin itself to my colleagues, then latest may resolve to a different provider leading to erroneous behaviour (EG: Python or Java plugins added a new provider which the project uses but I cannot see this).

I'm sure there are more scenarios like this.

Requiring specific versions, while strict, removes a class of issues and is the intended goal of asdf to manage a projects tools' versions.

@joschi
Copy link
Contributor Author

joschi commented Sep 12, 2020

latest in the .tool-versions file is a bad idea IMO as it removes guarantees asdf provides that each person is on a specific version.

That's what I meant with "Ideally the version ending up in .tool-versions would be the resolved latest version of the program". 😃

@jthegedus
Copy link
Contributor

Sorry, I didn't understand that to be what you meant. If it worked that way, then it doesn't have any issues I can think of off the top of my head 👍

@aaronmallen
Copy link

aaronmallen commented Sep 17, 2020

I would also be fine with doing asdf <global|shell|local> <plugin> latest and having it resolve latest version and put that version number in the .tool-versions file.

For example:

$ asdf latest ruby
ruby 2.7.1
$ asdf local ruby latest
# .tool-versions
ruby 2.7.1

@joschi
Copy link
Contributor Author

joschi commented Sep 18, 2020

I would also be fine with doing asdf <global|shell|local> <plugin> latest and having it resolve latest version and put that version number in the .tool-versions file.

That's what the PR #802 is doing. 😊

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

Successfully merging a pull request may close this issue.

3 participants