RawTherapee icon indicating copy to clipboard operation
RawTherapee copied to clipboard

[macOS] Wrong link path in executable for dependency libexpat

Open virtualritz opened this issue 4 years ago • 4 comments

❯ /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

  • RawTherapee: 5.8 (official DMG from website)
  • OS: macOS Catalina 10.15.7

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 avatar Mar 24 '22 12:03 virtualritz

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

virtualritz avatar Mar 24 '22 12:03 virtualritz

Ping @Benitoite

Thanatomanic avatar Mar 24 '22 13:03 Thanatomanic

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

Benitoite avatar Jul 07 '22 07:07 Benitoite

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.

  • Always report issues here based on your test of the dev branch, even if you noticed the issue in a release.

Benitoite avatar Jul 07 '22 11:07 Benitoite

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

Benitoite avatar Feb 28 '23 02:02 Benitoite

New macOS builds with updated libomp 16+

  • [ ] dev
  • [ ] metadata-exiv2

now available in my iCloud shared drive:

  • https://www.icloud.com/iclouddrive/06aKa-Dws-D7mQiNV6819YvgA#rt59

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

Benitoite avatar Jul 17 '23 04:07 Benitoite