Cannot install TruffleRuby
I was following the instructions at https://www.graalvm.org/latest/reference-manual/ruby/ which refer to asdf, hoping that I could just use mise as a drop-in replacement and run
mise install ruby truffleruby-dev
but that gets me
0.190 [DEBUG] ARGS: mise install ruby truffleruby-dev
0.190 [DEBUG] Config {
0.190 Config Files: [],
0.190 }
0.190 [DEBUG] Toolset:
0.199 [DEBUG] GET http://mise-versions.jdx.dev/ruby
0.199 [DEBUG] starting new connection: http://mise-versions.jdx.dev/
0.384 [DEBUG] GET http://mise-versions.jdx.dev/ruby 200 OK
0.389 Error:
0.389 0: No repository found for plugin truffleruby-dev
0.389
0.389 Location:
0.389 src/plugins/external_plugin.rs:103
0.389
0.389 Version:
0.389 2024.2.19 linux-x64 (fd83356 2024-02-28)
0.389
0.389 Suggestion: Run with --verbose or MISE_VERBOSE=1 for more information.
0.389
0.389 Backtrace omitted. Run with RUST_BACKTRACE=1 environment variable to display it.
0.389 Run with RUST_BACKTRACE=full to include source snippets.
Maybe this is related to the more general https://github.com/jdx/mise/issues/1286, but as it's working with asdf I thought I'd file this separately.
Currently this works, but is not optimal:
mise install ruby@truffleruby+graalvm-23.1.2
Important to note is that regular asdf syntax that would facilitate installing the latest truffleruby is not seemingly clear or viable and maybe related to this: https://github.com/asdf-vm/asdf-ruby/issues/387#issuecomment-2012246380
It should be possible to do this in mise, or via some kind of similar permutation:
mise install ruby@latest:truffleruby
Perhaps defining asdf as being used would be more helpful?
mise install asdf:ruby@latest:truffleruby
I suppose the order of latest:truffleruby could also be flipped or something similar if you feel it would also be more appropriate.
The point is though, simply, it would make things better/easier to track rubies if we could facilitate more robust options to be inclusive of the different rubies.
It is entirely possible that I simply do not understand or am not seeing the proper path forward with existing syntax as well. Perhaps @jdx can chime in on the situation...
With #1854 fixed, truffleruby is now also shown by the core plugin with mise ls-remote ruby. The version semantics follows practices used in asdf (for compatabilty) and can be found for other tools such as Java, Python etc.
Can something like this be done yet?:
mise install truffleruby+graalvm@latest
@ylluminate Not with the core plugin and we do not intend to add support for vendor version syntax. Something like this could be achieved by implementing your own asdf plugin which only lists and installs truffleruby tough.
I think some support was put into the codebase recently that allows each core plugin to do its own resolving logic making it possible to support things like ruby@truffleruby+graalvm-24 which wouldn't require globally modifying the resolver for all core plugins
@jdx How i understand this, the requirement would be to have truffelruby+graalvm or truffelruby as a tool name which would be possible with a custom asdf plugin. Hashicorp is doing something in this direction, providing a single plugin for all its tools where the plugin name defines what tool it deals with (see https://github.com/asdf-community/asdf-hashicorp?tab=readme-ov-file#installation).
@ylluminate might be asking for that but I don't think he actually has any need for that. I think the more important gap in mise is that you can't run mise install ruby@truffleruby+graalvm-24 but have to specify mise install ruby@truffleruby+graalvm-24.0.2 because the resolver can't figure out how to make truffleruby+graalvm-24 point to truffleruby+graalvm-24.0.2—but that issue could be fixed by overriding these functions:
https://github.com/jdx/mise/blob/d161afe843694020f22fc981537f81e5ea7f2896/src/backend/mod.rs#L275-L282
I have laid some groundwork for this but I think a tiny bit more refactoring would be needed in order to share the fuzzy_match_filter function which I think would need to be called in ruby.rs.
I see, i remember having dealt with fuzzy matching in context of Java (which also has vendor prefixes) but decided to copy the fuzzy_match_filter function instead of exposing/sharing it.
yeah we should probably put fuzzy_match_filter on the trait so we don't need to do that
I might find some time later today to have a look at this. I have the feeling that the code from Java can be used since they share the same vendor version semantics.
With the fixes in PR #2581, mise i ruby@truffelruby+graalvm will install the latest version, likewise will mise i ruby@truffelruby-24 install the latest 24.x version.