From 63080c2c2d9bcfece7e77ec644677bb6115a293e Mon Sep 17 00:00:00 2001 From: Josh Cooper Date: Wed, 8 May 2024 01:19:04 -0700 Subject: [PATCH] (PA-6422) Enable/disable libffi library not ffi gem The ffi gem depends on the libffi native library. When installing the ffi gem, we need to specify the name of the library in the enable/disable-system-libffi option. --- configs/components/rubygem-ffi.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/configs/components/rubygem-ffi.rb b/configs/components/rubygem-ffi.rb index 09a5aeb7e..5af3e8864 100644 --- a/configs/components/rubygem-ffi.rb +++ b/configs/components/rubygem-ffi.rb @@ -63,19 +63,19 @@ # Prior to ruby 3.2, both ruby and the ffi gem vendored a version of libffi. # If libffi happened to be installed in /usr/lib, then the ffi gem preferred # that instead of building libffi itself. To ensure consistency, we use - # --disable-system-ffi so that the ffi gem *always* builds libffi, then + # --disable-system-libffi so that the ffi gem *always* builds libffi, then # builds the ffi_c native extension and links it against libffi.so. # # In ruby 3.2 and up, libffi is no longer vendored. So we created a separate # libffi vanagon component which is built before ruby. The ffi gem still - # vendors libffi, so we use the --enable-system-ffi option to ensure the ffi + # vendors libffi, so we use the --enable-system-libffi option to ensure the ffi # gem *always* uses the libffi.so we already built. Note the term "system" is # misleading, because we override PKG_CONFIG_PATH below so that our libffi.so # is preferred, not the one in /usr/lib. settings[:gem_install_options] = if rb_major_minor_version > 2.7 - "-- --enable-system-ffi" + "-- --enable-system-libffi" else - "-- --disable-system-ffi" + "-- --disable-system-libffi" end instance_eval File.read('configs/components/_base-rubygem.rb') end