Skip to content

Commit

Permalink
Enable/disable libffi not ffi
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
joshcooper committed May 8, 2024
1 parent 66ba06a commit 2033fe6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions configs/components/rubygem-ffi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,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.
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
Expand Down

0 comments on commit 2033fe6

Please sign in to comment.