truffleruby icon indicating copy to clipboard operation
truffleruby copied to clipboard

memcached uses lower-case class names

Open nirvdrum opened this issue 3 years ago • 0 comments

The last released version of memcached (1.8.0, released on 07-May-2014) defines a class with a lower-case name in a native extension. rb_define_class allows this, but TruffleRuby's implementation does not because it shares code with the Ruby side of things and performs name validation. This results in the gem being unable to load:

NameError:
  wrong constant name swig_runtime_data
# <internal:core> core/module.rb:103:in `const_defined?'
# /Users/nirvdrum/dev/workspaces/truffleruby-ws/graal/sdk/mxbuild/darwin-aarch64/GRAALVM_A33290E019_JAVA11/graalvm-a33290e019-java11-22.3.0-dev/Contents/Home/languages/ruby/lib/truffle/truffle/cext.rb:1176:in `rb_define_class_under'
# define.c:27:in `rb_define_class'
# /Users/nirvdrum/dev/workspaces/truffleruby-ws/graal/sdk/mxbuild/darwin-aarch64/GRAALVM_A33290E019_JAVA11/graalvm-a33290e019-java11-22.3.0-dev/Contents/Home/languages/ruby/lib/gems/gems/memcached-1.8.0/ext/rlibmemcached_wrap.c:1737:in `Init_rlibmemcached'
# <internal:core> core/kernel.rb:226:in `gem_original_require'

The problematic code no longer exists in the memcached gem, but there hasn't been a release in over seven years. Even if we can convince the authors to release one, its master branch is set to 2.0.0.alpha, which would preclude it from an automatic update for most dependency graphs as it's a major version bump.

nirvdrum avatar Sep 23 '22 22:09 nirvdrum