ruby / fiddle

A libffi wrapper for Ruby.
BSD 2-Clause "Simplified" License
154 stars 37 forks source link

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

Closed hsbt closed 1 year ago

hsbt commented 2 years ago

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

eregon commented 2 years ago

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.

larskanis commented 2 years ago

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

hsbt commented 2 years ago

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

kou commented 2 years ago

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

hsbt commented 1 year ago

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

kou commented 1 year ago

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

hsbt commented 1 year ago

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