Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@pedrofurtado
Copy link
Member

@pedrofurtado pedrofurtado commented Jan 11, 2021

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:

$ curl -ksSL https://get.rvm.io | bash -s -- --branch issue-5025
$ source /etc/profile.d/rvm.sh
$ rvm install 3.0.0

$ ruby -v
$ rvm -v

and also for ruby 2.x ...

$ rvm install 2.7.2
$ rvm install 2.5.1

and so on ...

πŸŽ‰ πŸŽ‰ 

run_gem_wrappers()
{
gem_install gem-wrappers >/dev/null &&
gem pristine gem-wrappers --only-plugins >/dev/null &&
Copy link
Contributor

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.

Copy link
Contributor

@BrianHawley BrianHawley Jan 11, 2021

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.

@pkuczynski
Copy link
Member

@pedrofurtado is this ready for review?

{
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) &&
Copy link
Contributor

@BrianHawley BrianHawley Jan 11, 2021

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).

Copy link
Member Author

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

Copy link
Member Author

@pedrofurtado pedrofurtado Jan 12, 2021

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! 🏁

@pedrofurtado
Copy link
Member Author

@BrianHawley @pkuczynski Sorry for delay, guys! Now it is reviewable πŸ‘ It works both with ruby 3.x and 2.x πŸ’― %

@pedrofurtado pedrofurtado added this to the rvm-1.29.12 milestone Jan 12, 2021
@BrianHawley
Copy link
Contributor

BrianHawley commented Jan 12, 2021

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.

@pedrofurtado
Copy link
Member Author

@pkuczynski @mpapis Ready for review πŸŽ‰ 🀝

@pedrofurtado
Copy link
Member Author

@mpapis The new code is working like a charm with rubies 3.x and 2.x πŸ₯‡

@pkuczynski pkuczynski merged commit 27c4713 into master Jan 13, 2021
@delete-merged-branch delete-merged-branch bot deleted the issue-5025 branch January 13, 2021 11:36
@pkuczynski
Copy link
Member

Thank you!

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error building ruby-3.0.0 on macOS Catalina

5 participants