-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix ruby 3 installation+compilation with rubygems v3.2.3+ #5030
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
Conversation
scripts/functions/gemset
Outdated
| run_gem_wrappers() | ||
| { | ||
| gem_install gem-wrappers >/dev/null && | ||
| gem pristine gem-wrappers --only-plugins >/dev/null && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should only do this if gem wrappers >/dev/null fails first, right? Otherwise it will do the pristine when it's already pristine. This command is run more than once, so we don't want to do gem pristine if we don't have to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This comment still applies. It might not be an issue if rerunning gem pristine is faster than running gem wrappers first to see if it works.
|
@pedrofurtado is this ready for review? |
scripts/functions/gemset
Outdated
| { | ||
| gem_install gem-wrappers >/dev/null && | ||
| gem pristine gem-wrappers > /dev/null && | ||
| ([ "$(printf '%s\n' "3.2.3" "$(gem -v)" | sort -V | head -n1)" == "3.2.3" ] && gem pristine gem-wrappers --only-plugins > /dev/null || exit 0) && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're going by rubygems version, maybe "3.2.0" would be a better choice. It looks like that's when the relevant change happened (3.2.0.rc1, but still, 3.2.0 would be fine).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@BrianHawley Great suggestion! The only-plugins option is available since 3.2.0 π
https://github.com/rubygems/rubygems/blob/v3.2.0/lib/rubygems/commands/pristine_command.rb#L42-L45
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In rubygems < 3.2.0 (embedded in rubies 2.x), the options only-plugins does not exists and not need "regenerate and pristine" the wrappers. But, in ruby 3 (that embeds inside itself a rubygems >= 3.2.0), it is needed regenerate because of some internal changes in rubygems (more info in ruby/rubygems#4204), and also needs a condition in shells of rvm codebase. Now it is done! π
|
@BrianHawley @pkuczynski Sorry for delay, guys! Now it is reviewable π It works both with ruby 3.x and 2.x π― % |
|
Looks to me like this will work. I defer to the judgement of @pkuczynski as to whether this matches the rvm coding practices, or if there would be a better strategy that could be suggested. I also don't know how to evaluate the test failures. |
|
@pkuczynski @mpapis Ready for review π π€ |
Co-authored-by: Michal Papis <[email protected]>
|
@mpapis The new code is working like a charm with rubies 3.x and 2.x π₯ |
|
Thank you! |
Fixes #5025 . Thanks for reporting, @BrianHawley! π€
I believe that is the last part of a series of fixes (#5029, #5027) in rvm codebase, to allow ruby v3 + rubygems v3.2.3 inside it without errors.
Steps for testing: