rcairo / rcairo

The Ruby bindings for cairo.
https://rcairo.github.io/
Other
134 stars 31 forks source link

require "#{major}.#{minor}/cairo.so" still necessary? #78

Closed Largo closed 1 year ago

Largo commented 1 year ago

Hello! Thanks for the great work!

Is it still necessary to load "#{major}.#{minor}/cairo.so" first? On windows (rubyinstaller), ruby gems searches many paths first, because the path of cairo.so is "C:\Ruby32-x64\lib\ruby\gems\3.2.0\extensions\x64-mingw-ucrt\3.2.0\cairo-1.17.8\cairo.so"

begin
  major, minor, _ = RUBY_VERSION.split(/\./)
  require "#{major}.#{minor}/cairo.so"
rescue LoadError
  require "cairo.so"
end
kou commented 1 year ago

We can remove this because we dropped support for fat gem. Do you want to open a pull request for this?

Largo commented 1 year ago

Yes, but I don't want to break anything 😅

By the way: I think this is the main reason why GTK3 takes long to load on Windows. I just posted this bug: https://bugs.ruby-lang.org/issues/19378

kou commented 1 year ago

Removing the logic never break any backward compatibility. :-)