Skip to content

ext: load C extension files from non-native gems via "require" - #27

Merged
stanhu merged 1 commit into
mainfrom
21-require-library-in-ext
Dec 22, 2021
Merged

stanhu merged 1 commit into
mainfrom
21-require-library-in-ext

Conversation

@flavorjones

Copy link
Copy Markdown
Contributor

As reported in #21, we should be loading the C extension relying on require and $LOAD_PATH and not using require_relative.

Fixes #21

@flavorjones
flavorjones requested a review from stanhu as a code owner December 21, 2021 19:13
@stanhu
stanhu merged commit 500a9d5 into main Dec 22, 2021
@stanhu
stanhu deleted the 21-require-library-in-ext branch December 22, 2021 08:09
@stanhu

stanhu commented Dec 22, 2021

Copy link
Copy Markdown

@flavorjones Thanks!

@kwilczynski

Copy link
Copy Markdown
Owner

Thank you @flavorjones!

kwilczynski pushed a commit that referenced this pull request Dec 29, 2022
ext: load C extension files from non-native gems via "require"
stanhu added a commit to stanhu/ruby-magic that referenced this pull request Jul 27, 2025
This fixes a compilation issue in GCC 15 due `stdbool.h` not being
included when `-std=c99` is in use. This occurs because the standard
`configure` script shipped with older Ruby versions (prior to 3.4.5 and
3.3.9) do not properly test for `stdbool.h` on C23 compilers
(https://bugs.ruby-lang.org/issues/21340).

The `append_cflags` approach is recommended over modifying CFLAGS since
it ensures compatibility across different build environments by checking
whether the flag is acceptable.

Similar changes:

* socketry/io-event#137
* mongodb/bson-ruby#355

Closes kwilczynski#27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Error with ruby-magic 0.4.0

3 participants