Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 779562 - dev-lang/ruby-2.6.6-r3 removal of json breaks activesupport as used by redmine
Summary: dev-lang/ruby-2.6.6-r3 removal of json breaks activesupport as used by redmine
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Ruby Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-31 17:35 UTC by Hank Leininger
Modified: 2021-06-26 05:30 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Hank Leininger 2021-03-31 17:35:43 UTC
A recent dev-lang/ruby ebuild change breaks activesupport here.

Commit https://github.com/gentoo/gentoo/commit/2e225cca1aa95b8a5e54cbd855f17dbaf88940d9 does some additional cleanups in new dev-lang/ruby ebuilds:

$ diff -u ruby-2.6.6-r2.ebuild ruby-2.6.6-r3.ebuild
...
-       rm -rf ext/json || die
+       einfo "Removing default gems before installation"
+       rm -rf .ext/common/json.rb .ext/common/json ext/json || die

With ruby-2.6.6-r3 installed, redmine fails to start because activesupport fails to initialize. Using:

dev-lang/ruby-2.6.6-r3
dev-ruby/json-2.5.1-r1
dev-ruby/activesupport-5.2.4.5
www-apps/redmine-4.1.2 [*]

When the app attempts to launch:

App 27192 output: Error: The application encountered the following error: cannot load such file -- json (LoadError)
App 27192 output:     /usr/lib64/ruby/gems/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/core_ext/object/js
on.rb:4:in `require'
App 27192 output:     /usr/lib64/ruby/gems/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/core_ext/object/js
on.rb:4:in `<top (required)>'
App 27192 output:     /usr/lib64/ruby/gems/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/core_ext/object.rb
:13:in `require'
App 27192 output:     /usr/lib64/ruby/gems/2.6.0/gems/activesupport-5.2.4.5/lib/active_support/core_ext/object.rb
:13:in `<top (required)>'
App 27192 output:     /usr/lib64/ruby/gems/2.6.0/gems/railties-5.2.4.5/lib/rails/configuration.rb:4:in `require'
...


active_support/core_ext/object/json.rb has a cryptic (to me, because I cannot spell ruby) comment right before the require that is failing:

# Hack to load json gem first so we can overwrite its to_json.
require "json"


If I downgrade from dev-lang/ruby-2.6.6-r3 to dev-lang/ruby-2.6.6-r2, that problem goes away, and activesupport can load fine.

I don't know if this is dev-lang/ruby now doing the wrong thing, or if dev-ruby/json needs some kind of change, or if this is an upstream bug in activesupport.


[*] I'm testing the redmine PR here: https://github.com/gentoo/gentoo/pull/20145 , but this happens in the guts of activesupport so I don't think that matters.
Comment 1 Hank Leininger 2021-05-27 17:05:09 UTC
The same problem occurs with dev-lang/ruby-2.6.7 + dev-ruby/activesupport-5.2.6 + redmine-4.1.2

Same fix to ruby-2.6.7.ebuild:

        einfo "Removing default gems before installation"
-       rm -rf .ext/common/json.rb .ext/common/json ext/json || die
+       rm -rf ext/json || die
Comment 2 Larry the Git Cow gentoo-dev 2021-06-26 05:30:58 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=67482a86f40f3535dd48fb108827a6b88171af8e

commit 67482a86f40f3535dd48fb108827a6b88171af8e
Author:     Hans de Graaff <graaff@gentoo.org>
AuthorDate: 2021-06-26 05:30:47 +0000
Commit:     Hans de Graaff <graaff@gentoo.org>
CommitDate: 2021-06-26 05:30:47 +0000

    dev-lang/ruby: revert unbundling json
    
    In 2e225cca1aa95b8a5e54cbd855f17dbaf88940d9 all gem dependencies got
    fully unbundled, fixing some issues with duplicate definitions of code
    and our policy of unbundling as much code as possible.
    
    Too much code still depends on json being present in the core ruby
    library, though, leading to compatibility problems. This change does not
    just revert the removal of the json code, but leaves all json code
    present. This should help with avoiding the duplicate definitions that
    were the initial trigger for these changes.
    
    Closes: https://bugs.gentoo.org/779562
    Package-Manager: Portage-3.0.20, Repoman-3.0.2
    Signed-off-by: Hans de Graaff <graaff@gentoo.org>

 dev-lang/ruby/ruby-2.6.7-r2.ebuild | 258 +++++++++++++++++++++++++++++++++++
 dev-lang/ruby/ruby-2.7.3-r5.ebuild | 266 +++++++++++++++++++++++++++++++++++++
 dev-lang/ruby/ruby-3.0.1-r2.ebuild | 263 ++++++++++++++++++++++++++++++++++++
 3 files changed, 787 insertions(+)