expipiplus1 / vulkan

Haskell bindings for Vulkan
https://hackage.haskell.org/package/vulkan
BSD 3-Clause "New" or "Revised" License
141 stars 32 forks source link

Add the LunarG installation path to the vulkan dylib RPATHs #502

Closed alt-romes closed 5 months ago

alt-romes commented 9 months ago

The LunarG installation script (macOS) copies the vulkan dylibs to /usr/local/lib.

By adding this directory to the RPATH entries of the vulkan dylib built from this component, we can save a lot of headaches (ie loader errors) for macOS users for whom that path is not part of the default RPATH entries. This is justified by this being the default installation path of the vulkan SDK on macOS.

More specifically, vulkan-utils uses template haskell which forces the vulkan library to be loaded at compile time, resulting in an especially hard to diagnose loader error that is harder to fix than correcting the rpath of an executable (#501). This fixes that error for LunarG vulkan installations.

The caveat is that this fix is predicated on a Cabal bug being fixed: This will only work from Cabal 3.10.3+ (after cabal#9554 lands).

Fixes #501.

alt-romes commented 7 months ago

Could you perhaps take a look here @expipiplus1 (since I put this one forward)?