Disable use of system libffi for building ffi gem
What does this merge request do and why?
The ffi gem will attempt to use the system ffi library if the development headers and libraries are available. Otherwise, the gem will compile and install its own static library. For the GDK, the latter approach is advantageous since the GDK won't break if the system's version is upgraded.
We ran into a similar issue with Omnibus GitLab: omnibus-gitlab!6800 (merged)
Relates to:
How to set up and validate locally
On macOS:
- Run
otool -L ~/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/ffi-1.15.5//lib/ffi_c.bundle | grep libffi
- You should see a line like:
/usr/lib/libffi.dylib (compatibility version 1.0.0, current version 30.0.0)
- Run
bundle config build.ffi "--disable-system-libffi"
. - In
gitlab/
, rungem uninstall ffi
(confirm yes) and thenbundle install
. -
otool -L ~/.asdf/installs/ruby/3.0.5/lib/ruby/gems/3.0.0/gems/ffi-1.15.5//lib/ffi_c.bundle | grep libffi
should now show nothing.
Impacted categories
The following categories relate to this merge request:
-
gdk-reliability - e.g. When a GDK action fails to complete. -
gdk-usability - e.g. Improvements or suggestions around how the GDK functions. -
gdk-performance - e.g. When a GDK action is slow or times out.
Merge request checklist
-
This change is backward compatible. If not, please include steps to communicate to our users. -
Tests added for new functionality. If not, please raise an issue to follow-up. -
Documentation added/updated, if needed. -
Announcement added, if change is notable. -
gdk doctor
test added, if needed. -
Add the ~highlight
label if this MR should be included in theCHANGELOG.md
.
Edited by Stan Hu