Skip to content
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

Drop support for Ruby 2.2 and 2.3 #6945

Closed
bbatsov opened this issue Apr 17, 2019 · 15 comments · Fixed by #7026
Closed

Drop support for Ruby 2.2 and 2.3 #6945

bbatsov opened this issue Apr 17, 2019 · 15 comments · Fixed by #7026

Comments

@bbatsov
Copy link
Collaborator

bbatsov commented Apr 17, 2019

Both of them reached their EOL already and according to our official support policy we don't need to support them anymore.

I don't have a strong take on this, but I'd rather remove them mostly to speed up the test suite. The final decision will also depend on how widely 2.2 and 2.3 are still used in the wild, of course. @rubocop-hq/rubocop-core Any thoughts on this?

@Darhazer
Copy link
Member

Darhazer commented Apr 17, 2019

I would vote for dropping 2.2. The same discussion applies as with dropping support for 2.1 - dropping from the runtime but preserving the parsing support.
2.3 got its EOL recently and we may give users some more time to switch. Let's drop just 1 version at a time.

According to JetBrains stats, 2.2 was used by 20% of developers in 2017 and only 8% in 2018. 2.3 dropped from 58% to 23%. 20% is still a high number.

P.S. besides speeding up tests, our codebase could use some 2.3 features ;)

@bbatsov
Copy link
Collaborator Author

bbatsov commented Apr 17, 2019

Hmm, that's interesting. Even 8% seems like a lot to me, but I guess we can drop 2.2 if no one objects strongly to this.

@pirj
Copy link
Member

pirj commented Apr 17, 2019

I'd be interested in seeing the statistics of Ruby version used for the latest RuboCop gem versions.

This might give a better insight into how many people will get upset that they are unable to update RuboCop without updating the Ruby version.

In the case when the users of newer versions of RuboCop mostly also prefer newer Ruby versions, I don't see a good reason not to drop support for both 2.2 and 2.3.

Unfortunately, RubyGems does not keep track of per-version downloads.
Even with this, it would be possible to infer the used corresponding Ruby version.

What can be measured though is the number of downloads per version of RuboCop gem. It wouldn't mean, of course, that the users of older RuboCop versions are the users of older Ruby versions, but it may be quite likely to be so.

RuboCop version / downloads 04.17 04.18 04.24 (downloads for last week)
0.67.2 140728 158731 +73411
0.67.1 16470 16751 +1133
0.67.0 2296 2323 +148
0.66.0 350092 357044 +25066
0.65.0 740399 746808 +23917
0.64.0 458107 462934 +45369
0.63.1 674662 680518 +22125
0.63.0 127228 127749 +1835
0.62.0 413987 416963 +8859
0.61.1 602118 605167 +8856
0.61.0 31724 31752 +214
0.60.0 1248781 1252865 +14559
0.59.2 1328397 1331506 +11745
0.59.1 497177 498058 +3040
0.59.0 463760 465829 +7911
0.58.2 0 2152341 +25442
0.58.1 0 525069 +2254
0.57.2 0 962645 +7537
0.56.0 0 815697 +4090
0.55.0 0 1513707 +5767
0.54.0 0 1711856 +29335
0.53.0 0 708129 +5145
0.52.1 0 3093944 +17874
0.52.0 0 758656 +1368
0.51.0 0 2144453 +9906
0.50.0 0 1616438 +4778
0.49.1 5739695 5747499 +29955
0.48.1 0 1807640 +5635
0.47.1 0 2757530 +5735
0.46.0 1582279 1582640 +1482
0.45.0 836511 836617 +616
0.44.1 392734 392834 +328
0.43.0 787059 787180 +797
0.42.0 1475544 1476318 +3490
0.41.2 0 784554 +1294
0.40.0 0 1303496 +1450

Basing on the early adopter growing rate, and the download trends for older versions we could make a better decision on this.

@luke-hill
Copy link

Kind of an obvious point, but the users who are using old rubies (Perhaps for a legacy app or two out of 10-15 apps at a company), are likely to also have old outdated code. And as such, are unlikely to want to run things like rubocop on it that often.

Also given rubocop's popularity as a highly used gem, making it as optimal as possible whilst catering to a large proportion of the userbase I would say is a key point (Yes 8% is large, but 92% is larger..)

@bbatsov
Copy link
Collaborator Author

bbatsov commented Apr 18, 2019

Well, let's drop 2.2 and see how things go. I don't really expect much of a fallout from this.

@koic
Copy link
Member

koic commented Apr 18, 2019

Ruby is new released on every year, and old version becomes EOL around March.
AFAIK, When RuboCop dropped support for Ruby 2.0 and Ruby 2.1, it was about a year after EOL.

I think it is a good time to drop Ruby 2.2 by convention since Ruby 2.3 became EOL.
IMO, It would be good to support Ruby 2.3.

@Drenmi
Copy link
Collaborator

Drenmi commented Apr 22, 2019

I've always been a proponent of not supporting old versions. It is really a disservice to enable teams to stay on outdated and unsupported versions. Having popular libraries nudge people along will benefit everyone in the end. Rails does a great job of this (Rails 6 requires Ruby 2.5 or higher.)

@pirj
Copy link
Member

pirj commented Apr 22, 2019

Please don't get me wrong, I'm all for dropping support for EOL versions. However, some libraries, e.g. RSpec, do support Ruby 1.8.7 onwards.

@pirj
Copy link
Member

pirj commented Apr 24, 2019

Diversity across used RuboCop versions being in use is noticeable.

Version Downloads per week
0.67.2 73411
0.66.0 25066
0.64.0 45369
0.58.2 25442+
0.54.0 29335+
0.49.1 29955

@koic
Copy link
Member

koic commented May 8, 2019

Well, let's drop 2.2 and see how things go. I don't really expect much of a fallout from this.

Sure. I opened a PR #7026.

koic added a commit to koic/rubocop that referenced this issue May 8, 2019
Fixes rubocop#6945.

By convention, a year after Ruby became an EOL, it seems that the old
Ruby version support has been dropped. I'm not sure if it's good to drop
Ruby 2.3 support, but it's good time to drop Ruby 2.2 support.
bbatsov pushed a commit that referenced this issue May 8, 2019
Fixes #6945.

By convention, a year after Ruby became an EOL, it seems that the old
Ruby version support has been dropped. I'm not sure if it's good to drop
Ruby 2.3 support, but it's good time to drop Ruby 2.2 support.
kennyadsl added a commit to nebulab/solidus that referenced this issue Sep 19, 2019
Ruby 2.2 and 2.3 support has ended [1], Rubocop support for 2.2 ended
and dropping 2.3 as well is close [2].

We also already introduced code that is no more compliant with 2.2.

[1]: https://www.ruby-lang.org/en/news/2019/03/31/support-of-ruby-2-3-has-ended/
[2]: rubocop/rubocop#6945
@Eneroth3
Copy link

Eneroth3 commented Nov 25, 2019

I may be late to the party (or too early to a drop support for Ruby 2.4 issue that hasn't yet been created). However I have some general thoughts on dropping Ruby support.

Ruby is used for the live API in SketchUp, meaning quite a few people are relying on old Ruby versions. It's not like a rails server where an admin is responsible for keeping things up to date, but up to a sometimes not very tech-savvy end user to update, which includes buying new SketchUp licenses. Also the free version (for non-commercial use) was dropped in 2017 meaning many hobbyists are stuck there, on Ruby 2.2.4.

While it's possible to manually exclude Style/SafeNavigation and other cops related to newer Ruby features, along with writing a comment as of why you do it, it would be more straight forward for SketchUp extension developers to just directly target the older Ruby version. If it's not too much problem it would be nice if Rubocop could keep support a bit longer than the official life cycle.

Edit: According to the numbers I have over a quarter of SketchUp desktop users are on SketchUp 2017 (Ruby 2.2.4), a fifth in SketchUp 2018 (also Ruby 2.2.4) and a fifth on SketchUp 2019 (Ruby 2.5.5). These number are from April 2018 so the user base has likely shifted a bit, but it still shows how old Ruby versions linger in SketchUp.

@luke-hill
Copy link

@Eneroth3 - You can still use rubocop with ruby 2.2, 2.1 or even lower if you want (Just an older pinned version). What this is saying is going forward to only target newer users of Ruby (or new-ish), with the rubocop restrictions.

@Eneroth3
Copy link

@luke-hill I don't really follow. I (as a developer) can update my standalone Ruby interpreter to the newest version at any time. However my users are often stuck in Ruby 2.2, and thus my ruby code needs to be compatible with it.

In my case we are not talking about server admins but woodworkers, carpenters, architects etc that would have to pay for a new SketchUp version to update their Ruby interpreter.

@bbatsov
Copy link
Collaborator Author

bbatsov commented Nov 26, 2019

That's what TargetRubyVersion is for. RuboCop can't run on Ruby 2.2, but it can make sure that a codebase is compatible with Ruby 2.2 using that setting.

@Eneroth3
Copy link

Oh, my bad. I thought this discussion as about dropping Ruby 2.2 support in TargetRubyVersion. I'm currently running Rubocop 0.75.0, which doesn't support anything under Ruby 2.3 as TargetRubyVersion.

koic added a commit to koic/rubocop that referenced this issue Apr 12, 2020
### Summary

This PR drops support for Ruby 2.3.

It is discussed in rubocop#6945.
And this suggestion would mean that RuboCop 1.0 (and pre-release)
requires Ruby 2.4 or higher.

The following is a plan after this PR.
There was a build error report for a dependent jaro_winkler gem.
rubocop#5989, rubocop#6754, rubocop#7447, and rubocop#7564. And rubocop#7673 was trying to solve it.

After dropping Ruby 2.3, replace jaro_winkler with did_you_mean.
did_you_mean is written in Ruby, so the build error due to native
extensions no longer occur. That change opens as anther PR.

### Other Information

The latest did_you_mean (1.4.0) supports Ruby 2.5 or higher,
so it needs to be confirmed old versions it works with Ruby 2.4.
@koic koic mentioned this issue Apr 12, 2020
8 tasks
bbatsov pushed a commit that referenced this issue Apr 12, 2020
### Summary

This PR drops support for Ruby 2.3.

It is discussed in #6945.
And this suggestion would mean that RuboCop 1.0 (and pre-release)
requires Ruby 2.4 or higher.

The following is a plan after this PR.
There was a build error report for a dependent jaro_winkler gem.
#5989, #6754, #7447, and #7564. And #7673 was trying to solve it.

After dropping Ruby 2.3, replace jaro_winkler with did_you_mean.
did_you_mean is written in Ruby, so the build error due to native
extensions no longer occur. That change opens as anther PR.

### Other Information

The latest did_you_mean (1.4.0) supports Ruby 2.5 or higher,
so it needs to be confirmed old versions it works with Ruby 2.4.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants