kwilczynski / ruby-magic

Simple interface to libmagic for Ruby Programming Language
Apache License 2.0
27 stars 8 forks source link

feat: support Ruby 3.1 native gems #30

Closed flavorjones closed 2 years ago

flavorjones commented 2 years ago

This PR contains a workaround for a Ruby mkmf issue that's described in #29.

flavorjones commented 2 years ago

CI needs to be updated to run Ruby 3.1. Also I'm not sure what the CI failure is. Apologies I don't have more time to dig in right now.

stanhu commented 2 years ago

It appears that bundler v2.3.5 is causing issues in CI for some reason. I've pinned the version to v2.3.0 for now: https://github.com/kwilczynski/ruby-magic/pull/31

stanhu commented 2 years ago

Hmm, I may have to revert this. Getting this failure:

$ bundle exec rake compile
checking for whether -I/usr/local/opt/openssl/include is accepted as CPPFLAGS... yes
checking for whether -L/usr/local/opt/openssl/lib is accepted as LDFLAGS... yes
Building ruby-magic using packaged libraries.
Static linking is enabled.
Cross build is disabled.
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 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-apple-darwin19/ports/libmagic/5.39... OK
Running git apply with /Users/stanhu/github/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 /Users/stanhu/github/ruby-magic/ports/x86_64-apple-darwin19/libmagic/5.39)...
checking for ruby.h... yes
checking for -lpthread... yes
checking for -lrt... no
checking for -ldl... yes
checking for -lcrypt... no
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()... no

 Your version of libmagic(3) appears to be too old.

 Please, consider upgrading to at least version 5.29 or newer,
 if possible. For more information about file(1) command and
 libmagic(3) please visit the following web site:
flavorjones commented 2 years ago

Blurgh, OK, I'm going to ship another PR that pulls in the fix from https://github.com/ruby/ruby/pull/5436 as a monkeypatch, because that seems to work.