minad/lmdb

cannot compile, on aarch64/Android/Termux/Ubuntu-server jammy, Ruby 3.0.2

Opened this issue · 1 comments

I've already encountered that the git version of rbenv is incapable of compiling ANY stable version of Ruby before the 3.1.2 version
( ie 3.0.x, 2.7.x, 2.6.x, 2.5.x ),
and reported that on the bugs.ruby-lang system,
but they closed it shortly thereafter saying it is actually an ssl bug.

Boggles me, but these 2 bugs may be related, so I mentioned that.

I hope I've stitched this back together properly,
stderr recorded:

      ERROR:  Error installing lmdb:
  2    ERROR: Failed to build gem native extension.
  3                                                                                                  
  4     current directory: /var/lib/gems/3.0.0/gems/lmdb-0.6/ext/lmdb_ext
  5 /usr/bin/ruby3.0 -I /usr/lib/ruby/vendor_ruby -r ./siteconf20220609-30699-c8sevg.rb extconf.rb
  6 checking for lmdb.h... yes
  7 checking for mdb_env_create() in -llmdb... yes
  8 checking for limits.h... yes
  9 checking for string.h... yes
 10 checking for stdlib.h... yes
 11 checking for errno.h... yes
 12 checking for sys/types.h... yes
 13 checking for assert.h... yes
 14 checking for ruby.h... yes
 15 checking for rb_funcall_passing_block()... yes
 16 checking for rb_thread_call_without_gvl2()... yes
 17 creating extconf.h                                                                              
 18 creating Makefile
 19
 20 current directory: /var/lib/gems/3.0.0/gems/lmdb-0.6/ext/lmdb_ext
 21 make DESTDIR\= clean
 22                                                                                                 
 23 current directory: /var/lib/gems/3.0.0/gems/lmdb-0.6/ext/lmdb_ext
 24 make DESTDIR\=
 25 compiling lmdb_ext.c
 26 lmdb_ext.c: In function ‘transaction_free’:
 27 lmdb_ext.c:41:51: warning: passing argument 1 of ‘RB_NIL_P’ makes integer from pointer without     a cast [-Wint-conversion]
 28    41 |         if (transaction->txn && !NIL_P(transaction->txn)) {
 29       |                                        ~~~~~~~~~~~^~~~~
 30       |                                                   |
 31       |                                                   MDB_txn *
 32 In file included from /usr/include/ruby-3.0.0/ruby/internal/arithmetic/long.h:42,
 33                  from /usr/include/ruby-3.0.0/ruby/internal/arithmetic/int.h:26,
 34                  from /usr/include/ruby-3.0.0/ruby/internal/arithmetic/char.h:23,
 35                  from /usr/include/ruby-3.0.0/ruby/internal/arithmetic.h:23,
 36                  from /usr/include/ruby-3.0.0/ruby/ruby.h:25,
 37                  from /usr/include/ruby-3.0.0/ruby.h:38,
 38                  from lmdb_ext.h:4,
 39                  from lmdb_ext.c:1:
 40 /usr/include/ruby-3.0.0/ruby/internal/special_consts.h:128:16: note: expected ‘VALUE’ {aka ‘long unsigned int’} but argument is of type ‘MDB_txn *’
 41   128 | RB_NIL_P(VALUE obj)
 42       |          ~~~~~~^~~
 43 lmdb_ext.c: In function ‘transaction_finish’:
 44 lmdb_ext.c:200:28: warning: assignment to ‘VALUE’ {aka ‘long unsigned int’} from ‘void *’ makes     integer from pointer without a cast [-Wint-conversion]
 45   200 |         env->rw_txn_thread = NULL;
 46       |                            ^
 47 lmdb_ext.c: In function ‘environment_new’:                                                      
 48 lmdb_ext.c:620:46: warning: passing argument 2 of ‘rb_hash_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]                                                              
 49   620 |                 rb_hash_foreach(option_hash, environment_options, (VALUE)&options);
 50       |                                              ^~~~~~~~~~~~~~~~~~~
 51       |                                              |
 52       |                                              int (*)(VALUE,  VALUE,  EnvironmentOptions
     *) {aka int (*)(long unsigned int,  long unsigned int,  EnvironmentOptions *)}
 53 In file included from /usr/include/ruby-3.0.0/ruby/internal/scan_args.h:35,
 54                  from /usr/include/ruby-3.0.0/ruby/ruby.h:44,
 55                  from /usr/include/ruby-3.0.0/ruby.h:38,
 56                  from lmdb_ext.h:4,
 57                  from lmdb_ext.c:1:
 58 /usr/include/ruby-3.0.0/ruby/internal/intern/hash.h:33:29: note: expected ‘int (*)(VALUE,  VALUE,  VALUE)’ {aka ‘int (*)(long unsigned int,  long unsigned int,  long unsigned int)’} but argument is of type ‘int (*)(VALUE,  VALUE,  EnvironmentOptions *)’ {aka ‘int (*)(long unsigned int
    ,  long unsigned int,  EnvironmentOptions *)’}                                                  
 59    33 | void rb_hash_foreach(VALUE, int (*)(VALUE, VALUE, VALUE), VALUE);
 60       |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
 61 lmdb_ext.c: In function ‘environment_database’:                                                 
 62 lmdb_ext.c:895:46: warning: passing argument 2 of ‘rb_hash_foreach’ from incompatible pointer type [-Wincompatible-pointer-types]                                                              
 63   895 |                 rb_hash_foreach(option_hash, database_flags, (VALUE)&flags);            
 64       |                                              ^~~~~~~~~~~~~~
 65       |                                              |
 66       |                                              int (*)(VALUE,  VALUE,  int *) {aka int (*    )(long unsigned int,  long unsigned int,  int *)}
 67 In file included from /usr/include/ruby-3.0.0/ruby/internal/scan_args.h:35,
 68                  from /usr/include/ruby-3.0.0/ruby/ruby.h:44,                                   
 69                  from /usr/include/ruby-3.0.0/ruby.h:38,                                        
 70                  from lmdb_ext.h:4,                                                             
 71                  from lmdb_ext.c:1:
 72 /usr/include/ruby-3.0.0/ruby/internal/intern/hash.h:33:29: note: expected ‘int (*)(VALUE,  VALUE,  VALUE)’ {aka ‘int (*)(long unsigned int,  long unsigned int,  long unsigned int)’} but argument is of type ‘int (*)(VALUE,  VALUE,  int *)’ {aka ‘int (*)(long unsigned int,  long unsigned int,  int *)’}                                                                                
 73    33 | void rb_hash_foreach(VALUE, int (*)(VALUE, VALUE, VALUE), VALUE);
 74       |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
 75 lmdb_ext.c: In function ‘database_put’:                                                         
 76 lmdb_ext.c:1081:46: warning: passing argument 2 of ‘rb_hash_foreach’ from incompatible pointer     type [-Wincompatible-pointer-types]                                                             
 77  1081 |                 rb_hash_foreach(option_hash, database_put_flags, (VALUE)&flags);
 78       |                                              ^~~~~~~~~~~~~~~~~~                         
 79       |                                              |
 80       |                                              int (*)(VALUE,  VALUE,  int *) {aka int (*    )(long unsigned int,  long unsigned int,  int *)}
 81 In file included from /usr/include/ruby-3.0.0/ruby/internal/scan_args.h:35,
 82                  from /usr/include/ruby-3.0.0/ruby/ruby.h:44,
 83                  from /usr/include/ruby-3.0.0/ruby.h:38,
 84                  from lmdb_ext.h:4,
 85                  from lmdb_ext.c:1:
 86 /usr/include/ruby-3.0.0/ruby/internal/intern/hash.h:33:29: note: expected ‘int (*)(VALUE,  VALUE,  VALUE)’ {aka ‘int (*)(long unsigned int,  long unsigned int,  long unsigned int)’} but argument is of type ‘int (*)(VALUE,  VALUE,  int *)’ {aka ‘int (*)(long unsigned int,  long unsigned int,  int *)’}                                                                                
 87    33 | void rb_hash_foreach(VALUE, int (*)(VALUE, VALUE, VALUE), VALUE);                       
 88       |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~                                
 89 lmdb_ext.c: In function ‘cursor_put’:
 90 lmdb_ext.c:1469:46: warning: passing argument 2 of ‘rb_hash_foreach’ from incompatible pointer
    type [-Wincompatible-pointer-types]
 91  1469 |                 rb_hash_foreach(option_hash, cursor_put_flags, (VALUE)&flags);          
 92       |                                              ^~~~~~~~~~~~~~~~                           
 93       |                                              |                                          
 94       |                                              int (*)(VALUE,  VALUE,  int *) {aka int (*
    )(long unsigned int,  long unsigned int,  int *)}
 95 In file included from /usr/include/ruby-3.0.0/ruby/internal/scan_args.h:35,
 96                  from /usr/include/ruby-3.0.0/ruby/ruby.h:44,
 97                  from /usr/include/ruby-3.0.0/ruby.h:38,                                        
 98                  from lmdb_ext.h:4,                                                             
 99                  from lmdb_ext.c:1:                                                            
100 /usr/include/ruby-3.0.0/ruby/internal/intern/hash.h:33:29: note: expected ‘int (*)(VALUE,  VALUE,  VALUE)’ {aka ‘int (*)(long unsigned int,  long unsigned int,  long unsigned int)’} but argument is of type ‘int (*)(VALUE,  VALUE,  int *)’ {aka ‘int (*)(long unsigned int,  long unsigne    d int,  int *)’}                                                                               
101    33 | void rb_hash_foreach(VALUE, int (*)(VALUE, VALUE, VALUE), VALUE);                      
102       |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~                               
103 lmdb_ext.c: In function ‘cursor_delete’:                                                       
104 lmdb_ext.c:1511:46: warning: passing argument 2 of ‘rb_hash_foreach’ from incompatible pointer     type [-Wincompatible-pointer-types]                                                            
105  1511 |                 rb_hash_foreach(option_hash, cursor_delete_flags, (VALUE)&flags);
106       |                                              ^~~~~~~~~~~~~~~~~~~                       
107       |                                              |                                         
108       |                                              int (*)(VALUE,  VALUE,  int *) {aka int (*    )(long unsigned int,  long unsigned int,  int *)}                                              
109 In file included from /usr/include/ruby-3.0.0/ruby/internal/scan_args.h:35,                    
110                  from /usr/include/ruby-3.0.0/ruby/ruby.h:44,
111                  from /usr/include/ruby-3.0.0/ruby.h:38,                                       
112                  from lmdb_ext.h:4,                                                            
113                  from lmdb_ext.c:1:                                                            
114 /usr/include/ruby-3.0.0/ruby/internal/intern/hash.h:33:29: note: expected ‘int (*)(VALUE,  VALUE,  VALUE)’ {aka ‘int (*)(long unsigned int,  long unsigned int,  long unsigned int)’} but argument is of type ‘int (*)(VALUE,  VALUE,  int *)’ {aka ‘int (*)(long unsigned int,  long unsigned int,  int *)’}
115    33 | void rb_hash_foreach(VALUE, int (*)(VALUE, VALUE, VALUE), VALUE);
116       |                             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~                               
117 linking shared-object lmdb_ext.so                                                              
118                                                                                                
119 current directory: /var/lib/gems/3.0.0/gems/lmdb-0.6/ext/lmdb_ext
120 make DESTDIR\= install                                                                         
121 make: /usr/bin/mkdir: No such file or directory                                                
122 make: *** [Makefile:202: .sitearchdir.time] Error 127                                          
123                                                                                                
124 make install failed, exit code 2                                                               
125                                                                                                
126 Gem files will remain installed in /var/lib/gems/3.0.0/gems/lmdb-0.6 for inspection.           
127 Results logged to /var/lib/gems/3.0.0/extensions/aarch64-linux/3.0.0/lmdb-0.6/gem_make.out

my learning-programming environment is using gcc 11.2,
and if there is anything else you want to know,
pls ask.

Having hit SO many bugs, this system can now be scrubbed every couple of days, & a clean Ubuntu installed, so as to control variables
( bugs in Ruby's system, Haskell's system, in Termux, in Ubuntu, everything,
but we won't be free from 'em without actually getting the things, right? : )

Those are all warnings, not errors. Are you compiling with -Werror?

Anyway, I went and ironed them all out. Try version 0.6.1.