Not building against ruby 3.2.4
When trying to rebuild redmine against ruby 3.2.4 I faced several issues.
After adding ruby-bundler
and ruby-erb
to makedepends
and also adding bundle config build.nokogiri -Wno-error=incompatible-pointer-types
to the build()
function I end up with the following errors:
-> Extracting redmine-5.1.2.tar.gz with bsdtar
==> Starting build()...
You are replacing the current local value of build.nokogiri, which is currently "--use-system-libraries"
Please configure your config/database.yml first
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Writing lockfile to /build/redmine/src/redmine-5.1.2/Gemfile.lock
[DEPRECATED] The `--deployment` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set deployment true`, and stop using this flag
[DEPRECATED] The `--without` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set without 'development test'`, and stop using this
Please configure your config/database.yml first
Please configure your config/database.yml first
Fetching gem metadata from https://rubygems.org/.........
Fetching rake 13.2.1
Installing rake 13.2.1
Fetching nio4r 2.7.3
Fetching websocket-extensions 0.1.5
Fetching commonmarker 0.23.10
Fetching csv 3.2.9
Fetching htmlentities 4.3.4
Fetching concurrent-ruby 1.3.2
Fetching minitest 5.23.1
Fetching zeitwerk 2.6.15
Fetching builder 3.3.0
Fetching erubi 1.12.0
Fetching mini_portile2 2.8.7
Fetching racc 1.8.0
Fetching crass 1.0.6
Fetching rack 2.2.9
Fetching marcel 1.0.4
Fetching mini_mime 1.1.5
Fetching date 3.3.4
Fetching timeout 0.4.1
Fetching method_source 1.1.0
Fetching thor 1.3.1
Fetching public_suffix 5.0.5
Fetching mini_magick 4.12.0
Fetching mysql2 0.5.6
Fetching chunky_png 1.4.0
Installing nio4r 2.7.3 with native extensions
Installing commonmarker 0.23.10 with native extensions
Installing marcel 1.0.4
Fetching net-ldap 0.17.1
Installing chunky_png 1.4.0
Installing zeitwerk 2.6.15
Fetching pg 1.2.3
Installing concurrent-ruby 1.3.2
Installing htmlentities 4.3.4
Fetching rbpdf-font 1.19.1
Installing builder 3.3.0
Installing mini_portile2 2.8.7
Fetching redcarpet 3.6.0
Installing minitest 5.23.1
Fetching strscan 3.1.0
Fetching rotp 6.3.0
Installing erubi 1.12.0
Fetching rouge 4.2.1
Fetching rqrcode_core 1.2.0
Fetching rubyzip 2.3.2
Installing crass 1.0.6
Fetching sqlite3 1.4.4
Installing racc 1.8.0 with native extensions
Installing date 3.3.4 with native extensions
Installing rack 2.2.9
Fetching i18n 1.14.5
Installing mini_mime 1.1.5
Fetching tzinfo 2.0.6
Installing thor 1.3.1
Fetching rack-test 2.1.0
Installing method_source 1.1.0
Fetching sprockets 4.2.1
Installing mini_magick 4.12.0
Fetching request_store 1.5.1
Installing timeout 0.4.1
Fetching net-protocol 0.2.2
Installing public_suffix 5.0.5
Fetching addressable 2.8.6
Installing websocket-extensions 0.1.5
Fetching websocket-driver 0.7.6
Installing mysql2 0.5.6 with native extensions
Installing csv 3.2.9
Installing net-ldap 0.17.1
Installing pg 1.2.3 with native extensions
Fetching nokogiri 1.15.6
Installing redcarpet 3.6.0 with native extensions
Installing strscan 3.1.0 with native extensions
Installing rotp 6.3.0
Installing rqrcode_core 1.2.0
Installing rubyzip 2.3.2
Fetching rqrcode 2.2.0
Installing sqlite3 1.4.4 with native extensions
Installing rouge 4.2.1
Installing i18n 1.14.5
Installing tzinfo 2.0.6
Installing rack-test 2.1.0
Installing sprockets 4.2.1
Installing request_store 1.5.1
Installing net-protocol 0.2.2
Fetching activesupport 6.1.7.7
Fetching net-smtp 0.3.4
Fetching net-pop 0.1.2
Installing addressable 2.8.6
Installing websocket-driver 0.7.6 with native extensions
Fetching css_parser 1.17.1
Installing rbpdf-font 1.19.1
Installing rqrcode 2.2.0
Installing activesupport 6.1.7.7
Installing net-pop 0.1.2
Installing net-smtp 0.3.4
Installing css_parser 1.17.1
Installing nokogiri 1.15.6 with native extensions
Fetching globalid 1.2.1
Fetching activemodel 6.1.7.7
Installing activemodel 6.1.7.7
Installing globalid 1.2.1
Fetching activejob 6.1.7.7
Installing activejob 6.1.7.7
Fetching activerecord 6.1.7.7
Installing activerecord 6.1.7.7
Fetching rbpdf 1.21.3
Installing rbpdf 1.21.3
Fetching rexml 3.2.8
Installing rexml 3.2.8
Fetching net-imap 0.3.7
Installing net-imap 0.3.7
Fetching mail 2.8.1
Installing mail 2.8.1
Fetching rails-dom-testing 2.2.0
Fetching html-pipeline 2.13.2
Fetching roadie 5.2.1
Fetching loofah 2.22.0
Fetching sanitize 6.1.0
Installing rails-dom-testing 2.2.0
Installing loofah 2.22.0
Fetching rails-html-sanitizer 1.6.0
Installing roadie 5.2.1
Installing sanitize 6.1.0
Installing html-pipeline 2.13.2
Fetching deckar01-task_list 2.3.2
Installing rails-html-sanitizer 1.6.0
Fetching actionview 6.1.7.7
Installing deckar01-task_list 2.3.2
Installing actionview 6.1.7.7
Fetching actionpack 6.1.7.7
Installing actionpack 6.1.7.7
Fetching actioncable 6.1.7.7
Fetching actionmailer 6.1.7.7
Fetching railties 6.1.7.7
Fetching sprockets-rails 3.5.1
Fetching activestorage 6.1.7.7
Installing activestorage 6.1.7.7
Fetching actionmailbox 6.1.7.7
Fetching actiontext 6.1.7.7
Installing actioncable 6.1.7.7
Installing actionmailer 6.1.7.7
Installing railties 6.1.7.7
Installing sprockets-rails 3.5.1
Installing actionmailbox 6.1.7.7
Installing actiontext 6.1.7.7
Fetching roadie-rails 3.1.0
Fetching rails 6.1.7.7
Fetching actionpack-xml_parser 2.0.1
Installing roadie-rails 3.1.0
Installing rails 6.1.7.7
Installing actionpack-xml_parser 2.0.1
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /build/redmine/src/redmine-5.1.2/vendor/bundle/ruby/3.2.0/gems/pg-1.2.3/ext
/usr/bin/ruby extconf.rb -Wno-error\=incompatible-pointer-types
checking for pg_config... yes
Using config values from /usr/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... yes
checking for PQsetSingleRowMode()... yes
checking for PQconninfo()... yes
checking for PQsslAttribute()... yes
checking for PQresultVerboseErrorMessage()... yes
checking for PQencryptPasswordConn()... yes
checking for PQresultMemorySize()... yes
checking for timegm()... yes
checking for rb_gc_adjust_memory_usage()... yes
checking for unistd.h... yes
checking for inttypes.h... yes
checking for C99 variable length arrays... yes
creating extconf.h
creating Makefile
current directory: /build/redmine/src/redmine-5.1.2/vendor/bundle/ruby/3.2.0/gems/pg-1.2.3/ext
make DESTDIR\= sitearchdir\=./.gem.20240608-1466-wuaqhj sitelibdir\=./.gem.20240608-1466-wuaqhj clean
current directory: /build/redmine/src/redmine-5.1.2/vendor/bundle/ruby/3.2.0/gems/pg-1.2.3/ext
make DESTDIR\= sitearchdir\=./.gem.20240608-1466-wuaqhj sitelibdir\=./.gem.20240608-1466-wuaqhj
compiling gvl_wrappers.c
compiling pg.c
compiling pg_binary_decoder.c
compiling pg_binary_encoder.c
compiling pg_coder.c
compiling pg_connection.c
compiling pg_errors.c
compiling pg_copy_coder.c
compiling pg_record_coder.c
compiling pg_result.c
compiling pg_text_decoder.c
compiling pg_text_encoder.c
compiling pg_tuple.c
compiling pg_type_map.c
compiling pg_type_map_all_strings.c
compiling pg_type_map_by_class.c
compiling pg_type_map_by_column.c
compiling pg_type_map_by_mri_type.c
compiling pg_type_map_by_oid.c
compiling pg_type_map_in_ruby.c
compiling pg_util.c
pg_result.c: In function ‘init_pg_result’:
pg_result.c:1590:65: error: ‘rb_cData’ undeclared (first use in this function)
1590 | rb_cPGresult = rb_define_class_under( rb_mPG, "Result", rb_cData );
| ^~~~~~~~
pg_result.c:1590:65: note: each undeclared identifier is reported only once for each function it appears in
make: *** [Makefile:247: pg_result.o] Error 1
make: *** Waiting for unfinished jobs....
make failed, exit code 2
Gem files will remain installed in /build/redmine/src/redmine-5.1.2/vendor/bundle/ruby/3.2.0/gems/pg-1.2.3 for inspection.
Results logged to
/build/redmine/src/redmine-5.1.2/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/pg-1.2.3/gem_make.out
/usr/lib/ruby/3.2.0/rubygems/ext/builder.rb:119:in `run'
/usr/lib/ruby/3.2.0/rubygems/ext/builder.rb:53:in `block in make'
/usr/lib/ruby/3.2.0/rubygems/ext/builder.rb:45:in `each'
/usr/lib/ruby/3.2.0/rubygems/ext/builder.rb:45:in `make'
/usr/lib/ruby/3.2.0/rubygems/ext/ext_conf_builder.rb:42:in `build'
/usr/lib/ruby/3.2.0/rubygems/ext/builder.rb:187:in `build_extension'
/usr/lib/ruby/3.2.0/rubygems/ext/builder.rb:221:in `block in build_extensions'
/usr/lib/ruby/3.2.0/rubygems/ext/builder.rb:218:in `each'
/usr/lib/ruby/3.2.0/rubygems/ext/builder.rb:218:in `build_extensions'
/usr/lib/ruby/3.2.0/rubygems/installer.rb:846:in `build_extensions'
/usr/lib/ruby/3.2.0/bundler/rubygems_gem_installer.rb:76:in `build_extensions'
/usr/lib/ruby/3.2.0/bundler/rubygems_gem_installer.rb:28:in `install'
/usr/lib/ruby/3.2.0/bundler/source/rubygems.rb:206:in `install'
/usr/lib/ruby/3.2.0/bundler/installer/gem_installer.rb:54:in `install'
/usr/lib/ruby/3.2.0/bundler/installer/gem_installer.rb:16:in `install_from_spec'
/usr/lib/ruby/3.2.0/bundler/installer/parallel_installer.rb:132:in `do_install'
/usr/lib/ruby/3.2.0/bundler/installer/parallel_installer.rb:123:in `block in worker_pool'
/usr/lib/ruby/3.2.0/bundler/worker.rb:62:in `apply_func'
/usr/lib/ruby/3.2.0/bundler/worker.rb:57:in `block in process_queue'
/usr/lib/ruby/3.2.0/bundler/worker.rb:54:in `loop'
/usr/lib/ruby/3.2.0/bundler/worker.rb:54:in `process_queue'
/usr/lib/ruby/3.2.0/bundler/worker.rb:90:in `block (2 levels) in create_threads'
An error occurred while installing pg (1.2.3), and Bundler cannot continue.
In Gemfile:
pg
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /build/redmine/src/redmine-5.1.2/vendor/bundle/ruby/3.2.0/gems/sqlite3-1.4.4/ext/sqlite3
/usr/bin/ruby extconf.rb -Wno-error\=incompatible-pointer-types
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: /build/redmine/src/redmine-5.1.2/vendor/bundle/ruby/3.2.0/gems/sqlite3-1.4.4/ext/sqlite3
make DESTDIR\= sitearchdir\=./.gem.20240608-1466-vp0r7s sitelibdir\=./.gem.20240608-1466-vp0r7s clean
current directory: /build/redmine/src/redmine-5.1.2/vendor/bundle/ruby/3.2.0/gems/sqlite3-1.4.4/ext/sqlite3
make DESTDIR\= sitearchdir\=./.gem.20240608-1466-vp0r7s sitelibdir\=./.gem.20240608-1466-vp0r7s
compiling aggregator.c
compiling backup.c
compiling database.c
compiling exception.c
compiling sqlite3.c
compiling statement.c
database.c: In function ‘exec_batch’:
database.c:748:57: error: passing argument 3 of ‘sqlite3_exec’ from incompatible pointer type [-Wincompatible-pointer-types]
748 | status = sqlite3_exec(ctx->db, StringValuePtr(sql), hash_callback_function, callback_ary, &errMsg);
| ^~~~~~~~~~~~~~~~~~~~~~
| |
| int (*)(VALUE, int, char **, char **) {aka int (*)(long
unsigned int, int, char **, char **)}
In file included from ./sqlite3_ruby.h:25,
from database.c:1:
/usr/include/sqlite3.h:430:9: note: expected ‘int (*)(void *, int, char **, char **)’ but argument is of type ‘int (*)(VALUE,
int, char **, char **)’ {aka ‘int (*)(long unsigned int, int, char **, char **)’}
430 | int (*callback)(void*,int,char**,char**), /* Callback function */
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
database.c:748:81: error: passing argument 4 of ‘sqlite3_exec’ makes pointer from integer without a cast [-Wint-conversion]
748 | status = sqlite3_exec(ctx->db, StringValuePtr(sql), hash_callback_function, callback_ary, &errMsg);
| ^~~~~~~~~~~~
| |
| VALUE {aka long unsigned int}
/usr/include/sqlite3.h:431:3: note: expected ‘void *’ but argument is of type ‘VALUE’ {aka ‘long unsigned int’}
431 | void *, /* 1st argument to callback */
| ^~~~~~
database.c:750:57: error: passing argument 3 of ‘sqlite3_exec’ from incompatible pointer type [-Wincompatible-pointer-types]
750 | status = sqlite3_exec(ctx->db, StringValuePtr(sql), regular_callback_function, callback_ary, &errMsg);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
| |
| int (*)(VALUE, int, char **, char **) {aka int (*)(long
unsigned int, int, char **, char **)}
/usr/include/sqlite3.h:430:9: note: expected ‘int (*)(void *, int, char **, char **)’ but argument is of type ‘int (*)(VALUE,
int, char **, char **)’ {aka ‘int (*)(long unsigned int, int, char **, char **)’}
430 | int (*callback)(void*,int,char**,char**), /* Callback function */
| ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
database.c:750:84: error: passing argument 4 of ‘sqlite3_exec’ makes pointer from integer without a cast [-Wint-conversion]
750 | status = sqlite3_exec(ctx->db, StringValuePtr(sql), regular_callback_function, callback_ary, &errMsg);
| ^~~~~~~~~~~~
| |
| VALUE {aka long unsigned int}
/usr/include/sqlite3.h:431:3: note: expected ‘void *’ but argument is of type ‘VALUE’ {aka ‘long unsigned int’}
431 | void *, /* 1st argument to callback */
| ^~~~~~
make: *** [Makefile:247: database.o] Error 1
make: *** Waiting for unfinished jobs....
make failed, exit code 2
Gem files will remain installed in /build/redmine/src/redmine-5.1.2/vendor/bundle/ruby/3.2.0/gems/sqlite3-1.4.4 for
inspection.
Results logged to
/build/redmine/src/redmine-5.1.2/vendor/bundle/ruby/3.2.0/extensions/x86_64-linux/3.2.0/sqlite3-1.4.4/gem_make.out
/usr/lib/ruby/3.2.0/rubygems/ext/builder.rb:119:in `run'
/usr/lib/ruby/3.2.0/rubygems/ext/builder.rb:53:in `block in make'
/usr/lib/ruby/3.2.0/rubygems/ext/builder.rb:45:in `each'
/usr/lib/ruby/3.2.0/rubygems/ext/builder.rb:45:in `make'
/usr/lib/ruby/3.2.0/rubygems/ext/ext_conf_builder.rb:42:in `build'
/usr/lib/ruby/3.2.0/rubygems/ext/builder.rb:187:in `build_extension'
/usr/lib/ruby/3.2.0/rubygems/ext/builder.rb:221:in `block in build_extensions'
/usr/lib/ruby/3.2.0/rubygems/ext/builder.rb:218:in `each'
/usr/lib/ruby/3.2.0/rubygems/ext/builder.rb:218:in `build_extensions'
/usr/lib/ruby/3.2.0/rubygems/installer.rb:846:in `build_extensions'
/usr/lib/ruby/3.2.0/bundler/rubygems_gem_installer.rb:76:in `build_extensions'
/usr/lib/ruby/3.2.0/bundler/rubygems_gem_installer.rb:28:in `install'
/usr/lib/ruby/3.2.0/bundler/source/rubygems.rb:206:in `install'
/usr/lib/ruby/3.2.0/bundler/installer/gem_installer.rb:54:in `install'
/usr/lib/ruby/3.2.0/bundler/installer/gem_installer.rb:16:in `install_from_spec'
/usr/lib/ruby/3.2.0/bundler/installer/parallel_installer.rb:132:in `do_install'
/usr/lib/ruby/3.2.0/bundler/installer/parallel_installer.rb:123:in `block in worker_pool'
/usr/lib/ruby/3.2.0/bundler/worker.rb:62:in `apply_func'
/usr/lib/ruby/3.2.0/bundler/worker.rb:57:in `block in process_queue'
/usr/lib/ruby/3.2.0/bundler/worker.rb:54:in `loop'
/usr/lib/ruby/3.2.0/bundler/worker.rb:54:in `process_queue'
/usr/lib/ruby/3.2.0/bundler/worker.rb:90:in `block (2 levels) in create_threads'
An error occurred while installing sqlite3 (1.4.4), and Bundler cannot continue.
In Gemfile:
sqlite3
==> ERROR: A failure occurred in build().
I tried adding the same bundler config line for pg
and sqlite3
but neither helped.