ericsink / cb

Apache License 2.0
14 stars 13 forks source link

Set install name for macOS to @rpath-based path #8

Closed filipnavara closed 2 years ago

filipnavara commented 2 years ago

Fixes linking in newer .NET 6 Previews where the libe_sqlite3.dylib would have been linked with incorrect relative path (./bin/e_sqlite3/mac/arm64/libe_sqlite3.dylib) into the final executable resulting in this:

/Users/filipnavara/Projects/emclient-temp/MailClient/bin/Debug/net6.0-macos/eM Client.app/Contents/MacOS/eM Client:
    @rpath/libSystem.Globalization.Native.dylib (compatibility version 0.0.0, current version 0.0.0)
        ...
    ./bin/e_sqlite3/mac/arm64/libe_sqlite3.dylib (compatibility version 0.0.0, current version 0.0.0)

The executable would not start because the relative path doesn't exist.

filipnavara commented 2 years ago

Apparently it's an unintended regression in the Xamarin .NET 6 Previews. I filed an issue to track it (https://github.com/xamarin/xamarin-macios/issues/13999). Nevertheless it would not harm to set the install name to a reasonable value.