Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 857759 - dev-ruby/rails:5.2 add USE_RUBY=ruby27 support
Summary: dev-ruby/rails:5.2 add USE_RUBY=ruby27 support
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: 852740 852743
  Show dependency tree
 
Reported: 2022-07-12 08:42 UTC by Azamat H. Hackimov
Modified: 2022-07-16 08:11 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
dev-ruby/activemodel-5.2.8 buildlog (dev-ruby:activemodel-5.2.8:20220712-104655.log,61.60 KB, text/plain)
2022-07-12 11:55 UTC, Azamat H. Hackimov
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Azamat H. Hackimov 2022-07-12 08:42:09 UTC
dev-ruby/rails:5.2 required by www-apps/redmine which stuck in ruby26 due unmet dependencies on ruby27 target.

List of packages:

dev-ruby/actioncable/actioncable-5.2.8.ebuild
dev-ruby/actionmailer/actionmailer-5.2.8.ebuild
dev-ruby/actionpack/actionpack-5.2.8.ebuild
dev-ruby/actionview/actionview-5.2.8.ebuild
dev-ruby/activejob/activejob-5.2.8.ebuild
dev-ruby/activemodel/activemodel-5.2.8.ebuild
dev-ruby/activerecord/activerecord-5.2.8.ebuild
dev-ruby/activestorage/activestorage-5.2.8.ebuild
dev-ruby/rails/rails-5.2.8.ebuild
dev-ruby/railties/railties-5.2.8.ebuild
Comment 1 Azamat H. Hackimov 2022-07-12 08:43:27 UTC
Forgot about:

dev-ruby/arel/arel-9.0.0.ebuild
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-12 08:44:39 UTC
graaff and I discussed this and concluded the best way forward just going to redmine 5.

He said he had a bunch of test failures with rails:5.2. I haven't tried it though.

If you could get them passing, could reconsider.
Comment 3 Hans de Graaff gentoo-dev Security 2022-07-12 09:40:34 UTC
(In reply to Sam James from comment #2)
> graaff and I discussed this and concluded the best way forward just going to
> redmine 5.

Yes, that version depends on rails:6.1 so it should be good to go for a while.

> He said he had a bunch of test failures with rails:5.2. I haven't tried it
> though.

Yes, tests are failing (I only tried activemodel), but they are also failing on ruby26 now so this seems more of a generic problem, rather than ruby27-specific. Still needs to be fixed before we can consider adding ruby27 here.

Personally I'm not going to spend time on this, let's move forward (where there is already enough to do) rather than standing still.
Comment 4 Azamat H. Hackimov 2022-07-12 10:01:07 UTC
(In reply to Hans de Graaff from comment #3)

> Yes, tests are failing (I only tried activemodel), but they are also failing
> on ruby26 now so this seems more of a generic problem, rather than
> ruby27-specific. Still needs to be fixed before we can consider adding
> ruby27 here.
> 
> Personally I'm not going to spend time on this, let's move forward (where
> there is already enough to do) rather than standing still.

These test already failed back on ruby25, surprisingly enough why they not fixed back then.

In https://github.com/gentoo/gentoo/pull/26365 I've added fixes for dev-ruby/arel and dev-ruby/activemodel :5.2 :6.0 :6.1 branches.

Other packages runs test fine.
Comment 5 Hans de Graaff gentoo-dev Security 2022-07-12 10:12:35 UTC
(In reply to Azamat H. Hackimov from comment #4)

> These test already failed back on ruby25, surprisingly enough why they not
> fixed back then.

At least for Arel: the BigDecimal issue was deprecated in ruby26 but still worked. Only in ruby27 did the old syntax actually break.

I've updated arel 9.0.0 with your patch. I did not cherry pick that commit since I also wanted to update EAPI and get rid of versionator.

> In https://github.com/gentoo/gentoo/pull/26365 I've added fixes for
> dev-ruby/arel and dev-ruby/activemodel :5.2 :6.0 :6.1 branches.

I don't see a fix for activemodel (only for actionview).
Comment 6 Hans de Graaff gentoo-dev Security 2022-07-12 10:15:00 UTC
Here's an example of the errors I see for activemodel:

  76) validates numericality of for :odd on generated message given if condition
      ArgumentError: mocked method :call expects 3 arguments, got [:title, :odd]
          /var/tmp/portage/dev-ruby/activemodel-5.2.8/work/ruby26/rails-5.2.8/activemodel/lib/active_model/errors.rb:454:in `normalize_message'
          /var/tmp/portage/dev-ruby/activemodel-5.2.8/work/ruby26/rails-5.2.8/activemodel/lib/active_model/errors.rb:298:in `add'
          /var/tmp/portage/dev-ruby/activemodel-5.2.8/work/ruby26/rails-5.2.8/activemodel/lib/active_model/validations/numericality.rb:62:in
Comment 7 Azamat H. Hackimov 2022-07-12 11:55:46 UTC
Created attachment 791246 [details]
dev-ruby/activemodel-5.2.8 buildlog
Comment 8 Azamat H. Hackimov 2022-07-12 11:59:45 UTC
(In reply to Hans de Graaff from comment #6)
> Here's an example of the errors I see for activemodel:
> 
>   76) validates numericality of for :odd on generated message given if
> condition
>       ArgumentError: mocked method :call expects 3 arguments, got [:title,
> :odd]
>          
> /var/tmp/portage/dev-ruby/activemodel-5.2.8/work/ruby26/rails-5.2.8/
> activemodel/lib/active_model/errors.rb:454:in `normalize_message'
>          
> /var/tmp/portage/dev-ruby/activemodel-5.2.8/work/ruby26/rails-5.2.8/
> activemodel/lib/active_model/errors.rb:298:in `add'
>          
> /var/tmp/portage/dev-ruby/activemodel-5.2.8/work/ruby26/rails-5.2.8/
> activemodel/lib/active_model/validations/numericality.rb:62:in

Can you please post full build log? I can't reproduce it on my system. All test for dev-ruby/activemodel on ruby27 runs without fails.

Finished in 0.642573s, 1260.5567 runs/s, 3546.6774 assertions/s.
810 runs, 2279 assertions, 0 failures, 0 errors, 0 skips
>>> Completed testing dev-ruby/activemodel-5.2.8
Comment 9 Hans de Graaff gentoo-dev Security 2022-07-12 20:47:42 UTC
(In reply to Azamat H. Hackimov from comment #8)

> Can you please post full build log? I can't reproduce it on my system. All
> test for dev-ruby/activemodel on ruby27 runs without fails.

It turns out that this is an incompatibility introduced in minitest-5.16. I'll update the minitest dependencies for testing accordingly.

Note that there is a security release of rails so I'll need to do bumps for all slots. I'll try to include ruby27 for rails 5.2 as well.
Comment 10 Azamat H. Hackimov 2022-07-12 21:47:48 UTC
OK, so here's regression https://github.com/minitest/minitest/issues/912.

Seems this commit solves regressions with minitest 5.16 on recent rails: 

https://github.com/rails/rails/pull/45370/commits/9766eb4a833c26c64012230b96dd1157ebb8e8a2

Probably I can backport it to all branches of rails, but seems there more wide issues over other ruby packages and minitest. Maybe worth it to mask minitest 5.16 for a while?
Comment 11 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-07-15 14:34:38 UTC
Update: support got added (see https://github.com/gentoo/gentoo/pull/26365#issuecomment-1182852089) but minitest issue still needs handling.
Comment 12 Hans de Graaff gentoo-dev Security 2022-07-16 08:08:07 UTC
(In reply to Sam James from comment #11)
> Update: support got added (see
> https://github.com/gentoo/gentoo/pull/26365#issuecomment-1182852089) but
> minitest issue still needs handling.

Ah, yes, I forgot to restrict the minitest version in the older slots. This has now been fixed.
Comment 13 Hans de Graaff gentoo-dev Security 2022-07-16 08:10:54 UTC
(In reply to Azamat H. Hackimov from comment #10)
> OK, so here's regression https://github.com/minitest/minitest/issues/912.
> 
> Seems this commit solves regressions with minitest 5.16 on recent rails: 
> 
> https://github.com/rails/rails/pull/45370/commits/
> 9766eb4a833c26c64012230b96dd1157ebb8e8a2
> 
> Probably I can backport it to all branches of rails, but seems there more
> wide issues over other ruby packages and minitest. Maybe worth it to mask
> minitest 5.16 for a while?

I've restricted the minitest version used for testing in affected packages, so there is no need to backport. We'll revisit that restriction when new versions are released.

Reading the minitest upstream bug it looks like this new behaviour is intentional and meant to stay, so I'd rather not mask minitest 5.16.
Comment 14 Larry the Git Cow gentoo-dev 2022-07-16 08:11:08 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8b31a809571ce8c127f0de8443361b6711ab8830

commit 8b31a809571ce8c127f0de8443361b6711ab8830
Author:     Hans de Graaff <graaff@gentoo.org>
AuthorDate: 2022-07-16 08:01:20 +0000
Commit:     Hans de Graaff <graaff@gentoo.org>
CommitDate: 2022-07-16 08:11:03 +0000

    dev-ruby/activesupport: restrict minitest version
    
    Bug: https://bugs.gentoo.org/857759
    Signed-off-by: Hans de Graaff <graaff@gentoo.org>

 dev-ruby/activesupport/activesupport-5.2.8.1.ebuild | 1 +
 dev-ruby/activesupport/activesupport-6.0.5.1.ebuild | 1 +
 dev-ruby/activesupport/activesupport-6.1.6.1.ebuild | 1 +
 3 files changed, 3 insertions(+)