Meson build defines G_MODULE_SUFFIX to `dylib` on macOS but autotools uses `so`
We have previously touched on this at #520.
G_MODULE_SUFFIX has always been set to
so because that's what autotools uses for plugins.
However, the rest of the world uses
.dylib on macOS for plugins, so Meson creates plugins with a
dylib suffix, and so we're stuck.
Ideally, on macOS GModule should be able to load modules that are of the form
We can't change
G_MODULE_SUFFIX because that breaks the world. So we should deprecate
G_MODULE_SUFFIX, and keep it at
g_module_build_path are kinda broken because they have to guess a single path without accessing the disk:
So that guesswork gets pushed to g_module_open, which has a hack to search for
And then everyone else has to put comments about this weird undocumented behavior:
And after all this work it's not cross-platform anyway because on macOS plugins can have
so and on Windows plugins can be
foo.dll, and on Cygwin they can be
Danger, Will Robinson!
We should not move glib to use only Meson as the build system till this is fixed, unless we want to keep old autotools mistakes forever. The move to Meson is a good time to get consumers of GModule to move to a new API that can cover all this. See #520 for some ideas.