Open adamaig opened 6 years ago
I was able to address the build time issues by caching the ~/.asdf directory across builds, but I'm still curious if there is any intent to change the installation process for this plugin.
We now use ruby-build for builds, so if ruby-build supports prebuilt packages so can asdf-ruby. Now if ruby-build doesn't, that doesn't mean we can't do in asdf-ruby, but we will have to write our own code to determine what type of installation to perform. I'm open to anything here, but I don't install Ruby often enough for me to need this myself. Contributions welcome!
I was just about to ask the same thing. Might I add that if a tool has "-build" in its name it probably isn't thinking about precompiled anything. Is it possible to revisit this choice? What would be an alternative to ruby-build? A quick 2-second google search has lead me to https://github.com/phusion/traveling-ruby. From a quick glance it looks like it could be an interesting candidate.
Seems I spoke too soon. It appears that particular project only bundles a single version of ruby, and a quite old one at that. I guess another alternative would be to use ruby-build but host the built artifacts somewhere (although I realize that this is probably very hard because of dynamic linking)
@moljac024 open to suggestions. Right now we don't have a way to host our own builds, but if someone is already hosting builds somewhere asdf-ruby could be extended to use them.
Maybe this page helps: http://rubies.travis-ci.org/
It might be possible to build on what's been done in https://github.com/ruby/setup-ruby. Their prebuilt rubies are made using ruby-build and hosted as GitHub releases, though they make several assumptions about the environment to keep the install very fast (openssl, libyaml, etc must match what's installed on GitHub Actions runners). I'm not sure how we'd deal with shared libraries. Maybe a static build is an option, but that would complicate upgrades for openssl security fixes for example.
The hosted CI providers seem to be gradually solving this problem, but it's still very slow to install new ruby versions on development machines. For context, I maintain a CI workflow that periodically runs the "new engineer" setup scripts to make sure that our Rails app can be installed and booted up on a new Mac. Installing ruby with asdf is one of the bigger time sinks (~3m) in that process even if we link against a homebrew-installed openssl.
EDIT (5/31/2024): Another related project is homebrew-portable-ruby. They currently have releases for macOS ARM and Linux x86_64, which likely overlaps well with users of this plugin.
Note: I've written this with the goal of tasking myself with implementing it myself, and just want to gather early opinions and feedback before committing the time.
I've been looking at Fullstaq Ruby and noticed #76 where it asks about ASDF supporting their project. Because this Ruby plugin is coupled so heavily to
ruby-build
, the creator of Fullstaq doesn't anticipate being able to do this integration without modifying the plugin, first.All that needs to happen is for the plugin to be able to recognize when a precompiled binary needs fetched. It could be through pattern-matching the string, or through something more sophisticated, perhaps inspired by the Golang plugin. Thoughts?
-- @jwarner112 on https://github.com/asdf-vm/asdf-ruby/issues/275
Some of the other asdf plugins seem to install prebuilt packages if they exist (nodejs, golang), and I'm wondering there is the intent to do this for ruby (similar to rvm's installation). The primary reason I'm asking is that using asdf on travis-ci is extending our build times by ~3.5 minutes due to the compilation.