minad / lmdb

Ruby bindings for the OpenLDAP's Lightning Memory-Mapped Database (LMDB)
https://github.com/minad/lmdb
106 stars 38 forks source link

Gem will not install with Rubinius #5

Open langhorst opened 11 years ago

langhorst commented 11 years ago

I attempted to install the lmdb gem on a fresh install of Rubinius through RVM without success. For this build, I created a new gemset in RVM for freshness. Any plans to support compiling lmdb with Rubinius?

➜  ~  rvm --version
rvm 1.23.10 (master) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]
➜  ~  ruby --version
rubinius 2.1.1 (2.1.0 be67ed17 2013-10-18 JI) [x86_64-darwin11.4.2]
➜  ~  gem install lmdb
Fetching: lmdb-0.3.1.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing lmdb:
    ERROR: Failed to build gem native extension.

    /Users/justin/.rvm/rubies/rbx-2.1.1/bin/rbx extconf.rb
checking for lmdb.h... no
checking for limits.h... yes
checking for string.h... yes
checking for stdlib.h... yes
checking for errno.h... yes
checking for sys/types.h... yes
checking for assert.h... yes
checking for ruby.h... yes
checking for rb_funcall_passing_block()... no
creating Makefile

make "DESTDIR="
compiling lmdb_ext.c
lmdb_ext.c:90:10: error: #error "Not implemented"
lmdb_ext.c: In function ‘call_with_transaction_helper’:
lmdb_ext.c:91: warning: control reaches end of non-void function
make: *** [lmdb_ext.o] Error 1

Gem files will remain installed in /Users/justin/.rvm/gems/rbx-2.1.1@lmdb/gems/lmdb-0.3.1 for inspection.
Results logged to /Users/justin/.rvm/gems/rbx-2.1.1@lmdb/gems/lmdb-0.3.1/ext/lmdb_ext/gem_make.out
minad commented 11 years ago

Yes, this is a known issue. Please provide a patch or ask the rubinius people how to fix that. I need rb_funcall_passing_block. Ruby 1.8 is also unsupported because of that.

langhorst commented 11 years ago

I'd love to provide a patch, but I know very little about writing C extensions for Ruby. Maybe it's time to learn. I'll ask around and try to get it fixed. Thanks for the comment!

captainpete commented 10 years ago

@minad, what are your thoughts on an FFI version? Could an FFI-based approach solve the compatibility issues around 1.8 and Rubinius?

andoriyu commented 10 years ago

FFI version would be great.

MarcoPeraza commented 7 years ago

I'm actually seeing this same error trying to install the gem against MRI Ruby 2.3 on Fedora 25.

Full Ruby Version: ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-linux]

I also get the same error if I install from the latest source.

MarcoPeraza commented 7 years ago

I was able to get it to compile just by removing the ifndef.

https://github.com/MarcoPeraza/lmdb/commit/d7ef1d01f16267e653650c6c7809ad0a2d8a1aee

It seems to work fine.