From: "jeremyevans0 (Jeremy Evans) via ruby-core" Date: 2025-08-09T03:49:03+00:00 Subject: [ruby-core:122941] [Ruby Bug#21536] ERROR: Error installing tk: Issue #21536 has been updated by jeremyevans0 (Jeremy Evans). Status changed from Open to Closed The tk extension hasn't shipped with Ruby since Ruby 2.4. The correct place to report this would be https://github.com/ruby/tk/issues. That being said, you could try compiling with `CFLAGS=-std=c99` and/or `CC=c99` and see if that fixes the error. I'm not sure why it is raising an error for what should be a warning, unless `-Werror=incompatible-pointer-types` is being set by default. You could also try compiling with `CFLAGS=-Wno-error=incompatible-pointer-types`. Long-term, the tk extension needs to be updated to support more modern C standards. ---------------------------------------- Bug #21536: ERROR: Error installing tk: https://bugs.ruby-lang.org/issues/21536#change-114247 * Author: sevkme (sevk kk) * Status: Closed * ruby -v: ruby 3.4.4 (2025-05-14 revision a38531fd3f) +YJIT +PRISM [x86_64-linux] * Backport: 3.2: UNKNOWN, 3.3: UNKNOWN, 3.4: UNKNOWN ---------------------------------------- ``` shell kkar4 :: ~ � pacman -Ss tcl | grep install extra/tcl 8.6.16-1 [installed] extra/tk 8.6.16-1 [installed] ``` ``` shell kkar4 :: ~ � CFLAGS="-Wold-style-definition" gem install tk Building native extensions. This could take a while... ERROR: Error installing tk: ERROR: Failed to build gem native extension. current directory: /usr/lib/ruby/gems/3.4.0/gems/tk-0.5.1/ext/tk /usr/bin/ruby extconf.rb check functions.checking for ruby_native_thread_p() in ruby.h... yes checking for rb_errinfo() in ruby.h... yes checking for rb_hash_lookup() in ruby.h... yes checking for rb_proc_new() in ruby.h... yes checking for rb_sourcefile() in ruby.h... yes checking for rb_thread_alive_p() in ruby.h... no checking for rb_thread_check_trap_pending() in ruby.h... yes checking for ruby_enc_find_basename() in ruby.h... yes check libraries.checking for t_open() in -lnsl... no checking for socket() in -lsocket... no checking for dlopen() in -ldl... yes checking for log() in -lm... yes Use ActiveTcl libraries (if available). Search tclConfig.sh and tkConfig.sh. Valid [tclConfig.sh, tkConfig.sh] are found in [["/usr/lib", "/usr/lib"], ["/usr/lib64", "/usr/lib64"]] Use [tclConfig.sh, tkConfig.sh] == ["/usr/lib/tclConfig.sh", "/usr/lib/tkConfig.sh"] Use X11 libraries (or use TK_XINCLUDES/TK_XLIBSW information on tkConfig.sh). checking for XOpenDisplay() in -lX11... yes creating Makefile Find Tcl/Tk libraries. Make tcltklib.so which is required by Ruby/Tk. current directory: /usr/lib/ruby/gems/3.4.0/gems/tk-0.5.1/ext/tk make DESTDIR\= sitearchdir\=./.gem.20250809-2512403-8d3buu sitelibdir\=./.gem.20250809-2512403-8d3buu clean current directory: /usr/lib/ruby/gems/3.4.0/gems/tk-0.5.1/ext/tk make DESTDIR\= sitearchdir\=./.gem.20250809-2512403-8d3buu sitelibdir\=./.gem.20250809-2512403-8d3buu compiling stubs.c stubs.c: In function '_nativethread_consistency_check': stubs.c:42:1: warning: old-style function definition [-Wold-style-definition] 42 | _nativethread_consistency_check(ip) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ compiling tcltklib.c tcltklib.c: In function 'get_ip': tcltklib.c:784:1: warning: old-style function definition [-Wold-style-definition] 784 | get_ip(self) | ^~~~~~ tcltklib.c: In function 'deleted_ip': tcltklib.c:802:1: warning: old-style function definition [-Wold-style-definition] 802 | deleted_ip(ptr) | ^~~~~~~~~~ tcltklib.c: In function 'rbtk_preserve_ip': tcltklib.c:818:1: warning: old-style function definition [-Wold-style-definition] 818 | rbtk_preserve_ip(ptr) | ^~~~~~~~~~~~~~~~ tcltklib.c: In function 'rbtk_release_ip': tcltklib.c:832:1: warning: old-style function definition [-Wold-style-definition] 832 | rbtk_release_ip(ptr) | ^~~~~~~~~~~~~~~ tcltklib.c: In function 'tcltkip_init_tk': tcltklib.c:1327:1: warning: old-style function definition [-Wold-style-definition] 1327 | tcltkip_init_tk(interp) | ^~~~~~~~~~~~~~~ tcltklib.c: In function 'pending_exception_check1': tcltklib.c:1435:1: warning: old-style function definition [-Wold-style-definition] 1435 | pending_exception_check1(thr_crit_bup, ptr) | ^~~~~~~~~~~~~~~~~~~~~~~~ tcltklib.c: In function 'call_original_exit': tcltklib.c:1480:1: warning: old-style function definition [-Wold-style-definition] 1480 | call_original_exit(ptr, state) | ^~~~~~~~~~~~~~~~~~ tcltklib.c: In function '_timer_for_tcl': tcltklib.c:1631:1: warning: old-style function definition [-Wold-style-definition] 1631 | _timer_for_tcl(clientData) | ^~~~~~~~~~~~~~ tcltklib.c: In function 'set_eventloop_window_mode': tcltklib.c:1682:1: warning: old-style function definition [-Wold-style-definition] 1682 | set_eventloop_window_mode(self, mode) | ^~~~~~~~~~~~~~~~~~~~~~~~~ tcltklib.c: In function 'get_eventloop_window_mode': tcltklib.c:1697:1: warning: old-style function definition [-Wold-style-definition] 1697 | get_eventloop_window_mode(self) | ^~~~~~~~~~~~~~~~~~~~~~~~~ tcltklib.c: In function 'set_eventloop_tick': tcltklib.c:1708:1: warning: old-style function definition [-Wold-style-definition] 1708 | set_eventloop_tick(self, tick) | ^~~~~~~~~~~~~~~~~~ tcltklib.c: In function 'get_eventloop_tick': tcltklib.c:1742:1: warning: old-style function definition [-Wold-style-definition] 1742 | get_eventloop_tick(self) | ^~~~~~~~~~~~~~~~~~ tcltklib.c: In function 'ip_set_eventloop_tick': tcltklib.c:1749:1: warning: old-style function definition [-Wold-style-definition] 1749 | ip_set_eventloop_tick(self, tick) | ^~~~~~~~~~~~~~~~~~~~~ tcltklib.c: In function 'ip_get_eventloop_tick': tcltklib.c:1768:1: warning: old-style function definition [-Wold-style-definition] 1768 | ip_get_eventloop_tick(self) | ^~~~~~~~~~~~~~~~~~~~~ tcltklib.c: In function 'set_no_event_wait': tcltklib.c:1775:1: warning: old-style function definition [-Wold-style-definition] 1775 | set_no_event_wait(self, wait) | ^~~~~~~~~~~~~~~~~ tcltklib.c: In function 'get_no_event_wait': tcltklib.c:1793:1: warning: old-style function definition [-Wold-style-definition] 1793 | get_no_event_wait(self) | ^~~~~~~~~~~~~~~~~ tcltklib.c: In function 'ip_set_no_event_wait': tcltklib.c:1800:1: warning: old-style function definition [-Wold-style-definition] 1800 | ip_set_no_event_wait(self, wait) | ^~~~~~~~~~~~~~~~~~~~ tcltklib.c: In function 'ip_get_no_event_wait': tcltklib.c:1819:1: warning: old-style function definition [-Wold-style-definition] 1819 | ip_get_no_event_wait(self) | ^~~~~~~~~~~~~~~~~~~~ tcltklib.c: In function 'set_eventloop_weight': tcltklib.c:1826:1: warning: old-style function definition [-Wold-style-definition] 1826 | set_eventloop_weight(self, loop_max, no_event) | ^~~~~~~~~~~~~~~~~~~~ tcltklib.c: In function 'get_eventloop_weight': tcltklib.c:1846:1: warning: old-style function definition [-Wold-style-definition] 1846 | get_eventloop_weight(self) | ^~~~~~~~~~~~~~~~~~~~ tcltklib.c: In function 'ip_set_eventloop_weight': tcltklib.c:1853:1: warning: old-style function definition [-Wold-style-definition] 1853 | ip_set_eventloop_weight(self, loop_max, no_event) | ^~~~~~~~~~~~~~~~~~~~~~~ tcltklib.c: In function 'ip_get_eventloop_weight': tcltklib.c:1873:1: warning: old-style function definition [-Wold-style-definition] 1873 | ip_get_eventloop_weight(self) | ^~~~~~~~~~~~~~~~~~~~~~~ tcltklib.c: In function 'set_max_block_time': tcltklib.c:1880:1: warning: old-style function definition [-Wold-style-definition] 1880 | set_max_block_time(self, time) | ^~~~~~~~~~~~~~~~~~ tcltklib.c: In function 'lib_evloop_thread_p': tcltklib.c:1913:1: warning: old-style function definition [-Wold-style-definition] 1913 | lib_evloop_thread_p(self) | ^~~~~~~~~~~~~~~~~~~ tcltklib.c: In function 'lib_evloop_abort_on_exc': tcltklib.c:1926:1: warning: old-style function definition [-Wold-style-definition] 1926 | lib_evloop_abort_on_exc(self) | ^~~~~~~~~~~~~~~~~~~~~~~ tcltklib.c: In function 'ip_evloop_abort_on_exc': tcltklib.c:1939:1: warning: old-style function definition [-Wold-style-definition] 1939 | ip_evloop_abort_on_exc(self) | ^~~~~~~~~~~~~~~~~~~~~~ tcltklib.c: In function 'lib_evloop_abort_on_exc_set': tcltklib.c:1946:1: warning: old-style function definition [-Wold-style-definition] 1946 | lib_evloop_abort_on_exc_set(self, val) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ tcltklib.c: In function 'ip_evloop_abort_on_exc_set': tcltklib.c:1960:1: warning: old-style function definition [-Wold-style-definition] 1960 | ip_evloop_abort_on_exc_set(self, val) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ tcltklib.c: In function 'lib_num_of_mainwindows_core': tcltklib.c:1979:1: warning: old-style function definition [-Wold-style-definition] 1979 | lib_num_of_mainwindows_core(self, argc, argv) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~ tcltklib.c: In function 'lib_num_of_mainwindows': tcltklib.c:1992:1: warning: old-style function definition [-Wold-style-definition] 1992 | lib_num_of_mainwindows(self) | ^~~~~~~~~~~~~~~~~~~~~~ tcltklib.c: In function 'call_DoOneEvent': tcltklib.c:2045:21: error: passing argument 1 of 'tk_funcall' from incompatible pointer type [-Wincompatible-pointer-types] 2045 | return tk_funcall(call_DoOneEvent_core, 0, (VALUE*)NULL, flag_val); | ^~~~~~~~~~~~~~~~~~~~ | | | VALUE (*)(VALUE) {aka long unsigned int (*)(long unsigned int)} In file included from /usr/include/ruby-3.4.0/ruby/defines.h:77, from /usr/include/ruby-3.4.0/ruby/ruby.h:25, from /usr/include/ruby-3.4.0/ruby.h:38, from tcltklib.c:10: tcltklib.c:258:28: note: expected 'VALUE (*)(void)' {aka 'long unsigned int (*)(void)'} but argument is of type 'VALUE (*)(VALUE)' {aka 'long unsigned int (*)(long unsigned int)'} 258 | static VALUE tk_funcall _((VALUE(), int, VALUE*, VALUE)); | ^~~~~~~ /usr/include/ruby-3.4.0/ruby/backward/2/stdarg.h:33:18: note: in definition of macro '_' 33 | # define _(args) args | ^~~~ tcltklib.c:2021:1: note: 'call_DoOneEvent_core' declared here 2021 | call_DoOneEvent_core(VALUE flag_val) | ^~~~~~~~~~~~~~~~~~~~ tcltklib.c: In function 'lib_eventloop_core': tcltklib.c:2197:1: warning: old-style function definition [-Wold-style-definition] 2197 | lib_eventloop_core(check_root, update_flag, check_var, interp) | ^~~~~~~~~~~~~~~~~~ ``` -- https://bugs.ruby-lang.org/ ______________________________________________ ruby-core mailing list -- ruby-core@ml.ruby-lang.org To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.ruby-lang.org/