charlock_holmes suddenly broken

38 views
Skip to first unread message

Thierry

unread,
Jun 3, 2025, 6:10:58 AMJun 3
to RubyInstaller
Hi everyone,

Yesterday, I updated my msys2 environment with "pacman -Syuu".
It went well, but after that, the gem charlock_holmes was not working anymore.
I tried to uninstall/reinstall the gem the way I always did (and was working fine):

gem install charlock_holmes -- --with-icui18nlib=icuin --with-icudatalib=icudt

But now the install fails miserably (see the command output below).

I guess this an issue with rubyinstaller, since what was working before the msys2 update does not work any more (correct me if I'm wrong): any idea?

Thanks!
-- Thierry

$ uname -a
MSYS_NT-10.0-19045 Hyperion 3.6.2-24ff97bf.x86_64 2025-05-29 07:57 UTC x86_64 Msys

> ruby -v
ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [x64-mingw-ucrt]

> gem install charlock_holmes -- --with-icui18nlib=icuin --with-icudatalib=icudt
Temporarily enhancing PATH for MSYS/MINGW...
Building native extensions with: '--with-icui18nlib=icuin --with-icudatalib=icudt'
This could take a while...
ERROR:  Error installing charlock_holmes:
        ERROR: Failed to build gem native extension.

    current directory: c:/ruby-3.4.2-x64/lib/ruby/gems/3.4.0/gems/charlock_holmes-0.7.9/ext/charlock_holmes
c:/ruby-3.4.2-x64/bin/ruby.exe extconf.rb --with-icui18nlib\=icuin --with-icudatalib\=icudt
checking for pkg-config for icu-i18n... ["-Ic:/msys64/ucrt64/bin/../include ", "-Lc:/msys64/ucrt64/bin/../lib", "-licuin -licuuc -licudt"]
checking for pkg-config for icu-io... ["-Ic:/msys64/ucrt64/bin/../include ", "-Lc:/msys64/ucrt64/bin/../lib", "-licuio -licuin -licuuc -licudt"]
checking for pkg-config for icu-uc... ["-Ic:/msys64/ucrt64/bin/../include ", "-Lc:/msys64/ucrt64/bin/../lib", "-licuuc -licudt"]
checking for -licuin... yes
checking for unicode/ucnv.h... yes
checking for -lz... yes
checking for -licuuc... yes
checking for -licudt... yes
checking for icu that requires explicit C++ version flag... no
Static linking is disabled.
creating Makefile

current directory: c:/ruby-3.4.2-x64/lib/ruby/gems/3.4.0/gems/charlock_holmes-0.7.9/ext/charlock_holmes
make DESTDIR\= sitearchdir\=./.gem.20250603-17520-hpk71s sitelibdir\=./.gem.20250603-17520-hpk71s clean

current directory: c:/ruby-3.4.2-x64/lib/ruby/gems/3.4.0/gems/charlock_holmes-0.7.9/ext/charlock_holmes
make DESTDIR\= sitearchdir\=./.gem.20250603-17520-hpk71s sitelibdir\=./.gem.20250603-17520-hpk71s
generating charlock_holmes-x64-mingw-ucrt.def
compiling converter.c
converter.c: In function '_init_charlock_converter':
converter.c:56:62: error: passing argument 3 of 'rb_define_singleton_method' from incompatible pointer type [-Wincompatible-pointer-types]
   56 |         rb_define_singleton_method(rb_cConverter, "convert", rb_converter_convert, 3);
      |                                                              ^~~~~~~~~~~~~~~~~~~~
      |                                                              |
      |                                                              VALUE (*)(VALUE,  VALUE,  VALUE,  VALUE) {aka long long unsigned int (*)(long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int)}
In file included from C:/ruby-3.4.2-x64/include/ruby-3.4.0/ruby/internal/anyargs.h:76,
                 from C:/ruby-3.4.2-x64/include/ruby-3.4.0/ruby/ruby.h:27,
                 from C:/ruby-3.4.2-x64/include/ruby-3.4.0/ruby.h:38,
                 from common.h:9,
                 from converter.c:2:
C:/ruby-3.4.2-x64/include/ruby-3.4.0/ruby/internal/intern/class.h:365:68: note: expected 'VALUE (*)(void)' {aka 'long long unsigned int (*)(void)'} but argument is of type 'VALUE (*)(VALUE,  VALUE,  VALUE,  VALUE)' {aka 'long long unsigned int (*)(long long unsigned int,  long long unsigned int,  long long unsigned int,  long long unsigned int)'}
  365 | void rb_define_singleton_method(VALUE obj, const char *mid, VALUE(*func)(ANYARGS), int arity);
      |                                                             ~~~~~~~^~~~~~~~~~~~~~
converter.c:7:14: note: 'rb_converter_convert' declared here
    7 | static VALUE rb_converter_convert(VALUE self, VALUE rb_txt, VALUE rb_src_enc, VALUE rb_dst_enc) {
      |              ^~~~~~~~~~~~~~~~~~~~
make: *** [Makefile:251: converter.o] Error 1

make failed, exit code 2

Gem files will remain installed in c:/ruby-3.4.2-x64/lib/ruby/gems/3.4.0/gems/charlock_holmes-0.7.9 for inspection.
Results logged to c:/ruby-3.4.2-x64/lib/ruby/gems/3.4.0/extensions/x64-mingw-ucrt/3.4.0/charlock_holmes-0.7.9/gem_make.out

Thierry

unread,
Jun 3, 2025, 11:53:59 AMJun 3
to RubyInstaller
That was just the tip of the iceberg: no gem with native extensions could install anymore.
I installed ruby 3.4.4 instead of 3.4.2, and everything works now.

Thierry

unread,
Jun 4, 2025, 6:10:08 AMJun 4
to RubyInstaller
Hi guys,

I think there is definitely an issue with the latest msys2 environment.
Here is an example I had to work around this morning:
- if you install the sqlite3 gem with "gem install sqlite3", it will refuse to load
- if you request that it compiles its native extension (gem install sqlite3 --platform ruby), it will load happily
See the sequence of commands below.

As a general rule it seems that anything compiled for a previous version of msys2 does not work anymore: it has to be recompiled.

Can someone confirm this?

Cheers
-- Thierry

> ruby -v
ruby 3.4.4 (2025-05-14 revision a38531fd3f) +PRISM [x64-mingw-ucrt]

> gem install sqlite3
Fetching sqlite3-2.6.0-x64-mingw-ucrt.gem
Successfully installed sqlite3-2.6.0-x64-mingw-ucrt
1 gem installed

> ruby -e "require 'sqlite3'"
<internal:c:/ruby-3.4.4-x64/lib/ruby/site_ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
        from <internal:c:/ruby-3.4.4-x64/lib/ruby/site_ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require'
        from c:/ruby-3.4.4-x64/lib/ruby/gems/3.4.0/gems/sqlite3-2.6.0-x64-mingw-ucrt/lib/sqlite3.rb:6:in '<top (required)>'
        from <internal:c:/ruby-3.4.4-x64/lib/ruby/site_ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:141:in 'Kernel#require'
        from <internal:c:/ruby-3.4.4-x64/lib/ruby/site_ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:141:in 'Kernel#require'
        from -e:1:in '<main>'
<internal:c:/ruby-3.4.4-x64/lib/ruby/site_ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require': 127: The specified procedure could not be found.   - c:/ruby-3.4.4-x64/lib/ruby/gems/3.4.0/gems/sqlite3-2.6.0-x64-mingw-ucrt/lib/sqlite3/3.4/sqlite3_native.so (LoadError)
        from <internal:c:/ruby-3.4.4-x64/lib/ruby/site_ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require'
        from c:/ruby-3.4.4-x64/lib/ruby/gems/3.4.0/gems/sqlite3-2.6.0-x64-mingw-ucrt/lib/sqlite3.rb:4:in '<top (required)>'
        from <internal:c:/ruby-3.4.4-x64/lib/ruby/site_ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:141:in 'Kernel#require'
        from <internal:c:/ruby-3.4.4-x64/lib/ruby/site_ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:141:in 'Kernel#require'
        from -e:1:in '<main>'
<internal:c:/ruby-3.4.4-x64/lib/ruby/site_ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require': cannot load such file -- sqlite3 (LoadError)
        from <internal:c:/ruby-3.4.4-x64/lib/ruby/site_ruby/3.4.0/rubygems/core_ext/kernel_require.rb>:136:in 'Kernel#require'
        from -e:1:in '<main>'

> gem uninstall sqlite3
Successfully uninstalled sqlite3-2.6.0-x64-mingw-ucrt

> gem install sqlite3 --platform ruby
Fetching sqlite3-2.6.0.gem
Fetching mini_portile2-2.8.9.gem
Successfully installed mini_portile2-2.8.9

Temporarily enhancing PATH for MSYS/MINGW...
Using msys2 packages: mingw-w64-ucrt-x86_64-sqlite3
Building native extensions. This could take a while...
Successfully installed sqlite3-2.6.0
2 gems installed

> ruby -e "require 'sqlite3'"
(no message: it works)

Thierry

unread,
Jun 6, 2025, 5:15:17 AMJun 6
to RubyInstaller
I found the source of this issue:
I post this in case anybody runs into the same issue as me.
Reply all
Reply to author
Forward
0 new messages