fiddle icon indicating copy to clipboard operation
fiddle copied to clipboard

Enabled `--enabled-bundled-ffi` option for only mswin environment

Open hsbt opened this issue 3 years ago • 4 comments

We discussed at https://bugs.ruby-lang.org/issues/18034

hsbt avatar Nov 30 '21 07:11 hsbt

I'm unsure if we should prevent it on Linux. There I think using the bundled libffi usually works fine. Is libffi already a dependency to build CRuby? ruby-build at least includes it.

cc @LarsKanis you probably know more about this subject than I do, and the FFI gem tests both IIRC.

eregon avatar Nov 30 '21 15:11 eregon

ffi.gem bundles libffi since more than 10 years. The extconf.rb file checks whether system libffi is usable and otherwise falls back to builtin. Since commit https://github.com/ffi/ffi/commit/f0959778cfac41e4673117993c3abf26ef1ae76c it's also possible to force system or builtin libffi, so that users with an issue with the default selection can switch to the other way.

libffi on Macos is a mess. We had several bug reports which showed, that that header files don't fit to the libraries or that very old libffi versions were installed as system libffi. We did some fine tuning and now the reports are quite rare. Or maybe newer Macos versions fixed these issues or just stackoverflow has enough answers in the meantime.

Nevertheless builtin libffi works just fine on most operation systems and we test this on Windows, Linux and Macos: https://github.com/ffi/ffi/actions/runs/1287629846

larskanis avatar Dec 01 '21 16:12 larskanis

I and @unak try to use libffi provided by vcpkg. After that, We can remove the bundled source of libffi for mswin environment.

hsbt avatar Jan 04 '22 08:01 hsbt

@larskanis @hsbt Thanks for the information. I'll consider libffi bundling again in this month.

kou avatar Jan 07 '22 21:01 kou

bundled source has been removed at https://github.com/ruby/ruby/commit/e4f5296f065110fa83eb450d3a861253e76e534f

hsbt avatar Sep 14 '22 05:09 hsbt

Let's remove bundled libffi in ruby/fiddle too.

kou avatar Sep 14 '22 05:09 kou

I'm going to submit another PR for removing download feature.

hsbt avatar Oct 05 '22 09:10 hsbt