danini-the-panini / mittsu

3D Graphics Library for Ruby.
https://github.com/danini-the-panini/mittsu
MIT License
525 stars 33 forks source link

GLFW load failing on macOS #130

Closed Floppy closed 2 weeks ago

Floppy commented 2 weeks ago

Just updated to latest main, with the new opengl-bindings2, and now my glfw library won't load.

Fiddle::DLError:
  dlopen(libglfw.3.dylib, 0x0009): tried: 'libglfw.3.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibglfw.3.dylib' (no such file), '/usr/lib/libglfw.3.dylib' (no such file, not in dyld cache), 'libglfw.3.dylib' (no such file)

Output from brew list glfw:

❯ brew list glfw
/opt/homebrew/Cellar/glfw/3.4/include/GLFW/ (2 files)
/opt/homebrew/Cellar/glfw/3.4/lib/libglfw.3.4.dylib
/opt/homebrew/Cellar/glfw/3.4/lib/cmake/ (4 files)
/opt/homebrew/Cellar/glfw/3.4/lib/pkgconfig/glfw3.pc
/opt/homebrew/Cellar/glfw/3.4/lib/ (3 other files)
/opt/homebrew/Cellar/glfw/3.4/sbom.spdx.json

I'm guessing this is perhaps because of libglfw.3.dylib being looked for, but the file is actually named libglfw.3.4.dylib. Strangely, it seems to work OK on the macOS CI builds.

Not sure if this is a mittsu thing or opengl-bindings2. Any thoughts?

Floppy commented 2 weeks ago

Setting env vars has partly helped:

❯ export MITTSU_LIBGLFW_PATH=/opt/homebrew/Cellar/glfw/3.4/lib/
❯ export MITTSU_LIBGLFW_FILE=libglfw.3.4.dylib
  dlopen(libglfw.3.4.dylib, 0x0009): tried: 'libglfw.3.4.dylib' (no such file), '/System/Volumes/Preboot/Cryptexes/OSlibglfw.3.4.dylib' (no such file), '/usr/lib/libglfw.3.4.dylib' (no such file, not in dyld cache), 'libglfw.3.4.dylib' (no such file)

It's noticed the filename change, but not the path...

danini-the-panini commented 2 weeks ago

Looks like there was a slight interface change in the library loader, i'll get a PR together shortly

Floppy commented 2 weeks ago

ah, cool, I'd assumed it was something I'd done wrong! Thanks :)