feat(ruby)!: rewrite to use ruby-build with optional rbenv/rvm (v2.0.0)#1654
Open
rhiroe wants to merge 1 commit into
Open
feat(ruby)!: rewrite to use ruby-build with optional rbenv/rvm (v2.0.0)#1654rhiroe wants to merge 1 commit into
rhiroe wants to merge 1 commit into
Conversation
3be3751 to
6341f66
Compare
6341f66 to
95270c2
Compare
Replace the rvm-only install with ruby-build under /usr/local/rubies,
exposed via the 'current' symlink on the PATH. Add a versionManager
option ("none" | "rbenv" | "rvm") that installs the chosen manager
and delegates 'install' to it.
Detect build deps across apt, dnf/yum, apk, zypper, and pacman.
Replace ruby_fallback_test with ruby_rbenv / ruby_rvm scenarios.
95270c2 to
0ed4087
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR is a continuation of #764 (now closed), which itself was opened in response to #757 and #603. It rewrites the Ruby Feature on top of ruby-build and bumps the version to 2.0.0.
Problems with the current v1 implementation
1. RVM's
stablechannel does not support recent Ruby versionsRVM's
stablebranch lags behind the upstream Ruby release cycle. As a result, users who need a recent Ruby version (e.g. 3.3.x or later) often cannot install it through the current Feature without workarounds.2. Both RVM and rbenv are installed unconditionally
The current Feature installs both RVM and rbenv regardless of what the user actually needs. This causes conflicts — in particular, rbenv is effectively unusable when RVM is present because
GEM_HOME,GEM_PATH, andMY_RUBY_HOMEare all hard-coded to RVM paths incontainerEnv. Any version manager the user adds on top will be broken by those static environment variables.3. A version manager is not always necessary
For the common case where a project targets a single, fixed Ruby version, there is no need for a version manager at all. Installing RVM by default adds unnecessary complexity, startup overhead, and a frequent source of user confusion.
What this PR does
/usr/local/rubies/<version>/and exposed via a/usr/local/rubies/currentsymlink on thePATH.GEM_HOME,GEM_PATH, andMY_RUBY_HOMEfromcontainerEnv. These variables interfere with any version manager or gem tooling the user may add. RubyGems' own dynamic defaults work correctly when these are left unset.versionManageroption (none/rbenv/rvm, defaultnone). Users who need a version manager can opt in explicitly. Whenrbenvorrvmis selected, ruby-build is wired in as its build back-end.apt) to also cover RHEL/Fedora (dnf/yum), Alpine (apk), openSUSE (zypper), and Arch (pacman).rubygroup owning/usr/local/rubies/so the non-root container user can rungem installwithoutsudo.rbenvandrvmpaths, and removes the now-unnecessaryruby_fallback_test.Relationship to previous work
This PR picks up directly from #764. The approach here aligns with the consensus reached in #757: ruby-build as the default, version managers as opt-in, and no static
GEM_HOME/GEM_PATH.Breaking changes
GEM_HOME,GEM_PATH, andMY_RUBY_HOMEare no longer set by the Feature. Projects that relied on these values being set to RVM paths will need to update their configuration."versionManager": "rvm"to restore the previous behaviour.