rootstrap / active-storage-base64

Base64 support for ActiveStorage
https://rootstrap.com
MIT License
161 stars 16 forks source link

[Bug] Can't install dependency of sqlite3 gem v 1.4.1 on Ruby 3 (v 1.4.2 works) #64

Closed megatux closed 3 years ago

megatux commented 3 years ago

Bug report:

$ gem install sqlite3 --version 1.4.1
Building native extensions. This could take a while...
ERROR:  Error installing sqlite3:
    ERROR: Failed to build gem native extension.

    current directory: /Users/megatux/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/sqlite3-1.4.1/ext/sqlite3
/Users/megatux/.asdf/installs/ruby/3.0.0/bin/ruby -I /Users/megatux/.asdf/installs/ruby/3.0.0/lib/ruby/3.0.0 -r ./siteconf20211016-57690-zpsioe.rb extconf.rb
checking for sqlite3.h... yes
checking for pthread_create() in -lpthread... yes
checking for -ldl... yes
checking for sqlite3_libversion_number() in -lsqlite3... yes
checking for rb_proc_arity()... yes
checking for rb_integer_pack()... yes
checking for sqlite3_initialize()... yes
checking for sqlite3_backup_init()... yes
checking for sqlite3_column_database_name()... yes
checking for sqlite3_enable_load_extension()... yes
checking for sqlite3_load_extension()... yes
checking for sqlite3_open_v2()... yes
checking for sqlite3_prepare_v2()... yes
checking for sqlite3_int64 in sqlite3.h... yes
checking for sqlite3_uint64 in sqlite3.h... yes
creating Makefile

current directory: /Users/megatux/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/sqlite3-1.4.1/ext/sqlite3
make "DESTDIR=" clean

current directory: /Users/megatux/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/sqlite3-1.4.1/ext/sqlite3
make "DESTDIR="
compiling aggregator.c
compiling backup.c
compiling database.c
database.c:45:3: error: implicit declaration of function 'rb_check_safe_obj' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  rb_check_safe_obj(file);
  ^
database.c:45:3: note: did you mean 'rb_check_safe_str'?
/Users/megatux/.asdf/installs/ruby/3.0.0/include/ruby-3.0.0/ruby/internal/core/rstring.h:97:6: note: 'rb_check_safe_str' declared here
void rb_check_safe_str(VALUE);
     ^
database.c:38:9: warning: unused variable 'flags' [-Wunused-variable]
  VALUE flags;
        ^
database.c:107:18: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
  return INT2NUM((long)sqlite3_total_changes(ctx->db));
         ~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
database.c:148:67: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
  VALUE result = rb_funcall(handle, rb_intern("call"), 1, INT2NUM((long)count));
                                                          ~~~~~~~ ^~~~~~~~~~~
database.c:393:18: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
  return INT2NUM((long)sqlite3_errcode(ctx->db));
         ~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
database.c:724:57: warning: incompatible function pointer types passing 'int (VALUE, int, char **, char **)' (aka 'int (unsigned long, int, char **, char **)') to parameter of type 'int (*)(void *, int, char **, char **)' [-Wincompatible-function-pointer-types]
    status = sqlite3_exec(ctx->db, StringValuePtr(sql), hash_callback_function, callback_ary, &errMsg);
                                                        ^~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/sqlite/3.36.0/include/sqlite3.h:405:9: note: passing argument to parameter 'callback' here
  int (*callback)(void*,int,char**,char**),  /* Callback function */
        ^
database.c:724:81: warning: incompatible integer to pointer conversion passing 'VALUE' (aka 'unsigned long') to parameter of type 'void *' [-Wint-conversion]
    status = sqlite3_exec(ctx->db, StringValuePtr(sql), hash_callback_function, callback_ary, &errMsg);
                                                                                ^~~~~~~~~~~~
/opt/homebrew/Cellar/sqlite/3.36.0/include/sqlite3.h:406:9: note: passing argument to parameter here
  void *,                                    /* 1st argument to callback */
        ^
database.c:726:57: warning: incompatible function pointer types passing 'int (VALUE, int, char **, char **)' (aka 'int (unsigned long, int, char **, char **)') to parameter of type 'int (*)(void *, int, char **, char **)' [-Wincompatible-function-pointer-types]
    status = sqlite3_exec(ctx->db, StringValuePtr(sql), regular_callback_function, callback_ary, &errMsg);
                                                        ^~~~~~~~~~~~~~~~~~~~~~~~~
/opt/homebrew/Cellar/sqlite/3.36.0/include/sqlite3.h:405:9: note: passing argument to parameter 'callback' here
  int (*callback)(void*,int,char**,char**),  /* Callback function */
        ^
database.c:726:84: warning: incompatible integer to pointer conversion passing 'VALUE' (aka 'unsigned long') to parameter of type 'void *' [-Wint-conversion]
    status = sqlite3_exec(ctx->db, StringValuePtr(sql), regular_callback_function, callback_ary, &errMsg);
                                                                                   ^~~~~~~~~~~~
/opt/homebrew/Cellar/sqlite/3.36.0/include/sqlite3.h:406:9: note: passing argument to parameter here
  void *,                                    /* 1st argument to callback */
        ^
database.c:766:3: error: implicit declaration of function 'rb_check_safe_obj' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  rb_check_safe_obj(file);
  ^
8 warnings and 2 errors generated.
make: *** [database.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/megatux/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/gems/sqlite3-1.4.1 for inspection.
Results logged to /Users/megatux/.asdf/installs/ruby/3.0.0/lib/ruby/gems/3.0.0/extensions/arm64-darwin-20/3.0.0/sqlite3-1.4.1/gem_make.out