Beep6581 / RawTherapee

A powerful cross-platform raw photo processing program
https://rawtherapee.com
GNU General Public License v3.0
2.7k stars 308 forks source link

[macOS] Wrong link path in executable for dependency libexpat #6440

Open virtualritz opened 2 years ago

virtualritz commented 2 years ago
❯ /Applications/RawTherapee.app/Contents/MacOS/rawtherapee
dyld: Library not loaded: /usr/lib/libexpat.1.dylib
  Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
  Reason: Incompatible library version: ImageIO requires version 7.0.0 or later, but libexpat.1.dylib provides version 1.0.0
[1]    648 abort      /Applications/RawTherapee.app/Contents/MacOS/rawtherapee

Short description

It looks like system's dynamic linker finds the wrong version of the library. Instead of using the one in /Applications/RawTherapee.app/Contents/Frameworks/ it finds the one in /usr/lib/.

Additional information

Suggestion

rawtherapee-bin uses @rpath/libexpat.1.dylib. I wager that switching that to @executable_path/../Frameworks/libexpat.1.dylib may fix this. And while at it, fix this for all shipped dependencies in Frameworks.

virtualritz commented 2 years ago

Good overview: https://blog.krzyzanowskim.com/2018/12/05/rpath-what/

Thanatomanic commented 2 years ago

Ping @Benitoite

Benitoite commented 2 years ago

@Thanatomanic Not reproduced on my fresh Catalina vm with website release, which was built two years ago...

Benitoite commented 2 years ago

Also, hard-coded paths are used in dev since a few weeks after the 5.8 tag, as part of the so-called "hardened runtime", a prerequisite of Apple's notary service.

Benitoite commented 1 year ago

BTW linking to non-system expat might not even be required; experimenting with letting it link to sys.

Benitoite commented 1 year ago

New macOS builds with updated libomp 16+

now available in my iCloud shared drive:

If you can test, please let us know if it works for you. If you are seeking help on your own build system, please include the complete AboutThisBuild.txt.

My working systems:

Apple clang version 14.0.3 (clang-1403.0.22.14.1)
Target: arm64-apple-darwin22.5.0
Thread model: posix
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: x86_64-apple-darwin20.6.0
Thread model: posix