Skip to content

Gem fails to compile #55

@dnebdal

Description

@dnebdal

Hi. Using ruby 2.7.2 on Fedora 33, both "gem install lmdb" and a git clone / bundle exec rake fails with very similar errors:

gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I../../../../ext/lmdb_ext -I../../../../ext/lmdb_ext/liblmdb -DRUBY_EXTCONF_H=\"extconf.h\"    -fPIC -std=c99 -Wall -g -m64 -o lmdb_ext.o -c ../../../../ext/lmdb_ext/lmdb_ext.c
../../../../ext/lmdb_ext/lmdb_ext.c: In function ‘call_with_transaction_helper’:
../../../../ext/lmdb_ext/lmdb_ext.c:172:10: error: #error "Not implemented"
  172 |         #error "Not implemented"
      |          ^~~~~

As far as I can tell, this is this block in lmdb_ext.c , starting at line 169:

// Ruby 1.8.7 compatibility
#ifndef HAVE_RB_FUNCALL_PASSING_BLOCK
static VALUE call_with_transaction_helper(VALUE arg) {
        #error "Not implemented"
}
#else
static VALUE call_with_transaction_helper(VALUE arg) {
        HelperArgs* a = (HelperArgs*)arg;
        return rb_funcall_passing_block(a->self, rb_intern(a->name), a->argc, a->argv);
}
#endif

Just removing the entire ifdef and uncritically using the #else version seems to work for me, but I assume it's there for a reason.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions