Skip to content

Skip Harfbuzz dependency on glib #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

Gegy
Copy link

@Gegy Gegy commented Apr 8, 2024

glib is not strictly required by Harfbuzz - if not present, Harfbuzz will use its built-in Unicode character table. LWGJL does not seem to make use of glib, however these bindings do include the glib dependency (given GitHub runners have it installed by default).

The built-in Unicode table was previously included and used over glib anyway, so this change doesn't come with an additional size cost.

This resolves some issues that we have seen with LWJGL's Freetype bindings failing to load on certain systems (particularly, MacOS x86_64) due to missing glib. The error was a bit cryptic, however:

Caused by: java.lang.UnsatisfiedLinkError: Failed to dynamically load library: /Users/<user>/Library/Application Support/minecraft/bin/e070375db1e86ab77c6abaa784ddcfb02c253eaa/libfreetype.dylib(error = null)

We weren't able to identify exactly what was going wrong with dlerror() returning null, however, adding an additional call to dlerror() before dlopen() revealed this error:

dlopen(<path>/libfreetype.dylib, 0x0005): Library not loaded: /usr/local/opt/glib/lib/libglib-2.0.0.dylib
  Referenced from: <8860D930-9A0F-3288-8EB9-354EB76CE3BC> <path>/libfreetype.dylib
  Reason: tried: '/usr/local/opt/glib/lib/libglib-2.0.0.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/usr/local/opt/glib/lib/libglib-2.0.0.dylib' (no such file), '/usr/local/opt/glib/lib/libglib-2.0.0.dylib' (no such file), '/usr/lib/libglib-2.0.0.dylib' (no such file, not in dyld cache))

This pointed us towards removing the glib dependency, as it seems unneeded for LWJGL's case as far as we could tell.

Thanks!

This is not strictly required - if not present, Harfbuzz will use its built-in Unicode character table. This ensures that the library can always load, even if the system does not have glib installed.
The built-in Unicode table was previously included anyway, so this doesn't come with an additional size cost.
@Gegy Gegy closed this May 24, 2024
@Gegy Gegy reopened this May 24, 2024
@Gegy
Copy link
Author

Gegy commented May 24, 2024

Whoops - accidental magic GitHub close!

@Spasi Spasi force-pushed the master branch 2 times, most recently from f04070a to f8143b9 Compare June 2, 2024 16:36
@Spasi Spasi force-pushed the master branch 2 times, most recently from ad3e855 to 0c77f74 Compare July 12, 2024 14:37
@Spasi Spasi force-pushed the master branch 2 times, most recently from 5dccf2a to 64be95f Compare July 23, 2024 19:44
@Spasi Spasi force-pushed the master branch 2 times, most recently from 7df52a5 to 141cbaa Compare February 4, 2025 17:34
@Spasi Spasi force-pushed the master branch 5 times, most recently from d244af7 to 11f0a04 Compare May 17, 2025 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants