ruby-build: Ruby 2.5.9 fail to compile on latest macOS 12.5

Steps to reproduce the behavior

bin/ruby-build 2.5.9 /opt/rubies/2.5.9

Expected vs. actual behavior

I expect ruby to compile.

However it fails to compile the ffi extension

Logs

compiling escape.c
closure.c:264:14: error: implicit declaration of function 'ffi_prep_closure' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
    result = ffi_prep_closure(pcl, cif, callback, (void *)self);
             ^
6 warnings and 1 error generated.

2.5 being EOL, it’s very unlikely this will ever be fixed upstream. So the question is wether ruby-build should flip that compilation flag so that 2.5 (and older probably?) can still be installed.

cc @eregon

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 15 (10 by maintainers)

Most upvoted comments

@hsbt, no our entire infra has been moved to 3.1, this is just me maintaining gems that are still compatible with Ruby 2.5.

I totally understand your stance on workarounds, I’ll update the wiki when I’m back at work Monday.

@byroot Does Shopify still use Ruby 2.5? I’m negative to add the additional workaround to EOL Rubies. I’m afraid other people ask, “We still use Ruby 1.8/1.9(also other versions), Please add workaround”. There is no reason to reject it if we add workaround for Ruby 2.5.

I want to add like RUBY_CFLAGS=-DUSE_FFI_CLOSURE_ALLOC workaround to only wiki.