[#123414] [Ruby Bug#21629] Ruby-3.4.7 fails to build using clang / llvm — "debo (David Bohman) via ruby-core" <ruby-core@...>

Issue #21629 has been reported by debo (David Bohman).

18 messages 2025/10/07

[#123433] [Ruby Misc#21630] Suggest @Earlopain for core contributor — "kddnewton (Kevin Newton) via ruby-core" <ruby-core@...>

Issue #21630 has been reported by kddnewton (Kevin Newton).

9 messages 2025/10/08

[#123484] [Ruby Bug#21640] Core Pathname is missing 3 methods / is partially-defined — "Eregon (Benoit Daloze) via ruby-core" <ruby-core@...>

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

21 messages 2025/10/15

[#123504] [Ruby Bug#21645] Can't `require "resolve"` on Windows under Bundler without warnings — "Earlopain (Earlopain _) via ruby-core" <ruby-core@...>

Issue #21645 has been reported by Earlopain (Earlopain _).

9 messages 2025/10/20

[#123506] [Ruby Misc#21646] Propose Luke Gruber as a Ruby committer — "jhawthorn (John Hawthorn) via ruby-core" <ruby-core@...>

Issue #21646 has been reported by jhawthorn (John Hawthorn).

8 messages 2025/10/20

[#123576] [Ruby Bug#21654] Set#new calls extra methods compared to previous versions — "tenderlovemaking (Aaron Patterson) via ruby-core" <ruby-core@...>

Issue #21654 has been reported by tenderlovemaking (Aaron Patterson).

16 messages 2025/10/29

[#123582] [Ruby Bug#21655] segfault when building 3.3.10, regression from 3.3.9 — "kurly (Greg Kubaryk) via ruby-core" <ruby-core@...>

Issue #21655 has been reported by kurly (Greg Kubaryk).

15 messages 2025/10/29

[#123586] [Ruby Misc#21656] Exclude dependabot PRs from automated gem release notes — "Earlopain (Earlopain _) via ruby-core" <ruby-core@...>

Issue #21656 has been reported by Earlopain (Earlopain _).

8 messages 2025/10/29

[#123595] [Ruby Misc#21657] Question: Is Ruby 4.0 planned for December 2025 or later? — "dmitry.pogrebnoy (Dmitry Pogrebnoy) via ruby-core" <ruby-core@...>

SXNzdWUgIzIxNjU3IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IGRtaXRyeS5wb2dyZWJub3kgKERtaXRy

22 messages 2025/10/29

[#123626] [Ruby Bug#21659] rstring.h error: missing initializer for field ‘len’ of ‘struct RString’ [-Werror=missing-field-initializers] starting in ruby-3.3.10 — "wsfulton (William Fulton) via ruby-core" <ruby-core@...>

SXNzdWUgIzIxNjU5IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IHdzZnVsdG9uIChXaWxsaWFtIEZ1bHRv

10 messages 2025/10/31

[ruby-core:123376] [Ruby Bug#21568] Requiring core libraries when already requiring multiple user defined libraries with the same name can error

From: "byroot (Jean Boussier) via ruby-core" <ruby-core@...>
Date: 2025-10-02 11:02:41 UTC
List: ruby-core #123376
Issue #21568 has been updated by byroot (Jean Boussier).


Nice catch, looks like it was introduced in 3.1.

----------------------------------------
Bug #21568: Requiring core libraries when already requiring multiple user defined libraries with the same name can error
https://bugs.ruby-lang.org/issues/21568#change-114748

* Author: alexalexgriffith (Alex Griffith)
* Status: Closed
* ruby -v: ruby 3.4.6
* Backport: 3.2: REQUIRED, 3.3: REQUIRED, 3.4: REQUIRED
----------------------------------------
The simplest way to understand this error is that after requiring 2 or more files with the same name as some core libraries, any subsequent calls to require the core library will fail, ie
```ruby
require 'foo/fiber'
require 'bar/fiber'
require 'fiber'
```
raises
```
cannot load such file -- fiber
```
More detailed instructions to repro this can be found in the code snippet below.

Noting that I am on a Mac, OS 15.6. This is reproducible across my team on a few different OS versions, all Mac. [EDIT]: I was also able to reproduce this on Debian Linux 12. The same underlying issue can also be seen in some other issues like: https://github.com/newrelic/newrelic-ruby-agent/issues/2001

The context this error is discovered in is that some gems may require their own libraries with the same name as core libraries, often wrapping the implementations of those core libraries to extend functionality, like the New Relic ruby agent does with fiber, for example (https://github.com/newrelic/newrelic-ruby-agent/tree/dev/lib/new_relic/agent/instrumentation/fiber).

Then, if 2 or more gems do something like that, and any other gem has `require 'fiber'` in it to support old ruby versions where this was necessary, the error occurs. 

**Full Steps to Reproduce:**
``` ruby
# Setup
# =====
# 1. Set this base_dir variable to be an absolute path to a dir
#    or something that can be found in your $LOAD_PATH.
base_dir = # ex: "/Users/<you>/ruby_require_test"
# 2. Within that base directory create 2 directories named `foo` and `bar`
# 3. Within both `foo` and `bar` touch new files named
#    - complex.rb 
#    - enumerator.rb 
#    - fiber.rb 
#    - rational.rb 
#    - ruby2_keywords.rb 
#    - set.rb 
#    - thread.rb 
# Note - this list was generated by running:
#   `ruby -ve 'p $LOADED_FEATURES.reject { |feature| %r|/| =~ feature }'`
#   which returns: `["enumerator.so", "thread.rb", "fiber.so", "rational.so", "complex.so", "ruby2_keywords.rb"]`


# Reproducing the error:
# After requiring 2 (or more) user defined files with the same name as part of
# the ruby core library that is required as a bare filename, requiring that part of
# the core library will error, ex: `cannot load such file -- fiber`.
# The erroring require statements are all .so files

begin
  require "#{base_dir}/foo/complex"
  require "#{base_dir}/bar/complex"
  require 'complex'
rescue LoadError => e
  puts e.message
end

begin
  require "#{base_dir}/foo/enumerator"
  require "#{base_dir}/bar/enumerator"
  require 'enumerator'
rescue LoadError => e
  puts e.message
end

begin
  require "#{base_dir}/foo/fiber"
  require "#{base_dir}/bar/fiber"
  require 'fiber'
rescue LoadError => e
  puts e.message
end

begin
  require "#{base_dir}/foo/rational"
  require "#{base_dir}/bar/rational"
  require 'rational'
rescue LoadError => e
  puts e.message
end


# The following examples do not error.
# The difference seems to be that the core lib files are defined as .rb not .so
begin
  require "#{base_dir}/foo/ruby2_keywords"
  require "#{base_dir}/bar/ruby2_keywords"
  require 'ruby2_keywords'
rescue LoadError => e
  puts e.message
end

begin
  require "#{base_dir}/foo/set"
  require "#{base_dir}/bar/set"
  require 'set'
rescue LoadError => e
  puts e.message
end

begin
  require "#{base_dir}/foo/thread"
  require "#{base_dir}/bar/thread"
  require 'thread'
rescue LoadError => e
  puts e.message
end

```




-- 
https://bugs.ruby-lang.org/
______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/


In This Thread