Issue #19778 has been reported by rhenium (Kazuki Yamaguchi).
----------------------------------------
Bug #19778: mkmf.rb pkg_config() interaction with RbConfig::CONFIG["cflags"]
https://bugs.ruby-lang.org/issues/19778
* Author: rhenium (Kazuki Yamaguchi)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.3.0dev (2023-07-21T09:38:29Z master 22f9735587) [x86_64-linux]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
(This was first reported at https://github.com/ruby/openssl/issues/650: The extension's build breaks in a strange way if `RbConfig::CONFIG["*flags"]` contains the path of an OpenSSL installation but `pkg-config` returns the path of a different OpenSSL installation)
Commit commit:097c3e9cbbf23718371f08c24b2d2297b039f63f ("mkmf.rb: -I flags to $INCFLAGS", Ruby 2.2) changed how mkmf's `pkg_config()` handles the result of the `pkg-config` command. It now stores the `-I` flags in $INCFLAGS and others in $CFLAGS.
mkmf generates a Makefile that compiles source files with:
$(CC) $(INCFLAGS) $(CPPFLAGS) $(CFLAGS)
and link the final library with:
$(LDSHARED) -o $@ $(OBJS) $(LIBPATH) $(DLDFLAGS) $(LOCAL_LIBS) $(LIBS)
This "new" behavior of `pkg_config()` is problematic when `RbConfig::CONFIG["{C,CPP}FLAGS"]` also provide `-I` flags and `RbConfig::CONFIG["LDFLAGS"]` provides the matching `-L` flags -- for example, if Ruby is compiled with `./configure --with-opt-dir=<dir>`. This would end up with compiling sources with
[...] -I<from pkg-config> -I<from RbConfig> [...]
and then linking with
[...] -L<from RbConfig> -L<from pkg-config> [...]
This doesn't seem right. I don't know which should come earlier, but the order should be consistent. The commit in question clearly describes the change in the commit message, but it doesn't have a linked issue. What is it intended for? Also, what is $INCFLAGS?
On the other hand, `dir_config()` would prepend `-I` flags to $CPPFLAGS and `-L` flags to $LIBPATH, so it doesn't have issues with flags from `RbConfig`, albeit in a differently way.
--
https://bugs.ruby-lang.org/
Issue #19894 has been reported by peterzhu2118 (Peter Zhu).
----------------------------------------
Bug #19894: Memory leak in complemented method entries
https://bugs.ruby-lang.org/issues/19894
* Author: peterzhu2118 (Peter Zhu)
* Status: Open
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: REQUIRED
----------------------------------------
GitHub pull request: https://github.com/ruby/ruby/pull/8481
When a copy of a complemented method entry is created, there are two issues:
1. IMEMO_FL_USER3 is not copied, so the complemented status is not copied over.
2. In rb_method_entry_clone we increment both alias_count and complemented_count. However, when we free the method entry in rb_method_definition_release, we only decrement one of the two counters, resulting in the rb_method_definition_t being leaked.
The following script reproduces this issue:
```ruby
10.times do
20_000.times do
$c = Class.new do
def foo; end
end
$m = Module.new do
refine $c do
def foo; end
end
end
Class.new do
using $m
def initialize
o = $c.new
o.method(:foo).unbind
end
end.new
end
puts `ps -o rss= -p #{$$}`
end
```
Before this fix:
```
17328
19248
21408
23296
25600
27408
29424
31520
33728
35664
```
After this fix:
```
16240
17680
18800
19744
20640
21840
22896
24336
25280
26096
```
--
https://bugs.ruby-lang.org/
Issue #19885 has been reported by jeremyevans0 (Jeremy Evans).
----------------------------------------
Bug #19885: Invalid Warning for Default Gems That Will Move to Bundled Gems
https://bugs.ruby-lang.org/issues/19885
* Author: jeremyevans0 (Jeremy Evans)
* Status: Open
* Priority: Normal
* Assignee: hsbt (Hiroshi SHIBATA)
* ruby -v: ruby 3.3.0preview2 (2023-09-14 master e50fcca9a7) [x86_64-openbsd]
* Backport: 3.0: DONTNEED, 3.1: DONTNEED, 3.2: DONTNEED
----------------------------------------
Starting in ruby 3.3.0-preview2, attempting to require bigdecimal, mutex_m, base64, or other libraries that will move to bundled gems in Ruby 3.4.0 results in a warning, even when bundler is not in use:
```
$ ruby33 -v -r bigdecimal -e ''
ruby 3.3.0preview2 (2023-09-14 master e50fcca9a7) [x86_64-openbsd]
warning: bigdecimal which will be not part of the default gems since Ruby 3.4.0
```
I think such warnings are bugs if bundler is not in use. When a library is moved from a default gem to a bundled gem, such code will work fine if not using bundler. It is only when using bundler where such code would have problems, and therefore, if Ruby warns at all, it should only warn when bundler is in use.
The only time such a warning would make sense if bundler is not in use is if the library was not going to be a bundled gem. In that case, first the library should be moved from a default gem to a bundled gem, then the bundled gem that ships with Ruby should provide the warning, which you can avoid by installing an updated gem version.
Note that you also get the warning when loading a gem that has bigdecimal as a runtime dependency (this example uses Sequel 5.72.0, which has a runtime dependency on bigdecimal as you can see at https://rubygems.org/gems/sequel/versions/5.72.0):
```
$ ruby33 -v -r sequel -e ''
ruby 3.3.0preview2 (2023-09-14 master e50fcca9a7) [x86_64-openbsd]
/usr/local/lib/ruby/gems/3.3/gems/sequel-5.72.0/lib/sequel/core.rb:3: warning: bigdecimal which will be not part of the default gems since Ruby 3.4.0
```
This warning makes even less sense, because even if bigdecimal was removed as both a default gem and a bundled gem, installing Sequel 5.72.0 would install bigdecimal as a dependency.
--
https://bugs.ruby-lang.org/
Issue #19839 has been reported by shouichi (Shouichi KAMIYA).
----------------------------------------
Feature #19839: Need a method to check if two ranges overlap
https://bugs.ruby-lang.org/issues/19839
* Author: shouichi (Shouichi KAMIYA)
* Status: Open
* Priority: Normal
----------------------------------------
It would be convenient to have a method that checks if two ranges overlap. For example,
```
(0..10).overlap?(5..15) #=> true
(0..10).overlap?(20..30) #=> false
```
--
https://bugs.ruby-lang.org/
Issue #19866 has been reported by vo.x (Vit Ondruch).
----------------------------------------
Bug #19866: Future of `readline.rb`
https://bugs.ruby-lang.org/issues/19866
* Author: vo.x (Vit Ondruch)
* Status: Open
* Priority: Normal
* ruby -v: ruby 3.3.0dev (2023-09-05 master 7c8932365f) [x86_64-linux]
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
I wonder what is the future of readline.rb? It still tries to load `readline.so` by default. Is this intended behavior? I'd say that instead, it should rather fire a deprecation warning and load reline. Or maybe the whole readline gem should be completely removed?
--
https://bugs.ruby-lang.org/
Issue #19883 has been reported by mame (Yusuke Endoh).
----------------------------------------
Misc #19883: DevMeeting-2023-10-12
https://bugs.ruby-lang.org/issues/19883
* Author: mame (Yusuke Endoh)
* Status: Open
* Priority: Normal
----------------------------------------
# The next dev meeting
**Date: 2023/10/12 13:00-17:00** (JST)
Log: *TBD*
- Dev meeting *IS NOT* a decision-making place. All decisions should be done at the bug tracker.
- Dev meeting is a place we can ask Matz, nobu, nurse and other developers directly.
- Matz is a very busy person. Take this opportunity to ask him. If you can not attend, other attendees can ask instead of you (if attendees can understand your issue).
- We will write a record of the discussion in the file or to each ticket in English.
- All activities are best-effort (keep in mind that most of us are volunteer developers).
- The date, time and place of the meeting are scheduled according to when/where we can reserve Matz's time.
- *DO NOT* discuss then on this ticket, please.
# Call for agenda items
If you have a ticket that you want matz and committers to discuss, please post it into this ticket in the following format:
```
* [Ticket ref] Ticket title (your name)
* Comment (A summary of the ticket, why you put this ticket here, what point should be discussed, etc.)
```
Example:
```
* [Feature #14609] `Kernel#p` without args shows the receiver (ko1)
* I feel this feature is very useful and some people say :+1: so let discuss this feature.
```
- It is recommended to add a comment by 2023/10/09. We hold a preparatory meeting to create an agenda a few days before the dev-meeting.
- The format is strict. We'll use [this script to automatically create an markdown-style agenda](https://gist.github.com/mame/b0390509ce1491b43610b9ebb665eb86). We may ignore a comment that does not follow the format.
- Your comment is mandatory. We cannot read all discussion of the ticket in a limited time. We appreciate it if you could write a short summary and update from a previous discussion.
--
https://bugs.ruby-lang.org/
Issue #19884 has been reported by p8 (Petrik de Heus).
----------------------------------------
Feature #19884: Make Safe Navigation Operator work on classes
https://bugs.ruby-lang.org/issues/19884
* Author: p8 (Petrik de Heus)
* Status: Open
* Priority: Normal
----------------------------------------
If a class might not be defined we need to add a conditional:
```ruby
defined?(ActiveRecord::Base) && ActiveRecord::Base.some_method
```
It would be nice if we could use the Safe Navigation Operator instead.
```ruby
ActiveRecord::Base&.some_method
```
--
https://bugs.ruby-lang.org/
Issue #19880 has been reported by peterzhu2118 (Peter Zhu).
----------------------------------------
Bug #19880: Missing write barrier in iseq instruction list
https://bugs.ruby-lang.org/issues/19880
* Author: peterzhu2118 (Peter Zhu)
* Status: Open
* Priority: Normal
* Backport: 3.0: UNKNOWN, 3.1: REQUIRED, 3.2: REQUIRED
----------------------------------------
There's a missing write barrier for operands in the iseq instruction list, which can cause crashes. This bug has been fixed in commit [b3b57f7](https://github.com/ruby/ruby/commit/b3b57f70cc1ee6f40ff10b2abaa518….
It can be reproduced when Ruby is compiled with `-DRUBY_DEBUG_ENV=1`. Using the following command:
```
RUBY_GC_HEAP_OLDOBJECT_LIMIT_FACTOR=0 RUBY_DEBUG=gc_stress ruby -w --disable=gems -Itool/lib -W0 test.rb
```
The following script crashes:
```ruby
require "test/unit"
```
I have backports for Ruby 3.1 and Ruby 3.2 available here:
3.1: https://github.com/ruby/ruby/pull/8430
3.2: https://github.com/ruby/ruby/pull/8431
--
https://bugs.ruby-lang.org/
Issue #19893 has been reported by msxavi (Emerson Xavier).
----------------------------------------
Bug #19893: OpenStruct#respond_to? when true fails with NameError
https://bugs.ruby-lang.org/issues/19893
* Author: msxavi (Emerson Xavier)
* Status: Open
* Priority: Normal
* ruby -v: 3.1.4
* Backport: 3.0: UNKNOWN, 3.1: UNKNOWN, 3.2: UNKNOWN
----------------------------------------
Hello,
I have a case where I overrode respond_to? on a subclass of OpenStruct because I this class to work as fake object.
```
class Dep
def a
"Hello from Dep"
end
end
class FakeDep < OpenStruct
def respond_to?(*args)
super || Dep.new.respond_to?(*args)
end
end
FakeDep.new(a: [])
NameError: undefined method `a' for class `FakeDep'
owner = method!(name).owner
^^^^^^^
from /usr/local/lib/ruby/3.1.0/ostruct.rb:245:in `method'
```
Is this a valid issue?
Also posted in https://github.com/ruby/ostruct/issues/55
--
https://bugs.ruby-lang.org/