Work around Ruby 3.1 pkg_config limitations

Pull in the Ruby master mkmf.rb temporarily.
Note that ruby-magic.c doesn't compile in the rake-compiler-dock environment, failing with:
In file included from ../../../../ext/magic/functions.h:8,
                 from ../../../../ext/magic/functions.c:5:
../../../../ext/magic/common.h: At top level:
../../../../ext/magic/common.h:142:11: fatal error: rubysig.h: No such file or directory
  142 | # include <rubysig.h>
      |           ^~~~~~~~~~~
compilation terminated.
In file included from ../../../../ext/magic/ruby-magic.h:8,
                 from ../../../../ext/magic/ruby-magic.c:5:
../../../../ext/magic/common.h: At top level:
../../../../ext/magic/common.h:142:11: fatal error: rubysig.h: No such file or directory
  142 | # include <rubysig.h>
      |           ^~~~~~~~~~~
compilation terminated.

which comes from the GVL/blocking region section in common.h. I don't know how to resolve that, and I'm asking for help @stanhu @kwilczynski

Hi @flavorjones,
Let me look into this! The rubysig.h was to be deprecated for a while now, I suppose, it finally happened. Bear with me!
Krzysztof

Hi @flavorjones,
Using your branch and my local Ruby 3.1.0 things seem to work perfectly as per:

I had to make sure nothing broke with this latest release of Ruby. Next, let me try the rake-compiler/rake-compiler-dock environment.
Also, we never had issues with this before Ruby 3.1, I believe.

You'll see the failure if you run rake gem:x86_64-linux and build in the rake-compiler-dock image.

Hi @flavorjones,
Oops! Sorry for closing this Pull Request by accident. My cat decided to have a nap on the keyboard when I was momentarily doing something else.

Sincere apologies!

@kwilczynski Can your cat fix other bugs? Asking for a friend.

Hi @flavorjones,

You should also check by running rake gem:x86_64-linux and build in the rake-compiler-dock image. That ruby has different compile-time options than my ruby-build-installed ruby on my host (and so might yours?)

This is what I am doing at the moment. And there is a very curious thing about this Docker container. For example, the following works fine:

Works
$ RCD_PLATFORM=x86_64-linux rake-compiler-dock
[kwilczynski@9feaa209b219 ruby-magic]$ ruby -v
ruby 3.1.0p0 (2021-12-25 revision fb4df44d16) [x86_64-linux]
[kwilczynski@9feaa209b219 ruby-magic]$ bundle install
Fetching gem metadata from https://rubygems.org/.
Bundler 2.3.4 is running, but your lockfile was generated with 2.3.5. Installing Bundler 2.3.5 and restarting using that version.
Fetching bundler 2.3.5
Installing bundler 2.3.5
Fetching gem metadata from https://rubygems.org/.........
Using rake 13.0.6
Using bundler 2.3.5
Fetching coderay 1.1.3
Fetching ffi 1.15.5
Fetching formatador 0.3.0
Fetching thor 1.2.1
Fetching lumberjack 1.2.8
Fetching rb-fsevent 0.11.0
Fetching shellany 0.0.1
Using mini_portile2 2.7.1
Fetching mocha 1.13.0
Fetching rainbow 3.1.1
Using power_assert 2.0.1
Using stringio 3.0.1
Fetching guard-compat 1.2.1
Fetching rake-compiler 1.1.7
Fetching rake-compiler-dock 1.2.0
Fetching nenv 0.3.0
Fetching parallel 1.21.0
Fetching ast 2.4.2
Fetching method_source 1.0.0
Installing formatador 0.3.0
Installing shellany 0.0.1
Installing lumberjack 1.2.8
Installing rainbow 3.1.1
Installing nenv 0.3.0
Installing rake-compiler 1.1.7
Installing thor 1.2.1
Installing method_source 1.0.0
Installing parallel 1.21.0
Installing ast 2.4.2
Installing guard-compat 1.2.1
Installing rake-compiler-dock 1.2.0
Installing coderay 1.1.3
Installing mocha 1.13.0
Installing rb-fsevent 0.11.0
Fetching regexp_parser 2.2.0
Using rexml 3.2.5
Fetching ruby-progressbar 1.11.0
Fetching unicode-display_width 2.1.0
Using ruby-magic 0.5.3 from source at `.`
Using test-unit 3.5.3
Using psych 4.0.3
Fetching parser <IP_ADDRESS>
Installing ffi 1.15.5 with native extensions
Using rdoc 6.4.0
Installing ruby-progressbar 1.11.0
Installing regexp_parser 2.2.0
Fetching notiffany 0.1.3
Installing unicode-display_width 2.1.0
Fetching pry 0.14.1
Installing notiffany 0.1.3
Installing parser <IP_ADDRESS>
Installing pry 0.14.1
Fetching rubocop-ast 1.15.1
Installing rubocop-ast 1.15.1
Fetching rubocop 1.24.1
Installing rubocop 1.24.1
Fetching rb-inotify 0.10.1
Installing rb-inotify 0.10.1
Fetching listen 3.7.1
Installing listen 3.7.1
Fetching guard 2.18.0
Installing guard 2.18.0
Fetching guard-bundler 3.0.0
Fetching guard-rake 1.0.0
Installing guard-rake 1.0.0
Installing guard-bundler 3.0.0
Bundle complete! 11 Gemfile dependencies, 39 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
[kwilczynski@9feaa209b219 ruby-magic]$ gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 3.3.4
  - RUBY VERSION: 3.1.0 (2021-12-25 patchlevel 0) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/local/rvm/gems/ruby-3.1.0
  - USER INSTALLATION DIRECTORY: /tmp/home/kwilczynski/.gem/ruby/3.1.0
  - RUBY EXECUTABLE: /usr/local/rvm/rubies/ruby-3.1.0/bin/ruby
  - GIT EXECUTABLE: /bin/git
  - EXECUTABLE DIRECTORY: /usr/local/rvm/gems/ruby-3.1.0/bin
  - SPEC CACHE DIRECTORY: /tmp/home/kwilczynski/.local/share/gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: /usr/local/rvm/rubies/ruby-3.1.0/etc
  - RUBYGEMS PLATFORMS:
     - ruby
     - x86_64-linux
  - GEM PATHS:
     - /usr/local/rvm/gems/ruby-3.1.0
     - /usr/local/rvm/rubies/ruby-3.1.0/lib/ruby/gems/3.1.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /opt/rh/devtoolset-10/root/usr/bin
     - /usr/local/rvm/gems/ruby-3.1.0/bin
     - /usr/local/rvm/gems/ruby-3.1.0@global/bin
     - /usr/local/rvm/rubies/ruby-3.1.0/bin
     - /usr/local/rvm/bin
     - /sbin
     - /bin
     - /usr/sbin
     - /usr/bin
[kwilczynski@9feaa209b219 ruby-magic]$ rvm list
Warning! PATH is not properly set up, /usr/local/rvm/gems/ruby-3.1.0/bin is not at first place.
         Usually this is caused by shell initialization files. Search for PATH=... entries.
         You can also re-add RVM to your profile by running: rvm get stable --auto-dotfiles
         To fix it temporarily in this shell session run: rvm use ruby-3.1.0
         To ignore this error add rvm_silence_path_mismatch_check_flag=1 to your ~/.rvmrc file.
   ruby-2.5.9 [ x86_64 ]
=* ruby-3.1.0 [ x86_64 ]

# => - current
# =* - current && default
#  * - default

[kwilczynski@9feaa209b219 ruby-magic]$ ruby ext/magic/extconf.rb
Building ruby-magic using packaged libraries.
Static linking is enabled.
Cross build is disabled.
Using mini_portile version 2.7.1
Building Ruby Magic with a packaged version of libmagic-5.39.
Activating libmagic 5.39 (from /home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ports/x86_64-pc-linux-gnu/libmagic/5.39)...
checking for ruby.h... yes
checking for -lpthread... yes
checking for -lrt... yes
checking for -ldl... yes
checking for -lcrypt... yes
checking for rb_thread_call_without_gvl()... yes
checking for rb_thread_blocking_region()... no
checking for magic.h... yes
checking for -lmagic... yes
checking for magic_getpath()... yes
checking for magic_getflags()... yes
checking for utime.h... yes
checking for sys/types.h... yes
checking for sys/time.h... yes
checking for utime()... yes
checking for utimes()... yes
creating extconf.h
creating Makefile
[kwilczynski@9feaa209b219 ruby-magic]$ make
compiling ext/magic/functions.c
In file included from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:42,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/int.h:26,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/char.h:23,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic.h:23,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/ruby.h:27,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby.h:38,
                 from ext/magic/common.h:32,
                 from ext/magic/functions.h:8,
                 from ext/magic/functions.c:5:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/special_consts.h: In function ‘RB_TEST’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/special_consts.h:148:16: warning: unsigned conversion from ‘int’ to ‘VALUE’ {aka ‘long unsigned int’} changes value from ‘-9’ to ‘18446744073709551607’ [-Wsign-conversion]
  148 |     return obj & ~RUBY_Qnil;
      |                ^
In file included from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/int.h:26,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/char.h:23,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic.h:23,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/ruby.h:27,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby.h:38,
                 from ext/magic/common.h:32,
                 from ext/magic/functions.h:8,
                 from ext/magic/functions.c:5:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h: In function ‘RB_INT2FIX’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:117:29: warning: conversion to ‘long unsigned int’ from ‘long int’ may change the sign of the result [-Wsign-conversion]
  117 |     const unsigned long j = i;
      |                             ^
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:119:29: warning: conversion to ‘long int’ from ‘long unsigned int’ may change the sign of the result [-Wsign-conversion]
  119 |     const long          l = k;
      |                             ^
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:121:29: warning: conversion to ‘VALUE’ {aka ‘const long unsigned int’} from ‘long int’ may change the sign of the result [-Wsign-conversion]
  121 |     const VALUE         n = m;
      |                             ^
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h: In function ‘rbimpl_fix2long_by_idiv’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:169:28: warning: conversion to ‘long int’ from ‘VALUE’ {aka ‘long unsigned int’} may change the sign of the result [-Wsign-conversion]
  169 |     const SIGNED_VALUE y = x - RUBY_FIXNUM_FLAG;
      |                            ^
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h: In function ‘rbimpl_fix2long_by_shift’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:196:28: warning: conversion to ‘long int’ from ‘VALUE’ {aka ‘long unsigned int’} may change the sign of the result [-Wsign-conversion]
  196 |     const SIGNED_VALUE y = x;
      |                            ^
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h: In function ‘rb_fix2ulong’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:255:12: warning: conversion to ‘long unsigned int’ from ‘long int’ may change the sign of the result [-Wsign-conversion]
  255 |     return rb_fix2long(x);
      |            ^~~~~~~~~~~~~~
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h: In function ‘rb_ulong2num_inline’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:326:28: warning: conversion to ‘long int’ from ‘long unsigned int’ may change the sign of the result [-Wsign-conversion]
  326 |         return RB_LONG2FIX(v);
      |                            ^
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long_long.h: In function ‘rb_num2ull_inline’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:53:22: warning: conversion to ‘long long unsigned int’ from ‘long int’ may change the sign of the result [-Wsign-conversion]
   53 | #define RB_FIX2LONG  rb_fix2long          /**< @alias{rb_fix2long} */
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long_long.h:130:16: note: in expansion of macro ‘RB_FIX2LONG’
  130 |         return RB_FIX2LONG(x);
      |                ^~~~~~~~~~~
In file included from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic.h:36,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/ruby.h:27,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby.h:38,
                 from ext/magic/common.h:32,
                 from ext/magic/functions.h:8,
                 from ext/magic/functions.c:5:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/st_data_t.h: In function ‘RB_ST2FIX’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/st_data_t.h:61:22: warning: conversion to ‘long int’ from ‘st_data_t’ {aka ‘long unsigned int’} may change the sign of the result [-Wsign-conversion]
   61 |     SIGNED_VALUE x = i;
      |                      ^
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/st_data_t.h:72:24: warning: conversion to ‘long int’ from ‘long unsigned int’ may change the sign of the result [-Wsign-conversion]
   72 |     return RB_LONG2FIX(y);
      |                        ^
In file included from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/assume.h:29,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/backward/2/assume.h:24,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/defines.h:72,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/ruby.h:25,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby.h:38,
                 from ext/magic/common.h:32,
                 from ext/magic/functions.h:8,
                 from ext/magic/functions.c:5:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/core/rarray.h: In function ‘RARRAY_PTR’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/core/rarray.h:556:24: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
  556 |     return RBIMPL_CAST((VALUE *)RARRAY_CONST_PTR(tmp));
      |                        ^
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/cast.h:31:29: note: in definition of macro ‘RBIMPL_CAST’
   31 | # define RBIMPL_CAST(expr) (expr)
      |                             ^~~~
In file included from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/ruby.h:41,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby.h:38,
                 from ext/magic/common.h:32,
                 from ext/magic/functions.h:8,
                 from ext/magic/functions.c:5:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/memory.h: In function ‘rb_alloc_tmp_buffer2’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/memory.h:642:56: warning: conversion to ‘size_t’ {aka ‘long unsigned int’} from ‘long int’ may change the sign of the result [-Wsign-conversion]
  642 |     const size_t total_size = rbimpl_size_mul_or_raise(count, elsize);
      |                                                        ^~~~~
In file included from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/ctype.h:27,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/encoding.h:22,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/io.h:16,
                 from ext/magic/common.h:36,
                 from ext/magic/functions.h:8,
                 from ext/magic/functions.c:5:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/encoding.h: In function ‘RB_ENCODING_SET_INLINED’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/encoding.h:82:28: warning: conversion to ‘VALUE’ {aka ‘long unsigned int’} from ‘int’ may change the sign of the result [-Wsign-conversion]
   82 |     VALUE f = /* upcast */ encindex;
      |                            ^~~~~~~~
In file included from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/assume.h:29,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/backward/2/assume.h:24,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/defines.h:72,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/ruby.h:25,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby.h:38,
                 from ext/magic/common.h:32,
                 from ext/magic/functions.h:8,
                 from ext/magic/functions.c:5:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/encoding.h: In function ‘rb_enc_step_back’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/encoding.h:747:24: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
  747 |     return RBIMPL_CAST((char *)ur);
      |                        ^
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/cast.h:31:29: note: in definition of macro ‘RBIMPL_CAST’
   31 | # define RBIMPL_CAST(expr) (expr)
      |                             ^~~~
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/ctype.h: In function ‘rb_enc_is_newline’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/ctype.h:45:33: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
   45 |     OnigUChar *up = RBIMPL_CAST((OnigUChar *)p);
      |                                 ^
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/cast.h:31:29: note: in definition of macro ‘RBIMPL_CAST’
   31 | # define RBIMPL_CAST(expr) (expr)
      |                             ^~~~
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/ctype.h:46:33: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
   46 |     OnigUChar *ue = RBIMPL_CAST((OnigUChar *)e);
      |                                 ^
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/cast.h:31:29: note: in definition of macro ‘RBIMPL_CAST’
   31 | # define RBIMPL_CAST(expr) (expr)
      |                             ^~~~
compiling ext/magic/ruby-magic.c
In file included from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:42,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/int.h:26,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/char.h:23,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic.h:23,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/ruby.h:27,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby.h:38,
                 from ext/magic/common.h:32,
                 from ext/magic/ruby-magic.h:8,
                 from ext/magic/ruby-magic.c:5:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/special_consts.h: In function ‘RB_TEST’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/special_consts.h:148:16: warning: unsigned conversion from ‘int’ to ‘VALUE’ {aka ‘long unsigned int’} changes value from ‘-9’ to ‘18446744073709551607’ [-Wsign-conversion]
  148 |     return obj & ~RUBY_Qnil;
      |                ^
In file included from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/int.h:26,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/char.h:23,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic.h:23,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/ruby.h:27,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby.h:38,
                 from ext/magic/common.h:32,
                 from ext/magic/ruby-magic.h:8,
                 from ext/magic/ruby-magic.c:5:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h: In function ‘RB_INT2FIX’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:117:29: warning: conversion to ‘long unsigned int’ from ‘long int’ may change the sign of the result [-Wsign-conversion]
  117 |     const unsigned long j = i;
      |                             ^
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:119:29: warning: conversion to ‘long int’ from ‘long unsigned int’ may change the sign of the result [-Wsign-conversion]
  119 |     const long          l = k;
      |                             ^
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:121:29: warning: conversion to ‘VALUE’ {aka ‘const long unsigned int’} from ‘long int’ may change the sign of the result [-Wsign-conversion]
  121 |     const VALUE         n = m;
      |                             ^
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h: In function ‘rbimpl_fix2long_by_idiv’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:169:28: warning: conversion to ‘long int’ from ‘VALUE’ {aka ‘long unsigned int’} may change the sign of the result [-Wsign-conversion]
  169 |     const SIGNED_VALUE y = x - RUBY_FIXNUM_FLAG;
      |                            ^
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h: In function ‘rbimpl_fix2long_by_shift’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:196:28: warning: conversion to ‘long int’ from ‘VALUE’ {aka ‘long unsigned int’} may change the sign of the result [-Wsign-conversion]
  196 |     const SIGNED_VALUE y = x;
      |                            ^
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h: In function ‘rb_fix2ulong’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:255:12: warning: conversion to ‘long unsigned int’ from ‘long int’ may change the sign of the result [-Wsign-conversion]
  255 |     return rb_fix2long(x);
      |            ^~~~~~~~~~~~~~
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h: In function ‘rb_ulong2num_inline’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:326:28: warning: conversion to ‘long int’ from ‘long unsigned int’ may change the sign of the result [-Wsign-conversion]
  326 |         return RB_LONG2FIX(v);
      |                            ^
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long_long.h: In function ‘rb_num2ull_inline’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:53:22: warning: conversion to ‘long long unsigned int’ from ‘long int’ may change the sign of the result [-Wsign-conversion]
   53 | #define RB_FIX2LONG  rb_fix2long          /**< @alias{rb_fix2long} */
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long_long.h:130:16: note: in expansion of macro ‘RB_FIX2LONG’
  130 |         return RB_FIX2LONG(x);
      |                ^~~~~~~~~~~
In file included from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic.h:36,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/ruby.h:27,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby.h:38,
                 from ext/magic/common.h:32,
                 from ext/magic/ruby-magic.h:8,
                 from ext/magic/ruby-magic.c:5:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/st_data_t.h: In function ‘RB_ST2FIX’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/st_data_t.h:61:22: warning: conversion to ‘long int’ from ‘st_data_t’ {aka ‘long unsigned int’} may change the sign of the result [-Wsign-conversion]
   61 |     SIGNED_VALUE x = i;
      |                      ^
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/st_data_t.h:72:24: warning: conversion to ‘long int’ from ‘long unsigned int’ may change the sign of the result [-Wsign-conversion]
   72 |     return RB_LONG2FIX(y);
      |                        ^
In file included from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/assume.h:29,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/backward/2/assume.h:24,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/defines.h:72,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/ruby.h:25,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby.h:38,
                 from ext/magic/common.h:32,
                 from ext/magic/ruby-magic.h:8,
                 from ext/magic/ruby-magic.c:5:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/core/rarray.h: In function ‘RARRAY_PTR’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/core/rarray.h:556:24: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
  556 |     return RBIMPL_CAST((VALUE *)RARRAY_CONST_PTR(tmp));
      |                        ^
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/cast.h:31:29: note: in definition of macro ‘RBIMPL_CAST’
   31 | # define RBIMPL_CAST(expr) (expr)
      |                             ^~~~
In file included from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/ruby.h:41,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby.h:38,
                 from ext/magic/common.h:32,
                 from ext/magic/ruby-magic.h:8,
                 from ext/magic/ruby-magic.c:5:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/memory.h: In function ‘rb_alloc_tmp_buffer2’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/memory.h:642:56: warning: conversion to ‘size_t’ {aka ‘long unsigned int’} from ‘long int’ may change the sign of the result [-Wsign-conversion]
  642 |     const size_t total_size = rbimpl_size_mul_or_raise(count, elsize);
      |                                                        ^~~~~
In file included from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/ctype.h:27,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/encoding.h:22,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/io.h:16,
                 from ext/magic/common.h:36,
                 from ext/magic/ruby-magic.h:8,
                 from ext/magic/ruby-magic.c:5:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/encoding.h: In function ‘RB_ENCODING_SET_INLINED’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/encoding.h:82:28: warning: conversion to ‘VALUE’ {aka ‘long unsigned int’} from ‘int’ may change the sign of the result [-Wsign-conversion]
   82 |     VALUE f = /* upcast */ encindex;
      |                            ^~~~~~~~
In file included from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/assume.h:29,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/backward/2/assume.h:24,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/defines.h:72,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/ruby.h:25,
                 from /usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby.h:38,
                 from ext/magic/common.h:32,
                 from ext/magic/ruby-magic.h:8,
                 from ext/magic/ruby-magic.c:5:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/encoding.h: In function ‘rb_enc_step_back’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/encoding.h:747:24: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
  747 |     return RBIMPL_CAST((char *)ur);
      |                        ^
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/cast.h:31:29: note: in definition of macro ‘RBIMPL_CAST’
   31 | # define RBIMPL_CAST(expr) (expr)
      |                             ^~~~
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/ctype.h: In function ‘rb_enc_is_newline’:
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/ctype.h:45:33: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
   45 |     OnigUChar *up = RBIMPL_CAST((OnigUChar *)p);
      |                                 ^
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/cast.h:31:29: note: in definition of macro ‘RBIMPL_CAST’
   31 | # define RBIMPL_CAST(expr) (expr)
      |                             ^~~~
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/ctype.h:46:33: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
   46 |     OnigUChar *ue = RBIMPL_CAST((OnigUChar *)e);
      |                                 ^
/usr/local/rvm/rubies/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/cast.h:31:29: note: in definition of macro ‘RBIMPL_CAST’
   31 | # define RBIMPL_CAST(expr) (expr)
      |                             ^~~~
linking shared-object magic/magic.so
[kwilczynski@9feaa209b219 ruby-magic]$ cp magic.so lib/magic
[kwilczynski@9feaa209b219 ruby-magic]$ rake test
no configuration section for specified version of Ruby (rbconfig-x86-linux-2.5.0)
no configuration section for specified version of Ruby (rbconfig-x86-linux-2.6.0)
no configuration section for specified version of Ruby (rbconfig-x86-linux-2.7.0)
no configuration section for specified version of Ruby (rbconfig-x86-linux-3.0.0)
no configuration section for specified version of Ruby (rbconfig-x86-linux-3.1.0)
Loaded suite /usr/local/rvm/rubies/ruby-3.1.0/lib/ruby/gems/3.1.0/gems/rake-13.0.6/lib/rake/rake_test_loader
Started
......................................................................................................................................O
======================================================================================================================================================================================================
Omission: Platform supports fork [test_magic_singleton_do_not_auto_load_global_no_fork(MagicTest)]
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/test/test_magic.rb:785:in `test_magic_singleton_do_not_auto_load_global_no_fork'
======================================================================================================================================================================================================
...........................
Finished in 0.079678989 seconds.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
162 tests, 237 assertions, 0 failures, 0 errors, 0 pendings, 1 omissions, 0 notifications
100% passed
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2033.16 tests/s, 2974.44 assertions/s

In this case, mkmf had no issues locating the rb_thread_call_without_gvl() function, which should be exported and available on any modern Ruby. However, the following that is using rake compile fails and the aforementioned function cannot be found, as per:

Broken
[kwilczynski@9feaa209b219 ruby-magic]$ rake clean clobber
no configuration section for specified version of Ruby (rbconfig-x86-linux-2.5.0)
no configuration section for specified version of Ruby (rbconfig-x86-linux-2.6.0)
no configuration section for specified version of Ruby (rbconfig-x86-linux-2.7.0)
no configuration section for specified version of Ruby (rbconfig-x86-linux-3.0.0)
no configuration section for specified version of Ruby (rbconfig-x86-linux-3.1.0)
[kwilczynski@9feaa209b219 ruby-magic]$ rake compile
no configuration section for specified version of Ruby (rbconfig-x86-linux-2.5.0)
no configuration section for specified version of Ruby (rbconfig-x86-linux-2.6.0)
no configuration section for specified version of Ruby (rbconfig-x86-linux-2.7.0)
no configuration section for specified version of Ruby (rbconfig-x86-linux-3.0.0)
no configuration section for specified version of Ruby (rbconfig-x86-linux-3.1.0)
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:69: warning: already initialized constant MakeMakefile::CONFIG
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:69: warning: previous definition of CONFIG was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:70: warning: already initialized constant MakeMakefile::ORIG_LIBPATH
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:70: warning: previous definition of ORIG_LIBPATH was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:75: warning: already initialized constant MakeMakefile::C_EXT
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:75: warning: previous definition of C_EXT was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:80: warning: already initialized constant MakeMakefile::CXX_EXT
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:80: warning: previous definition of CXX_EXT was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:88: warning: already initialized constant MakeMakefile::SRC_EXT
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:88: warning: previous definition of SRC_EXT was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:93: warning: already initialized constant MakeMakefile::HDR_EXT
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:93: warning: previous definition of HDR_EXT was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:167: warning: already initialized constant MakeMakefile::INSTALL_DIRS
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:167: warning: previous definition of INSTALL_DIRS was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:258: warning: already initialized constant MakeMakefile::CONFTEST
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:258: warning: previous definition of CONFTEST was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:259: warning: already initialized constant MakeMakefile::CONFTEST_C
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:259: warning: previous definition of CONFTEST_C was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:261: warning: already initialized constant MakeMakefile::OUTFLAG
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:261: warning: previous definition of OUTFLAG was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:262: warning: already initialized constant MakeMakefile::COUTFLAG
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:262: warning: previous definition of COUTFLAG was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:263: warning: already initialized constant MakeMakefile::CSRCFLAG
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:263: warning: previous definition of CSRCFLAG was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:264: warning: already initialized constant MakeMakefile::CPPOUTFILE
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:264: warning: previous definition of CPPOUTFILE was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:1361: warning: already initialized constant MakeMakefile::STRING_OR_FAILED_FORMAT
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:1361: warning: previous definition of STRING_OR_FAILED_FORMAT was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2640: warning: already initialized constant MakeMakefile::FailedMessage
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2638: warning: previous definition of FailedMessage was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2713: warning: already initialized constant MakeMakefile::EXPORT_PREFIX
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2711: warning: previous definition of EXPORT_PREFIX was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2731: warning: already initialized constant MakeMakefile::COMMON_HEADERS
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2729: warning: previous definition of COMMON_HEADERS was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2736: warning: already initialized constant MakeMakefile::COMMON_LIBS
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2734: warning: previous definition of COMMON_LIBS was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2741: warning: already initialized constant MakeMakefile::COMPILE_RULES
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2739: warning: previous definition of COMPILE_RULES was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2742: warning: already initialized constant MakeMakefile::RULE_SUBST
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2740: warning: previous definition of RULE_SUBST was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2747: warning: already initialized constant MakeMakefile::COMPILE_C
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2745: warning: previous definition of COMPILE_C was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2752: warning: already initialized constant MakeMakefile::COMPILE_CXX
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2750: warning: previous definition of COMPILE_CXX was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2757: warning: already initialized constant MakeMakefile::ASSEMBLE_C
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2755: warning: previous definition of ASSEMBLE_C was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2762: warning: already initialized constant MakeMakefile::ASSEMBLE_CXX
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2760: warning: previous definition of ASSEMBLE_CXX was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2767: warning: already initialized constant MakeMakefile::TRY_LINK
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2765: warning: previous definition of TRY_LINK was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2774: warning: already initialized constant MakeMakefile::LINK_SO
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2772: warning: previous definition of LINK_SO was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2786: warning: already initialized constant MakeMakefile::LIBPATHFLAG
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2784: warning: previous definition of LIBPATHFLAG was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2787: warning: already initialized constant MakeMakefile::RPATHFLAG
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2785: warning: previous definition of RPATHFLAG was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2792: warning: already initialized constant MakeMakefile::LIBARG
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2790: warning: previous definition of LIBARG was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2797: warning: already initialized constant MakeMakefile::MAIN_DOES_NOTHING
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2795: warning: previous definition of MAIN_DOES_NOTHING was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2798: warning: already initialized constant MakeMakefile::UNIVERSAL_INTS
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2796: warning: previous definition of UNIVERSAL_INTS was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2806: warning: already initialized constant MakeMakefile::CLEANINGS
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2804: warning: previous definition of CLEANINGS was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2840: warning: already initialized constant MakeMakefile::CONFTEST_CXX
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2838: warning: previous definition of CONFTEST_CXX was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2842: warning: already initialized constant MakeMakefile::TRY_LINK_CXX
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2840: warning: previous definition of TRY_LINK_CXX was here
Building ruby-magic using packaged libraries.
Static linking is enabled.
Cross build is enabled.
Using mini_portile version 2.7.1
---------- IMPORTANT NOTICE ----------
Building Ruby Magic with a packaged version of libmagic-5.39.
Configuration options: --disable-silent-rules --disable-dependency-tracking --enable-fsect-man5 --disable-shared --enable-static --target\=x86_64-redhat-linux --host\=x86_64-redhat-linux CFLAGS\=-fPIC
The following patches are being applied:
  - 0001-Don-t-attempt-to-build-tests-documentation-and-Python-bindings.patch
Extracting file-5.39.tar.gz into tmp/x86_64-redhat-linux/ports/libmagic/5.39... OK
Running git apply with /home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/patches/libmagic/0001-Don-t-attempt-to-build-tests-documentation-and-Python-bindings.patch... OK
Running 'configure' for libmagic 5.39... OK
Running 'compile' for libmagic 5.39... OK
Running 'install' for libmagic 5.39... OK
Activating libmagic 5.39 (from /home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ports/x86_64-redhat-linux/libmagic/5.39)...
checking for ruby.h... yes
checking for -lpthread... yes
checking for -lrt... yes
checking for -ldl... yes
checking for -lcrypt... yes
checking for rb_thread_call_without_gvl()... no
checking for rb_thread_blocking_region()... no
checking for magic.h... yes
checking for -lmagic... yes
checking for magic_getpath()... yes
checking for magic_getflags()... yes
checking for utime.h... yes
checking for sys/types.h... yes
checking for sys/time.h... yes
checking for utime()... yes
checking for utimes()... yes
creating extconf.h
creating Makefile
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:69: warning: already initialized constant MakeMakefile::CONFIG
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:69: warning: previous definition of CONFIG was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:70: warning: already initialized constant MakeMakefile::ORIG_LIBPATH
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:70: warning: previous definition of ORIG_LIBPATH was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:75: warning: already initialized constant MakeMakefile::C_EXT
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:75: warning: previous definition of C_EXT was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:80: warning: already initialized constant MakeMakefile::CXX_EXT
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:80: warning: previous definition of CXX_EXT was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:88: warning: already initialized constant MakeMakefile::SRC_EXT
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:88: warning: previous definition of SRC_EXT was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:93: warning: already initialized constant MakeMakefile::HDR_EXT
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:93: warning: previous definition of HDR_EXT was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:167: warning: already initialized constant MakeMakefile::INSTALL_DIRS
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:167: warning: previous definition of INSTALL_DIRS was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:258: warning: already initialized constant MakeMakefile::CONFTEST
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:258: warning: previous definition of CONFTEST was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:259: warning: already initialized constant MakeMakefile::CONFTEST_C
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:259: warning: previous definition of CONFTEST_C was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:261: warning: already initialized constant MakeMakefile::OUTFLAG
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:261: warning: previous definition of OUTFLAG was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:262: warning: already initialized constant MakeMakefile::COUTFLAG
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:262: warning: previous definition of COUTFLAG was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:263: warning: already initialized constant MakeMakefile::CSRCFLAG
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:263: warning: previous definition of CSRCFLAG was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:264: warning: already initialized constant MakeMakefile::CPPOUTFILE
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:264: warning: previous definition of CPPOUTFILE was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:1361: warning: already initialized constant MakeMakefile::STRING_OR_FAILED_FORMAT
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:1361: warning: previous definition of STRING_OR_FAILED_FORMAT was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2640: warning: already initialized constant MakeMakefile::FailedMessage
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2638: warning: previous definition of FailedMessage was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2713: warning: already initialized constant MakeMakefile::EXPORT_PREFIX
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2711: warning: previous definition of EXPORT_PREFIX was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2731: warning: already initialized constant MakeMakefile::COMMON_HEADERS
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2729: warning: previous definition of COMMON_HEADERS was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2736: warning: already initialized constant MakeMakefile::COMMON_LIBS
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2734: warning: previous definition of COMMON_LIBS was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2741: warning: already initialized constant MakeMakefile::COMPILE_RULES
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2739: warning: previous definition of COMPILE_RULES was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2742: warning: already initialized constant MakeMakefile::RULE_SUBST
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2740: warning: previous definition of RULE_SUBST was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2747: warning: already initialized constant MakeMakefile::COMPILE_C
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2745: warning: previous definition of COMPILE_C was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2752: warning: already initialized constant MakeMakefile::COMPILE_CXX
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2750: warning: previous definition of COMPILE_CXX was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2757: warning: already initialized constant MakeMakefile::ASSEMBLE_C
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2755: warning: previous definition of ASSEMBLE_C was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2762: warning: already initialized constant MakeMakefile::ASSEMBLE_CXX
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2760: warning: previous definition of ASSEMBLE_CXX was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2767: warning: already initialized constant MakeMakefile::TRY_LINK
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2765: warning: previous definition of TRY_LINK was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2774: warning: already initialized constant MakeMakefile::LINK_SO
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2772: warning: previous definition of LINK_SO was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2786: warning: already initialized constant MakeMakefile::LIBPATHFLAG
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2784: warning: previous definition of LIBPATHFLAG was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2787: warning: already initialized constant MakeMakefile::RPATHFLAG
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2785: warning: previous definition of RPATHFLAG was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2792: warning: already initialized constant MakeMakefile::LIBARG
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2790: warning: previous definition of LIBARG was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2797: warning: already initialized constant MakeMakefile::MAIN_DOES_NOTHING
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2795: warning: previous definition of MAIN_DOES_NOTHING was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2798: warning: already initialized constant MakeMakefile::UNIVERSAL_INTS
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2796: warning: previous definition of UNIVERSAL_INTS was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2806: warning: already initialized constant MakeMakefile::CLEANINGS
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2804: warning: previous definition of CLEANINGS was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2840: warning: already initialized constant MakeMakefile::CONFTEST_CXX
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2838: warning: previous definition of CONFTEST_CXX was here
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ext/magic/mkmf-upstream.rb:2842: warning: already initialized constant MakeMakefile::TRY_LINK_CXX
/home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/tmp/x86_64-linux/magic/3.1.0/mkmf.rb:2840: warning: previous definition of TRY_LINK_CXX was here
Building ruby-magic using packaged libraries.
Static linking is enabled.
Cross build is enabled.
Using mini_portile version 2.7.1
Building Ruby Magic with a packaged version of libmagic-5.39.
Activating libmagic 5.39 (from /home/kwilczynski/Development/Projects/Personal/Ruby/ruby-magic/ports/x86_64-redhat-linux/libmagic/5.39)...
checking for ruby.h... yes
checking for -lpthread... yes
checking for -lrt... yes
checking for -ldl... yes
checking for -lcrypt... yes
checking for rb_thread_call_without_gvl()... no
checking for rb_thread_blocking_region()... no
checking for magic.h... yes
checking for -lmagic... yes
checking for magic_getpath()... yes
checking for magic_getflags()... yes
checking for utime.h... yes
checking for sys/types.h... yes
checking for sys/time.h... yes
checking for utime()... yes
checking for utimes()... yes
creating extconf.h
creating Makefile
compiling ../../../../ext/magic/functions.c
In file included from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:42,
                 from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/int.h:26,
                 from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/char.h:23,
                 from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic.h:23,
                 from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/ruby.h:27,
                 from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby.h:38,
                 from ../../../../ext/magic/common.h:32,
                 from ../../../../ext/magic/functions.h:8,
                 from ../../../../ext/magic/functions.c:5:
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/special_consts.h: In function ‘RB_TEST’:
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/special_consts.h:148:16: warning: unsigned conversion from ‘int’ to ‘VALUE’ {aka ‘long unsigned int’} changes value from ‘-9’ to ‘18446744073709551607’ [-Wsign-conversion]
  148 |     return obj & ~RUBY_Qnil;
      |                ^
In file included from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/int.h:26,
                 from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/char.h:23,
                 from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic.h:23,
                 from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/ruby.h:27,
                 from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby.h:38,
                 from ../../../../ext/magic/common.h:32,
                 from ../../../../ext/magic/functions.h:8,
                 from ../../../../ext/magic/functions.c:5:
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h: In function ‘RB_INT2FIX’:
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:117:29: warning: conversion to ‘long unsigned int’ from ‘long int’ may change the sign of the result [-Wsign-conversion]
  117 |     const unsigned long j = i;
      |                             ^
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:119:29: warning: conversion to ‘long int’ from ‘long unsigned int’ may change the sign of the result [-Wsign-conversion]
  119 |     const long          l = k;
      |                             ^
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:121:29: warning: conversion to ‘VALUE’ {aka ‘const long unsigned int’} from ‘long int’ may change the sign of the result [-Wsign-conversion]
  121 |     const VALUE         n = m;
      |                             ^
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h: In function ‘rbimpl_fix2long_by_idiv’:
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:169:28: warning: conversion to ‘long int’ from ‘VALUE’ {aka ‘long unsigned int’} may change the sign of the result [-Wsign-conversion]
  169 |     const SIGNED_VALUE y = x - RUBY_FIXNUM_FLAG;
      |                            ^
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h: In function ‘rbimpl_fix2long_by_shift’:
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:196:28: warning: conversion to ‘long int’ from ‘VALUE’ {aka ‘long unsigned int’} may change the sign of the result [-Wsign-conversion]
  196 |     const SIGNED_VALUE y = x;
      |                            ^
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h: In function ‘rb_fix2ulong’:
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:255:12: warning: conversion to ‘long unsigned int’ from ‘long int’ may change the sign of the result [-Wsign-conversion]
  255 |     return rb_fix2long(x);
      |            ^~~~~~~~~~~~~~
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h: In function ‘rb_ulong2num_inline’:
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:326:28: warning: conversion to ‘long int’ from ‘long unsigned int’ may change the sign of the result [-Wsign-conversion]
  326 |         return RB_LONG2FIX(v);
      |                            ^
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long_long.h: In function ‘rb_num2ull_inline’:
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long.h:53:22: warning: conversion to ‘long long unsigned int’ from ‘long int’ may change the sign of the result [-Wsign-conversion]
   53 | #define RB_FIX2LONG  rb_fix2long          /**< @alias{rb_fix2long} */
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/long_long.h:130:16: note: in expansion of macro ‘RB_FIX2LONG’
  130 |         return RB_FIX2LONG(x);
      |                ^~~~~~~~~~~
In file included from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic.h:36,
                 from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/ruby.h:27,
                 from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby.h:38,
                 from ../../../../ext/magic/common.h:32,
                 from ../../../../ext/magic/functions.h:8,
                 from ../../../../ext/magic/functions.c:5:
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/st_data_t.h: In function ‘RB_ST2FIX’:
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/st_data_t.h:61:22: warning: conversion to ‘long int’ from ‘st_data_t’ {aka ‘long unsigned int’} may change the sign of the result [-Wsign-conversion]
   61 |     SIGNED_VALUE x = i;
      |                      ^
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/arithmetic/st_data_t.h:72:24: warning: conversion to ‘long int’ from ‘long unsigned int’ may change the sign of the result [-Wsign-conversion]
   72 |     return RB_LONG2FIX(y);
      |                        ^
In file included from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/assume.h:29,
                 from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/backward/2/assume.h:24,
                 from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/defines.h:72,
                 from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/ruby.h:25,
                 from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby.h:38,
                 from ../../../../ext/magic/common.h:32,
                 from ../../../../ext/magic/functions.h:8,
                 from ../../../../ext/magic/functions.c:5:
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/core/rarray.h: In function ‘RARRAY_PTR’:
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/core/rarray.h:556:24: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
  556 |     return RBIMPL_CAST((VALUE *)RARRAY_CONST_PTR(tmp));
      |                        ^
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/cast.h:31:29: note: in definition of macro ‘RBIMPL_CAST’
   31 | # define RBIMPL_CAST(expr) (expr)
      |                             ^~~~
In file included from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/ruby.h:41,
                 from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby.h:38,
                 from ../../../../ext/magic/common.h:32,
                 from ../../../../ext/magic/functions.h:8,
                 from ../../../../ext/magic/functions.c:5:
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/memory.h: In function ‘rb_alloc_tmp_buffer2’:
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/memory.h:642:56: warning: conversion to ‘size_t’ {aka ‘long unsigned int’} from ‘long int’ may change the sign of the result [-Wsign-conversion]
  642 |     const size_t total_size = rbimpl_size_mul_or_raise(count, elsize);
      |                                                        ^~~~~
In file included from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/ctype.h:27,
                 from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/encoding.h:22,
                 from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/io.h:16,
                 from ../../../../ext/magic/common.h:36,
                 from ../../../../ext/magic/functions.h:8,
                 from ../../../../ext/magic/functions.c:5:
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/encoding.h: In function ‘RB_ENCODING_SET_INLINED’:
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/encoding.h:82:28: warning: conversion to ‘VALUE’ {aka ‘long unsigned int’} from ‘int’ may change the sign of the result [-Wsign-conversion]
   82 |     VALUE f = /* upcast */ encindex;
      |                            ^~~~~~~~
In file included from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/assume.h:29,
                 from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/backward/2/assume.h:24,
                 from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/defines.h:72,
                 from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/ruby.h:25,
                 from /usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby.h:38,
                 from ../../../../ext/magic/common.h:32,
                 from ../../../../ext/magic/functions.h:8,
                 from ../../../../ext/magic/functions.c:5:
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/encoding.h: In function ‘rb_enc_step_back’:
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/encoding.h:747:24: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
  747 |     return RBIMPL_CAST((char *)ur);
      |                        ^
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/cast.h:31:29: note: in definition of macro ‘RBIMPL_CAST’
   31 | # define RBIMPL_CAST(expr) (expr)
      |                             ^~~~
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/ctype.h: In function ‘rb_enc_is_newline’:
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/ctype.h:45:33: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
   45 |     OnigUChar *up = RBIMPL_CAST((OnigUChar *)p);
      |                                 ^
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/cast.h:31:29: note: in definition of macro ‘RBIMPL_CAST’
   31 | # define RBIMPL_CAST(expr) (expr)
      |                             ^~~~
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/encoding/ctype.h:46:33: warning: cast discards ‘const’ qualifier from pointer target type [-Wcast-qual]
   46 |     OnigUChar *ue = RBIMPL_CAST((OnigUChar *)e);
      |                                 ^
/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/include/ruby-3.1.0/ruby/internal/cast.h:31:29: note: in definition of macro ‘RBIMPL_CAST’
   31 | # define RBIMPL_CAST(expr) (expr)
      |                             ^~~~
In file included from ../../../../ext/magic/functions.h:8,
                 from ../../../../ext/magic/functions.c:5:
../../../../ext/magic/common.h: At top level:
../../../../ext/magic/common.h:142:11: fatal error: rubysig.h: No such file or directory
  142 | # include <rubysig.h>
      |           ^~~~~~~~~~~
compilation terminated.
gmake: *** [functions.o] Error 1
rake aborted!
Command failed with status (2): [/bin/gmake...]
/usr/local/rvm/gems/ruby-3.1.0/gems/rake-compiler-1.1.7/lib/rake/extensiontask.rb:181:in `block (2 levels) in define_compile_tasks'
/usr/local/rvm/gems/ruby-3.1.0/gems/rake-compiler-1.1.7/lib/rake/extensiontask.rb:180:in `block in define_compile_tasks'
/usr/local/rvm/gems/ruby-3.1.0/bin/ruby_executable_hooks:22:in `eval'
/usr/local/rvm/gems/ruby-3.1.0/bin/ruby_executable_hooks:22:in `<main>'
Tasks: TOP => compile => compile:x86_64-linux => compile:magic:x86_64-linux => copy:magic:x86_64-linux:3.1.0 => tmp/x86_64-linux/magic/3.1.0/magic.so
(See full trace by running task with --trace)

I am not sure (yet) why the latter version does not work whereas former works fine. Perhaps a difference in paths? I can't imagine Rake and the rake-compiler Ruby Gem settings something special, howere, I need to confirm this.
Sorry for the delay with resolution!
Krzysztof

Hi @stanhu,

@kwilczynski Can your cat fix other bugs? Asking for a friend.

I will ask. 😄 Also, as you might be (correctly) suspecting, he's the one doing all the work. I am just here to do belly rubs and offer some snacks now and then.
Krzysztof

why the latter version does not work whereas former works fine

I believe the difference is between the rvm-installed rubies (just 2.5.9 and 3.1.0) used in the "working" scenario, and the rubies you're compiling against used in the "failing" scenario:
[flavorjones@454e95346e25 ruby]$ cat ~/.rake-compiler/config.yml
---
rbconfig-x86_64-linux-gnu-2.4.0: "/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-2.4.0/lib/ruby/2.4.0/x86_64-linux-gnu/rbconfig.rb"
rbconfig-x86_64-linux-2.4.0: "/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-2.4.0/lib/ruby/2.4.0/x86_64-linux-gnu/rbconfig.rb"
rbconfig-x86_64-linux-gnu-2.5.0: "/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-2.5.0/lib/ruby/2.5.0/x86_64-linux-gnu/rbconfig.rb"
rbconfig-x86_64-linux-2.5.0: "/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-2.5.0/lib/ruby/2.5.0/x86_64-linux-gnu/rbconfig.rb"
rbconfig-x86_64-linux-gnu-2.6.0: "/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-2.6.0/lib/ruby/2.6.0/x86_64-linux-gnu/rbconfig.rb"
rbconfig-x86_64-linux-2.6.0: "/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-2.6.0/lib/ruby/2.6.0/x86_64-linux-gnu/rbconfig.rb"
rbconfig-x86_64-linux-gnu-2.7.0: "/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-2.7.0/lib/ruby/2.7.0/x86_64-linux-gnu/rbconfig.rb"
rbconfig-x86_64-linux-2.7.0: "/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-2.7.0/lib/ruby/2.7.0/x86_64-linux-gnu/rbconfig.rb"
rbconfig-x86_64-linux-gnu-3.0.0: "/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.0.0/lib/ruby/3.0.0/x86_64-linux-gnu/rbconfig.rb"
rbconfig-x86_64-linux-3.0.0: "/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.0.0/lib/ruby/3.0.0/x86_64-linux-gnu/rbconfig.rb"
rbconfig-x86_64-linux-gnu-3.1.0: "/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/lib/ruby/3.1.0/x86_64-linux-gnu/rbconfig.rb"
rbconfig-x86_64-linux-3.1.0: "/usr/local/rake-compiler/ruby/x86_64-redhat-linux/ruby-3.1.0/lib/ruby/3.1.0/x86_64-linux-gnu/rbconfig.rb"

Instead of running ruby ext/magic/extconf.rb inside the container, instead run bundle exec rake gem:x86_64-linux:builder and you'll reproduce the issue.

@kwilczynski I spent a bit of time this morning trying to build a ruby on my development machine that would reproduce what we're seeing in the RCD image with the xruby 3.1.0, and I can't.
@larskanis Do you have any pointers on where to investigate what's going on here? If you want to get quick reproduction, check out this branch and run bundle exec rake gem:x86_64-linux. This doesn't reproduce with any other Ruby 3.1.0 that I've built, even one built with the same configure options, and I'm struggling to understand what other variables might exist.

I can reproduce the issue locally. I'll check what's going on.
There's another pkg-config related issue in the x64-mingw-ucrt image of rake-compiler-dock here, but it might be unrelated here.

xruby-3.0 links to libruby-static, while for some reason xruby-3.1 doesn't. This probably is a bug in rake-compiler-dock. We do some magic there with the libruby files.
A workaround is:
have_library('ruby-static')
have_func('rb_thread_call_without_gvl', 'ruby/thread.h')

Using 'ruby/thread.h' in have_func isn't necessary, but is faster, since it detects the function in the first compiler run, while without it, two runs are necessary.

Hi @flavorjones and @larskanis,

@kwilczynski I spent a bit of time this morning trying to build a ruby on my development machine that would reproduce what we're seeing in the RCD image with the xruby 3.1.0, and I can't.

I did the same after having an initial look some time ago, and I couldn't reproduce this under rbenv, RVM and even when I installed 3.1.0 by hand from the tarball. I wasn't sure what is going on with the version in the container.

@larskanis Do you have any pointers on where to investigate what's going on here? If you want to get quick reproduction, check out this branch and run bundle exec rake gem:x86_64-linux. This doesn't reproduce with any other Ruby 3.1.0 that I've built, even one built with the same configure options, and I'm struggling to understand what other variables might exist.

You can build a small reproduction case with a basic extconf.rb that only looks for functions, headers and libraries - something I did to try to narrow down the problem in terms of scope and to have reliable reproducer - and it would be unable to locate these in the Ruby 3.1.0 from the container image. What is also interesting, I've noticed that extconf.rb runs twice on 3.1.0.
Krzysztof

Hi @larskanis,
Thank you for looking into this!
[...]

A workaround is:
have_library('ruby-static')
have_func('rb_thread_call_without_gvl', 'ruby/thread.h')

This helps!
A slightly different question as I am still, however, puzzled why do we need to add the following explicitly:
have_library('pthread')
have_library('rt')
have_library('dl')
have_library('crypt')

I don't know much about mkmf internals, however, I would imagine that these are default libraries to link Ruby against? Would you happen to know? I wonder if we are doing something wrong here.

Using 'ruby/thread.h' in have_func isn't necessary, but is faster, since it detects the function in the first compiler run, while without it, two runs are necessary.

Interestingly, the extconf.rb appears to be run multiple times. I am not sure why that is. Not the case with Ruby 3.0.x, however.
Krzysztof

Interestingly, the extconf.rb appears to be run multiple times. I am not sure why that is. Not the case with Ruby 3.0.x, however.

This is because two implementations of mkmf.rb are active. Although ruby-core's mkmf.rb isn't required in your extconf.rb it is already active because of rake-compiler's .rake-compiler-siteconf.rb. See here.

A slightly different question as I am still, however, puzzled why do we need to add the following explicitly:
have_library('pthread')
have_library('rt')
have_library('dl')
have_library('crypt')

That's not intended. Looks like an issue of rake-compiler-dock. I'll investigate it.

 I think it might be good to go.

Hi @flavorjones,
Sorry for the delay!

@kwilczynski Are you waiting on me for anything else related to this? I think it might be good to go.

No. Everything looks good! Thank you so much! Also, thank you for reporting this issue upstream so that everyone else can benefit from the fix/workaround, etc.
To add - everything builds fine, indeed, even though (at least in my case) the extconf.rb seems to be running twice.
By the way, you are a project member with commit bit, thus similarly to @stanhu feel free to close Pull Requests, push commits, etc. I fully trust the two of you, of course. 😄
Krzysztof

@kwilczynski Looking into why Ruby 2.6 and 2.7 are failing here: https://gitlab.com/stanhu/ruby-magic/-/jobs/2123000713

I guess a retry fixed it.


[SuperEditor][iOS] Don't show toolbar upon first tap (Resolves #2073)

[SuperEditor][iOS] Don't show toolbar upon first tap. Resolves #2073
On iOS, tapping to change the selection from one empty paragraph to another is causing the toolbar to appear.
The issue is that, when we check if the user tapped on an existing selection, we aren't checking for the node id. Therefore, whenever the user places the caret to another paragraph at the same offset as the previous selection, the toolbar is displayed:
https://github.com/superlistapp/super_editor/assets/7597082/ba7deab0-be10-478c-9462-b9e5ff26c5cc
This PR fixes the issue by adding the node id to the comparison.

@matthew-carroll A couple android golden tests started to fail due some small rendering change related to the scaleFactor.
I increased the tolerance to make those tests pass, but we can re-generated then if needed.


Int header with invalid types

$headers['Content-Length'] = strlen($body) - always set in int number. All libs! My code is die with v2.0.0-beta.1.
$request = new Request($endpoint, 'POST', $content);
$request->setHeaders($headers);

I've allowed int, float, and Stringable objects to be part of the header array. Other types will still throw TypeError.

@trowski Can you tag beta release with this fix please?


Add ReplaceText extension

This extension is included by default in MediaWiki versions 1.31 and above. It allows sitewide text replacement for bureaucrat level users and above.

LGTM!
Can you make sure how to use it is documented somewhere.

@hcooper It is pretty straightforward. Try it on your dev machine first. The page for it is here.
You put in a search and replace string, then it brings up a second page with the matching pages, where you can deselect one or more, then you click confirm.


[v2.6] Repatriate from v2.5

This PR merges release/v2.5 in to master.

Closing until https://github.com/emissary-ingress/emissary/pull/4535 lands


Wait

Dependency

[ ] #101 (first 4 commits)

add State#value_or_path helper method

tweak sleep in Wait

add sleep to Task

add timestamp and paths to Wait https://states-language.net/#wait-state

update:

rebased to include string dates
storing wait as a string

update:

rebased
changed comment around adding success states to make it obvious that it is a development feature

update:

helper method value_or_path to simplify implementation of using a path or value
was able to put the wait() call back into Wait#start (vs rubocop encouraged separate method)
test for wait_until

Updates:

rebased onto cops (had a conflict when adding timecop gem)
fixed cops related to hashrocket and extra newline

Can you describe the problem you are trying to solve in the OP?  It;'s hard to understand what problem/feature this is trying to solve.

update:

split timecop/spec changes addition to own commit (to show it is green before/after)
rebased


Bring back ignoring warnings in external CLAP code

unfortunately the clap headers and juce x headers are fragile under include order becaose X11.h on ubuntu does a #define None as 0L and None is also a clap constant in clap 0.21 so I think this can't merge, but I'll give it a pull and check.

Yeah this doesn't build surge on ubuntu but I have a fix I'll push up to your branch which fixes it while retaniing the warnings. Stay tuned.


Instantiate the ScheduleProvider at the same time the INSTANCE is declared

Since the current version of code doesn't look thread safe and I thought a null may be returned in the getInstance method.

What about synchronizing the getInstance() method instead? The whole point is to lazy-load the scheduler I think.

Yes, synchronizing the getInstance method also works. Okay, I'll change the PR to do so.
(Sorry looks like I accidentally closed this PR. I may send another PR if I can't find a way to amend the PR)

Sent another PR #178 to make the method synchronized.

@thagikura why do you want to keep lazy initialisation at all? Whenever somebody access SchedulerProvider, the only thing he can do is call getInstance(). So you can just put initialisation in the field itself, put volatile and make it final.

Actually the first PR was instantiating the ScheduleProviders in the field itself.
So I want to follow the owner's preference regarding that point ( @JoseAlcerreca or @florina-muntenescu ?)

@thagikura My point is, that even if you put initialization in the field itself, instance creation will happened only on first getInstance()call,  since there is no other way to interact with this class.
But it is true, it is up to owners to decide.


Fix PlaygroundPopupPositioning For Various Edge Cases top and left position

Fixes  #1704
This PR fixes the Playground Popup Positioning to Handle Various Edge Cases top, left  and right position
Before:
https://user-images.githubusercontent.com/22450188/163326237-b65f071b-5b1d-4e6c-b55a-e3ee9744ceb8.png
https://user-images.githubusercontent.com/22450188/163326356-74214cff-00ef-4e4f-a413-19181afa7ebc.png
https://user-images.githubusercontent.com/22450188/163326498-47f0516a-0e84-402e-b8d5-3de718bb7cd6.png
After:
https://user-images.githubusercontent.com/35562131/163366694-0eb71c18-f746-4c08-bfb1-80cdb75826e7.png
https://user-images.githubusercontent.com/35562131/163366784-118e31f2-1315-432d-980b-7da3e54dc1f0.png
https://user-images.githubusercontent.com/35562131/163367031-8786caf4-3cbc-49d2-9ac5-50b21f7b337e.png

Would also be good to apply the same fixes to the FloatingLink popup!


Contributing Tensorflow/Keras code

It is to my surprise how this works well looking complex at the first place (unlike Swish), and I will be waiting for what mathematical challenges and improvements it will bring over ReLU

import math as m
import tensorflow as tf

def cyclemoid(x):
  'Implementation tweaked from PyTorch implementation, to be used as functions & in Lambda layers'
  pi = tf.constant(m.pi)
  term1 = tf.math.tanh(pi*x)
  term2 = tf.math.tanh(pi*tf.square(x)-0.95)**2
  term3 = tf.math.cos(tf.clip_by_value(x, clip_value_min=-3., clip_value_max=3.))**2
  return term1 * term2 * term3

class CycleMoid(tf.keras.layers.Activation):
  'Creating dedicated class using subclassing'
  def __init__(self, **kwargs):
    super().__init__(cyclemoid, **kwargs)

'Crating for the easiest use'
tf.keras.utils.get_custom_objects()['cyclemoid'] = CycleMoid

Tweaking my favorite Keras Code Example, below is only section that needs to be updated in notebook in the "keras-way"

#### Change in the model definition on top of above notebook ####
model = keras.Sequential(
    [
        keras.Input(shape=input_shape),
        layers.Conv2D(32, kernel_size=(3, 3), activation="cyclemoid"),
        layers.MaxPooling2D(pool_size=(2, 2)),
        # layers.Conv2D(64, kernel_size=(3, 3), activation="cyclemoid"), # This works well, as one line substitute for below two lines
        layers.Conv2D(64, kernel_size=(3, 3), activation=None),
        CycleMoid(),
        layers.MaxPooling2D(pool_size=(2, 2)),
        layers.Flatten(),
        layers.Dropout(0.5),
        layers.Dense(num_classes, activation="softmax"),
    ]
)

Thanks! Just added it via #2


[Question] Get Authorization Code URL

Core Library
MSAL.js v2 (@azure/msal-browser)
Core Library Version
2.11.0
Wrapper Library
Not Applicable
Wrapper Library Version
None
Description
Hi All,
I was playing around with MSAL-Browser library and was wondering if there was a way for a developer to get the query string parameters of the authorization code URL when a user uses the loginRedirect() function (or any interactive function for acquiring tokens)?
MSAL Configuration
No response
Relevant Code Snippets
No response
Identity Provider
No response
Source
External (Customer)

Yes, the onRedirectNavigate callback will be invoked with the full url. Returning false in this callback will stop the pending navigation: https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/6b257b717/lib/msal-browser/src/request/RedirectRequest.ts#L37

Thank you @jasonnutter for the swift response! So the redirectRequest property onRedirectNavigate can be provided so that the callback will return false to stop the pending navigation. During which, the full URL will be available to use within that a callback?

Thank you @jasonnutter for the swift response! So the redirectRequest property onRedirectNavigate can be provided so that the callback will return false to stop the pending navigation. During which, the full URL will be available to use within that a callback?

Yes. Example: https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/samples/msal-browser-samples/ChromiumExtensionSample/auth.js#L83-L93

Great thank you for the example @jasonnutter . One last question I have is if a user invokes a loginRedirect() function with the onRedirectNavigate callback set to false, and then invokes another loginRedirect with a different redirectRequest where the  onRedirectNavigate callback is set to true or doesn't exist, will the user then be redirected or will the subsequent loginRedirect() function not redirect due to the msal items in the browserStorage?

@JJHakiLe You will get an InteractionInProgress error in this case. Since we set the temporary cache variables when loginRedirect is invoked, until you resolve the call with a handleRedirectPromise() call, MSAL JS tracks this as a token request in progress.

@sameerag Great, that makes sense. Thank you very much @sameerag and @jasonnutter for your explanations. So handleRedirectPromise() needs to resolve those InteractionInProgress errors. I believe that should resolve any questions I have now. Thanks again!


Add control for sheet insert animation Duration and Curve

Sheet insert Animation Duration and Curve
It would be a great addition to give control for the sheet insert Duration and Curve.

@TahaTesser Would it make sense to include this as part of ThemeData? What is the Flutter way of adding this in the cleanest way?

Yes, we can add something like AnimationStyle, this is actually part of multiple themes Including ExpansionTileTheme and widgets like MaterialApp.

@kkoskenvirta It is now possible to customize all animations for duration and curve. Refer to Readme: https://pub.dev/packages/wolt_modal_sheet#customizable-animations

Amazing stuff! So glad to hear that this was added ⭐


fix memory router no native events

Without setupNativeEvents function MemoryRouter does not work with  component, because it is basically just a link that navigates to some page. As stated in the docs memory router can be used for testing purpose. I guess  component should not break then. I know that useNavigate still works, but I think links should work too.
Maybe there wasn't setupNativeEvents on purpose because there is no types in component declaration for arguments of this function, so It's not just was forgotten, so feel free to reject this PR if that's like that.

It's reasonable. I wasn't thinking. I was thinking how memory didn't have a DOM env but that's not right... it just doesn't necessarily have a browser.


adreaper: init at 1.1

Description of changes
Enumeration tool for Windows Active Directories
https://github.com/AidenPearce369/ADReaper
Related to https://github.com/NixOS/nixpkgs/issues/81418

Things done

Built on platform(s)

[x] x86_64-linux
[ ] aarch64-linux
[ ] x86_64-darwin
[ ] aarch64-darwin

[ ] For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
[ ] Tested, as applicable:

NixOS test(s) (look inside nixos/tests)
and/or package tests
or, for functions and "core" functionality, tests in lib/tests or pkgs/test
made sure NixOS tests are linked to the relevant packages

[ ] Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
[x] Tested basic functionality of all binary files (usually in ./result/bin/)
22.05 Release Notes (or backporting 21.11 Release notes)

[ ] (Package updates) Added a release notes entry if the change is major or breaking
[ ] (Module updates) Added a release notes entry if the change is significant
[ ] (Module addition) Added a release notes entry if adding a new NixOS module
[ ] (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes

[x] Fits CONTRIBUTING.md.

Result of nixpkgs-review pr 171231 run on x86_64-linux 1

1 package built:

adreaper


After a tikv fault (more than 30 minutes) is restored, the raft log lag has been chasing

Bug Report

What version of TiKV are you using?
[2022/02/16 19:56:48.223 +08:00] [INFO] [client.go:338] ["Cluster version information"] [type=pd] [version=5.5.0-nightly] [git_hash=f4b0b3187aa1e044f72b3cbe9048f29d1878c584]
[2022/02/16 19:56:48.223 +08:00] [INFO] [client.go:338] ["Cluster version information"] [type=tikv] [version=5.4.0-alpha] [git_hash=8f4f71ea655c5ba794fd2f1780e98e6c3831bc16]
[2022/02/16 19:56:48.223 +08:00] [INFO] [client.go:338] ["Cluster version information"] [type=tidb] [version=5.5.0-nightly] [git_hash=9659b93250e7f08e33f76e59844835927e3d39d8]
What operating system and CPU are you using?
8 core 16G
Steps to reproduce
run tpcc or sysbenc insert
inject one tikv fault and recover （more than 30min）
What did you expect?
raft log lag can becomes smaller
What did happened?
raft log lag becomes more and more

/assign Connor1996

/type enhancement

/found automation

/type bug
/severity major

/remove-type enhancement

The problem occurs only when raft-engine is enabled.

@Lily2025 Could you test again with this binary?http://fileserver.pingcap.net/download/builds/pingcap/tikv/pr/67be27dc95d92e8babdf57cbe4d0a982f94f1a35/centos7/tikv-server.tar.gz
Thanks.


WCAG and the W3C Markup Validation Service

As a business, we want to ensure that our website complies with the latest web standards such as WCAG and W3C Markup Validation Service. To achieve this, we need to automate the testing process to ensure that our website meets these standards. We will use Playwright to automate the compliance testing process and ensure that our website is accessible and meets the latest web standards. One example of such testing is to check if our website has any HTML validation errors using the evaluate method provided by Playwright. This will help us ensure that our website is compliant with the latest web standards and can provide a better user experience to our customers.

` ``
// @ts-check
const { test, expect } = require('@playwright/test');
test.describe('HTML Validation Test', () => {
test('No HTML validation errors', async ({ page }) => {
// Navigate to the website to be tested
await page.goto('http://localhost:3000');
// Check if there are any HTML validation errors
const validationErrors = await page.evaluate(() => {
  const results = document.querySelectorAll('#results .error');
  return Array.from(results).map((result) => result.textContent);
});

// Check if there are no validation errors
expect(validationErrors).toHaveLength(0);

});
});


Feature #1236: Avoid receiver-side copy for large contiguous messages

Original date: 2017-11-21 14:57:50
Original PR: https://charm.cs.illinois.edu/gerrit/1939

Change-Id: I6bff3146a7386a8069b7939ccd471e6cbee2b679

This was a previous implementation of the Post API. The newer implementation to the ZC Post API has been merged into mainline charm.
New ZC Post API:
Github commit: https://github.com/UIUC-PPL/charm/commit/0d441637ac6c0dc27b4c08d919a4b9a453d2b98f
Gerrit: https://charm.cs.illinois.edu/gerrit/c/charm/+/4820


feat: delete index records by matching query filter

@klacointe  @StephaneRob

Hey @Kasse-Dembele, thanks for this PR :) Can you format your code using mix format and add a test on delete_by?

Hey @StephaneRob, my bad. It's done.
Your are welcome :)


fix custom schema implementation override

Custom schemas can be overridden with a macro as described here

Make sure this works as intended
Add tests

I've noticed this behaving incorrectly, but need to confirm that it either is, or is not, working as intended. Regardless, we need to add tests here.

This works as intended, and we have an integration test for it here


Building the server requires svn on the path

Otherwise, the build fails with:
[ERROR] Failed to execute goal org.terracotta:maven-forge-plugin:1.2.13:manifest (default) on project terracotta: Execution default of goal org.terracotta:maven-forge-plugin:1.2.13:manifest failed: Execute failed: java.io.IOException: Cannot run program "svn": error=2, No such file or directory -> [Help 1]

Making some adjustments to maven-forge-plugin

Can someone refresh my memory about this, I think I fixed it but... where was this happening?

If you run mvn clean install in tc-core, you need svn installed in order to get a clean build even though we do not use svn for this build.  I believe it was related to maven-forge-plugin trying to discover build information but that part I am less clear about.


GitLab Converter: Process nested group repo keys correctly

Description
GitLab supports nested groups which need to be considered when parsing the repo key. For example,
top-level-group / nested-group / project
Currently, nested-group is being treated as the project name and uid. This patch changes the parsing so that:
name = project
uid = nested-group / project
Type of change

[x] Bug fix
[ ] New feature
[x] Breaking change

Related issues
Fix #891

I have read the CLA Document and I hereby sign the CLA

@thomas-gerber I think cicd_Release also needs some attention.
With the changes to vcs_Repository.uid to include nested groups, which will then flow vcs_Tags, we should be able to link everything correctly. However, cicd_Release.uid only has the release name which is not unique, so that would cause inaccuracies with descriptions, dates, and urls across projects that have the same release name, which is fairly common if using semver release names.
Should cicd_Release also be aware of Org and include nested-group/project in the uid?

Latest commits should address the changes requested 😃

@thomas-gerber I think cicd_Release also needs some attention.
With the changes to vcs_Repository.uid to include nested groups, which will then flow vcs_Tags, we should be able to link everything correctly. However, cicd_Release.uid only has the release name which is not unique, so that would cause inaccuracies with descriptions, dates, and urls across projects that have the same release name, which is fairly common if using semver release names.
Should cicd_Release also be aware of Org and include nested-group/project in the uid?

Both your points on linkage working and UID not being unique are valid. I agree that the uid should be nested-group/project/releasename (notice the absence of top-level-group). Later, we may link to a cicd_Organization, although this already links to vcs_Organization through the tag.

One small fix needed: given top-level-group/nested-group1/nested-group2/project, you create the following boards:

top-level-group
nested-group1
nested-group1/nested-group2
nested-group1/nested-group2/project
The first one (top-level-group) should not be there IMO.
(Same remark for tms_TaskBoardRelationship and tms_TaskBoardProjectRelationship)

Otherwise, I agreed with your comment on cicd_Release, and you can update the UID as you suggested (i.e. append nested-group/project) even though it may break backward compatibility.
I checked the rest of entities on my test instances with a nested group, and it looks good. I also sanity checked the other converters, and I haven't found any other places to update, great job!

Unless you have a specific use case in mind that I didn't grasp?

My thinking was just keeping inline with what you can see in GitLab. If I navigate to a top-level-group in my instance, I can see all issues for child projects no matter where they sit in a nested group hierarchy. So I think a board to represent that top-level-group is a natural expectation for a GitLab user, but I think you could very easily create a query to get all Tasks in a given top-level-group when tms_Organization is created and linked to tms_TaskProjectRelationship.
I'll remove that and update the uid for cicd_Release.
Side note...Is there anything I can do about the errant CLA user? I goofed with my first commit using my default git profile for work so it didn't link the commit to my GitHub user account correctly.

Bypassing the CLA assistant as the 2 committers are the same person.

@BrentSouza released v0.4.67 https://github.com/faros-ai/airbyte-connectors/releases/tag/v0.4.67

Thank you for all the great work!! @BrentSouza