[#98098] [Ruby master Feature#16824] Follow RubyGems naming conventions for the stdlib — shannonskipper@...

Issue #16824 has been reported by shan (Shannon Skipper).

14 messages 2020/05/01

[#98147] [Ruby master Feature#16832] Use #name rather than #inspect to build "uninitialized constant" error messages — jean.boussier@...

Issue #16832 has been reported by byroot (Jean Boussier).

20 messages 2020/05/06

[#98174] [Ruby master Bug#16837] Can we make Ruby 3.0 as fast as Ruby 2.7 with the new assertions? — takashikkbn@...

Issue #16837 has been reported by k0kubun (Takashi Kokubun).

10 messages 2020/05/07

[#98241] [Ruby master Bug#16845] Building Ruby with old existing system Ruby results in make error with ./tool/file2lastrev.rb — erik@...

Issue #16845 has been reported by ErikSwan (Erik Swan).

7 messages 2020/05/09

[#98256] [Ruby master Feature#16847] Cache instruction sequences by default — jean.boussier@...

Issue #16847 has been reported by byroot (Jean Boussier).

16 messages 2020/05/11

[#98257] [Ruby master Feature#16848] Allow callables in $LOAD_PATH — jean.boussier@...

Issue #16848 has been reported by byroot (Jean Boussier).

27 messages 2020/05/11

[#98318] [Ruby master Bug#16853] calling bla(hash, **kw) with a string-based hash passes the strings into **kw (worked < 2.7) — sylvain.joyeux@...4x.org

Issue #16853 has been reported by sylvain.joyeux (Sylvain Joyeux).

12 messages 2020/05/13

[#98355] [Ruby master Bug#16889] TracePoint.enable { ... } also activates the TracePoint for other threads, even outside the block — eregontp@...

Issue #16889 has been reported by Eregon (Benoit Daloze).

16 messages 2020/05/14

[#98363] [Ruby master Feature#16891] Restore Positional Argument to Keyword Conversion — merch-redmine@...

Issue #16891 has been reported by jeremyevans0 (Jeremy Evans).

23 messages 2020/05/14

[#98371] [Ruby master Feature#16894] Integer division for Ruby 3 — andrew@...

Issue #16894 has been reported by ankane (Andrew Kane).

18 messages 2020/05/15

[#98391] [Ruby master Bug#16896] MakeMakefile methods should be private — eregontp@...

Issue #16896 has been reported by Eregon (Benoit Daloze).

10 messages 2020/05/15

[#98396] [Ruby master Feature#16897] Can a Ruby 3.0 compatible general purpose memoizer be written in such a way that it matches Ruby 2 performance? — sam.saffron@...

Issue #16897 has been reported by sam.saffron (Sam Saffron).

25 messages 2020/05/16

[#98453] [Ruby master Bug#16904] rubygems: psych: superclass mismatch for class Mark (TypeError) — jaruga@...

Issue #16904 has been reported by jaruga (Jun Aruga).

18 messages 2020/05/20

[#98486] [Ruby master Bug#16908] Strange behaviour of Hash#shift when used with `default_proc`. — samuel@...

Issue #16908 has been reported by ioquatix (Samuel Williams).

14 messages 2020/05/23

[#98569] [Ruby master Bug#16921] s390x: ramdom test failures for timeout or segmentation fault — jaruga@...

Issue #16921 has been reported by jaruga (Jun Aruga).

9 messages 2020/05/29

[#98599] [Ruby master Bug#16926] Kernel#require does not load a feature twice when $LOAD_PATH has been modified spec fails only on 2.7 — eregontp@...

Issue #16926 has been reported by Eregon (Benoit Daloze).

12 messages 2020/05/31

[ruby-core:98468] [Ruby master Bug#16904] rubygems: psych: superclass mismatch for class Mark (TypeError)

From: v.ondruch@...
Date: 2020-05-21 07:56:52 UTC
List: ruby-core #98468
Issue #16904 has been updated by vo.x (Vit Ondruch).


What is wrong with Ruby?

~~~
$ ruby -v
ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-linux]

$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 3.1.2
  - RUBY VERSION: 2.7.1 (2020-03-31 patchlevel 83) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/2.7.0
  - USER INSTALLATION DIRECTORY: /builddir/.gem/ruby/2.7.0
  - RUBY EXECUTABLE: /usr/local/bin/ruby
  - GIT EXECUTABLE: /usr/bin/git
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - SPEC CACHE DIRECTORY: /builddir/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /usr/local/etc
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/2.7.0
     - /builddir/.gem/ruby/2.7.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /usr/local/bin/
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /usr/local/sbin

$ gem list | grep psych
psych (default: 3.1.0)

$ gem install psych --user-install
Fetching psych-3.1.0.gem
WARNING:  You don't have /builddir/.gem/ruby/2.7.0/bin in your PATH,
	  gem executables will not run.
Building native extensions. This could take a while...
Successfully installed psych-3.1.0
Parsing documentation for psych-3.1.0
Installing ri documentation for psych-3.1.0
Done installing documentation for psych after 0 seconds
1 gem installed

$ $ gem list | grep psych
psych (3.1.0)

$ RUBYOPT="--disable-gems" ruby -r psych -e 'require "rubygems"; Gem.load_yaml'
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych.so: warning: already initialized constant Psych::Parser::ANY
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych.so: warning: already initialized constant Psych::Parser::UTF8
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych.so: warning: already initialized constant Psych::Parser::UTF16LE
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych.so: warning: already initialized constant Psych::Parser::UTF16BE
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/class_loader.rb:7: warning: already initialized constant Psych::ClassLoader::BIG_DECIMAL
/usr/local/lib/ruby/2.7.0/psych/class_loader.rb:7: warning: previous definition of BIG_DECIMAL was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/class_loader.rb:8: warning: already initialized constant Psych::ClassLoader::COMPLEX
/usr/local/lib/ruby/2.7.0/psych/class_loader.rb:8: warning: previous definition of COMPLEX was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/class_loader.rb:9: warning: already initialized constant Psych::ClassLoader::DATE
/usr/local/lib/ruby/2.7.0/psych/class_loader.rb:9: warning: previous definition of DATE was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/class_loader.rb:10: warning: already initialized constant Psych::ClassLoader::DATE_TIME
/usr/local/lib/ruby/2.7.0/psych/class_loader.rb:10: warning: previous definition of DATE_TIME was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/class_loader.rb:11: warning: already initialized constant Psych::ClassLoader::EXCEPTION
/usr/local/lib/ruby/2.7.0/psych/class_loader.rb:11: warning: previous definition of EXCEPTION was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/class_loader.rb:12: warning: already initialized constant Psych::ClassLoader::OBJECT
/usr/local/lib/ruby/2.7.0/psych/class_loader.rb:12: warning: previous definition of OBJECT was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/class_loader.rb:13: warning: already initialized constant Psych::ClassLoader::PSYCH_OMAP
/usr/local/lib/ruby/2.7.0/psych/class_loader.rb:13: warning: previous definition of PSYCH_OMAP was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/class_loader.rb:14: warning: already initialized constant Psych::ClassLoader::PSYCH_SET
/usr/local/lib/ruby/2.7.0/psych/class_loader.rb:14: warning: previous definition of PSYCH_SET was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/class_loader.rb:15: warning: already initialized constant Psych::ClassLoader::RANGE
/usr/local/lib/ruby/2.7.0/psych/class_loader.rb:15: warning: previous definition of RANGE was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/class_loader.rb:16: warning: already initialized constant Psych::ClassLoader::RATIONAL
/usr/local/lib/ruby/2.7.0/psych/class_loader.rb:16: warning: previous definition of RATIONAL was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/class_loader.rb:17: warning: already initialized constant Psych::ClassLoader::REGEXP
/usr/local/lib/ruby/2.7.0/psych/class_loader.rb:17: warning: previous definition of REGEXP was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/class_loader.rb:18: warning: already initialized constant Psych::ClassLoader::STRUCT
/usr/local/lib/ruby/2.7.0/psych/class_loader.rb:18: warning: previous definition of STRUCT was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/class_loader.rb:19: warning: already initialized constant Psych::ClassLoader::SYMBOL
/usr/local/lib/ruby/2.7.0/psych/class_loader.rb:19: warning: previous definition of SYMBOL was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/class_loader.rb:65: warning: already initialized constant Psych::ClassLoader::CACHE
/usr/local/lib/ruby/2.7.0/psych/class_loader.rb:65: warning: previous definition of CACHE was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/scalar_scanner.rb:9: warning: already initialized constant Psych::ScalarScanner::TIME
/usr/local/lib/ruby/2.7.0/psych/scalar_scanner.rb:9: warning: previous definition of TIME was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/scalar_scanner.rb:12: warning: already initialized constant Psych::ScalarScanner::FLOAT
/usr/local/lib/ruby/2.7.0/psych/scalar_scanner.rb:12: warning: previous definition of FLOAT was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/scalar_scanner.rb:17: warning: already initialized constant Psych::ScalarScanner::INTEGER
/usr/local/lib/ruby/2.7.0/psych/scalar_scanner.rb:17: warning: previous definition of INTEGER was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/nodes/stream.rb:13: warning: already initialized constant Psych::Nodes::Stream::ANY
/usr/local/lib/ruby/2.7.0/psych/nodes/stream.rb:13: warning: previous definition of ANY was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/nodes/stream.rb:16: warning: already initialized constant Psych::Nodes::Stream::UTF8
/usr/local/lib/ruby/2.7.0/psych/nodes/stream.rb:16: warning: previous definition of UTF8 was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/nodes/stream.rb:19: warning: already initialized constant Psych::Nodes::Stream::UTF16LE
/usr/local/lib/ruby/2.7.0/psych/nodes/stream.rb:19: warning: previous definition of UTF16LE was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/nodes/stream.rb:22: warning: already initialized constant Psych::Nodes::Stream::UTF16BE
/usr/local/lib/ruby/2.7.0/psych/nodes/stream.rb:22: warning: previous definition of UTF16BE was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/nodes/sequence.rb:43: warning: already initialized constant Psych::Nodes::Sequence::ANY
/usr/local/lib/ruby/2.7.0/psych/nodes/sequence.rb:43: warning: previous definition of ANY was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/nodes/sequence.rb:46: warning: already initialized constant Psych::Nodes::Sequence::BLOCK
/usr/local/lib/ruby/2.7.0/psych/nodes/sequence.rb:46: warning: previous definition of BLOCK was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/nodes/sequence.rb:49: warning: already initialized constant Psych::Nodes::Sequence::FLOW
/usr/local/lib/ruby/2.7.0/psych/nodes/sequence.rb:49: warning: previous definition of FLOW was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/nodes/scalar.rb:10: warning: already initialized constant Psych::Nodes::Scalar::ANY
/usr/local/lib/ruby/2.7.0/psych/nodes/scalar.rb:10: warning: previous definition of ANY was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/nodes/scalar.rb:13: warning: already initialized constant Psych::Nodes::Scalar::PLAIN
/usr/local/lib/ruby/2.7.0/psych/nodes/scalar.rb:13: warning: previous definition of PLAIN was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/nodes/scalar.rb:16: warning: already initialized constant Psych::Nodes::Scalar::SINGLE_QUOTED
/usr/local/lib/ruby/2.7.0/psych/nodes/scalar.rb:16: warning: previous definition of SINGLE_QUOTED was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/nodes/scalar.rb:19: warning: already initialized constant Psych::Nodes::Scalar::DOUBLE_QUOTED
/usr/local/lib/ruby/2.7.0/psych/nodes/scalar.rb:19: warning: previous definition of DOUBLE_QUOTED was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/nodes/scalar.rb:22: warning: already initialized constant Psych::Nodes::Scalar::LITERAL
/usr/local/lib/ruby/2.7.0/psych/nodes/scalar.rb:22: warning: previous definition of LITERAL was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/nodes/scalar.rb:25: warning: already initialized constant Psych::Nodes::Scalar::FOLDED
/usr/local/lib/ruby/2.7.0/psych/nodes/scalar.rb:25: warning: previous definition of FOLDED was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/nodes/mapping.rb:17: warning: already initialized constant Psych::Nodes::Mapping::ANY
/usr/local/lib/ruby/2.7.0/psych/nodes/mapping.rb:17: warning: previous definition of ANY was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/nodes/mapping.rb:20: warning: already initialized constant Psych::Nodes::Mapping::BLOCK
/usr/local/lib/ruby/2.7.0/psych/nodes/mapping.rb:20: warning: previous definition of BLOCK was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/nodes/mapping.rb:23: warning: already initialized constant Psych::Nodes::Mapping::FLOW
/usr/local/lib/ruby/2.7.0/psych/nodes/mapping.rb:23: warning: previous definition of FLOW was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/visitors/visitor.rb:11: warning: already initialized constant Psych::Visitors::Visitor::DISPATCH
/usr/local/lib/ruby/2.7.0/psych/visitors/visitor.rb:11: warning: previous definition of DISPATCH was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/visitors/to_ruby.rb:334: warning: already initialized constant Psych::Visitors::ToRuby::SHOVEL
/usr/local/lib/ruby/2.7.0/psych/visitors/to_ruby.rb:336: warning: previous definition of SHOVEL was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/handler.rb:27: warning: already initialized constant Psych::Handler::OPTIONS
/usr/local/lib/ruby/2.7.0/psych/handler.rb:27: warning: previous definition of OPTIONS was here
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/handler.rb:30: warning: already initialized constant Psych::Handler::EVENTS
/usr/local/lib/ruby/2.7.0/psych/handler.rb:30: warning: previous definition of EVENTS was here
Traceback (most recent call last):
	9: from -e:1:in `<main>'
	8: from /usr/local/lib/ruby/2.7.0/rubygems.rb:696:in `load_yaml'
	7: from /usr/local/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
	6: from /usr/local/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
	5: from /builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych.rb:24:in `<top (required)>'
	4: from /usr/local/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
	3: from /usr/local/lib/ruby/2.7.0/rubygems/core_ext/kernel_require.rb:72:in `require'
	2: from /builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/parser.rb:2:in `<top (required)>'
	1: from /builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/parser.rb:33:in `<module:Psych>'
/builddir/.gem/ruby/2.7.0/gems/psych-3.1.0/lib/psych/parser.rb:34:in `<class:Parser>': superclass mismatch for class Mark (TypeError)
~~~

Just FTR, the patch just hides this issue, it does not resolve it.

The hacks with default gems are hiding a lot of issues. It would be nice if somebody helped to make them less exceptional [1]. Or the `--disable-gems` option should possible be removed if it is not properly supported anymore.


[1]: https://github.com/rubygems/rubygems/pull/2909

----------------------------------------
Bug #16904: rubygems: psych: superclass mismatch for class Mark (TypeError)
https://bugs.ruby-lang.org/issues/16904#change-85743

* Author: jaruga (Jun Aruga)
* Status: Open
* Priority: Normal
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN
----------------------------------------
Is it possible to backport the following commits into Ruby?

Remove explicit `psych` activation
https://github.com/rubygems/rubygems/commit/1ccf0912a161d20e0c4a7b139fd76e8739a411ba

bundler: Remove explicit `psych` activation. 
https://github.com/rubygems/rubygems/commit/88478bb56945ffa9868491cacd0bc74d9d73c848

It causes the following kind of error when psych is installed as not default gem but regular gem. It's a Fedora Ruby specific case. **This is not the case of Ruby built from source normally.**


```
$ cat test.rb 
require 'psych'
Gem.load_yaml # <= The error happens.
```

```
$ ruby test.rb
/usr/lib64/gems/ruby/psych-3.1.0/psych.so: warning: already initialized constant Psych::Parser::ANY
...
/usr/share/gems/gems/psych-3.1.0/lib/psych/parser.rb:34:in `<class:Parser>': superclass mismatch for class Mark (TypeError)
```

It is possibly also related to https://github.com/ruby/psych/issues/386 .

Thank you.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread