[#122643] [Ruby Bug#21498] Windows - Ruby Overrides C Library APIs thus breaking them — "cfis (Charlie Savage) via ruby-core" <ruby-core@...>

Issue #21498 has been reported by cfis (Charlie Savage).

9 messages 2025/07/02

[#122658] [Ruby Feature#21501] Include native filenames in backtraces as sources for native methods — "ivoanjo (Ivo Anjo) via ruby-core" <ruby-core@...>

Issue #21501 has been reported by ivoanjo (Ivo Anjo).

10 messages 2025/07/05

[#122665] [Ruby Bug#21503] \p{Word} does not match on \p{Join_Control} while docs say it does — "procmarco (Marco Concetto Rudilosso) via ruby-core" <ruby-core@...>

SXNzdWUgIzIxNTAzIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IHByb2NtYXJjbyAoTWFyY28gQ29uY2V0

8 messages 2025/07/07

[#122734] [Ruby Bug#21511] Use-after-free of the execution context after the fiber object carrying it is freed in GC — "tuonigou (tianyang sun) via ruby-core" <ruby-core@...>

Issue #21511 has been reported by tuonigou (tianyang sun).

10 messages 2025/07/14

[#122797] [Ruby Feature#21515] Add `&return` as sugar for `x=my_calculation; return x if x` — "nhorton (Noah Horton) via ruby-core" <ruby-core@...>

Issue #21515 has been reported by nhorton (Noah Horton).

13 messages 2025/07/16

[#122842] [Ruby Feature#21518] Statistical helpers to `Enumerable` — "Amitleshed (Amit Leshed) via ruby-core" <ruby-core@...>

SXNzdWUgIzIxNTE4IGhhcyBiZWVuIHJlcG9ydGVkIGJ5IEFtaXRsZXNoZWQgKEFtaXQgTGVzaGVk

12 messages 2025/07/23

[#122847] [Ruby Feature#21520] Feature Proposal: Enumerator::Lazy#peek — "nuzair46 (Nuzair Rasheed) via ruby-core" <ruby-core@...>

SXNzdWUgIzIxNTIwIGhhcyBiZWVuIHJlcG9ydGVkIGJ5IG51emFpcjQ2IChOdXphaXIgUmFzaGVl

12 messages 2025/07/24

[ruby-core:122844] [Ruby Bug#21519] `configure` script in Ruby tarballs should be generated with autoconf 2.72+ for C23 compilers

From: "stanhu (Stan Hu) via ruby-core" <ruby-core@...>
Date: 2025-07-23 20:21:22 UTC
List: ruby-core #122844
Issue #21519 has been reported by stanhu (Stan Hu).

----------------------------------------
Bug #21519: `configure` script in Ruby tarballs should be generated with autoconf 2.72+ for C23 compilers
https://bugs.ruby-lang.org/issues/21519

* Author: stanhu (Stan Hu)
* Status: Open
* Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN
----------------------------------------
The `autoconf` used to generate `configure` in the Ruby source downloads needs to be updated from 2.71 to 2.72 to fix compatibility with C23 compilers, such as GCC 15.

This is related to https://bugs.ruby-lang.org/issues/21024, but this is focused on C, not C++, compilation.

This is also related to gem compilation issues, such as:

* https://github.com/socketry/io-event/issues/136
* https://jira.mongodb.org/browse/RUBY-3675
* https://github.com/cabo/cbor-ruby/issues/27

These gems worked around the problem by using `append_cflags` instead of `CFLAGS`. That fixes the problem because `-std=c99` is omitted entirely, even for `gcc`. 

However, this masks the problem that for GCC 15, the Ruby headers should include `<stdbool.h>`. If a gem really needed to use an older C version, `append_cflags` would always throw it out in GCC 15 because `bool` is not defined without including that header.

As mentioned in https://gcc.gnu.org/gcc-15/porting_to.html#c23, GCC 15 defaults to C23 now:

> In C99 and later you can use #include <stdbool.h> which provides definitions of bool, true, and false compatible with C23. 

The `configure` script checks whether `stdbool.h` is available and defines `HAVE_STDBOOL_H` if it is. However, if I install `ruby 3.4.4` via `mise` with the Docker image `fedora:42`, I see this in the build logs:

```
configure:13530: checking for stdbool.h that conforms to C99
configure:13646: gcc -c -fstack-protector-strong -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2  -O3 -fno-fast-math -ggdb3    conftest.c >&5
conftest.c:103:17: error: #error "bool is not defined"
  103 |                #error "bool is not defined"
      |                 ^~~~~
conftest.c:106:17: error: #error "false is not defined"
  106 |                #error "false is not defined"
      |                 ^~~~~
conftest.c:109:17: error: #error "true is not defined"
  109 |                #error "true is not defined"
      |                 ^~~~~
configure:13646: $? = 1
```

Attached is the test program used by `configure`:

[test-bool.txt](https://github.com/user-attachments/files/21394404/test-bool.txt)

It seems that this test is outdated. It needs this `autoconf` fix for C23:

https://cgit.git.savannah.gnu.org/cgit/autoconf.git/commit/?id=6dcecb780a69bd208088d666b299e92aa7ae7e80. 

If I install `autoconf` and run this:

```
autoreconf -fiv
./configure
```

Then it works:

```
checking for stdbool.h that conforms to C99 or later... yes
```

If we peek at `https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.4.tar.gz`:

```
# curl -O https://cache.ruby-lang.org/pub/ruby/3.4/ruby-3.4.4.tar.gz
# tar xzf ruby-3.4.4.tar.gz
# head -3 ruby-3.4.4/configure
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.71.
```

I believe `autoconf` needs to be updated to 2.72.



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


In This Thread

Prev Next