Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing libraries on Mac OS X 12.7.4 intel without Homebrew/MacPorts #6444

Open
stixpjr opened this issue May 1, 2024 · 9 comments
Open
Labels
bug Something isn't working
Milestone

Comments

@stixpjr
Copy link

stixpjr commented May 1, 2024

Downloading Widelands-1.2 disk image and installing on Mac OS X 12.7.4 for intel results in missing libraries. Note that I don't have Homebrew or MacPorts on this laptop. Is this expected behaviour?

bash$ ./widelands 
dyld[59963]: Library not loaded: '@rpath/libjxl_cms.0.9.dylib'
  Referenced from: '/Applications/Widelands.app/Contents/libs/libjxl.0.9.dylib'
  Reason: tried: '/Applications/Widelands.app/Contents/libs/../lib/libjxl_cms.0.9.dylib' (no such file), '/usr/local/lib/libjxl_cms.0.9.dylib' (no such file), '/Applications/Widelands.app/Contents/MacOS/../libs/libjxl_cms.0.9.dylib' (no such file), '/usr/local/lib/libjxl_cms.0.9.dylib' (no such file), '/Applications/Widelands.app/Contents/MacOS/../libs/libjxl_cms.0.9.dylib' (no such file), '/usr/local/lib/libjxl_cms.0.9.dylib' (no such file), '/usr/lib/libjxl_cms.0.9.dylib' (no such file)Library not loaded: '@rpath/libsharpyuv.0.dylib'
  Referenced from: '/Applications/Widelands.app/Contents/libs/libwebpdemux.2.dylib'
  Reason: tried: '/Applications/Widelands.app/Contents/libs/../lib/libsharpyuv.0.dylib' (no such file), '/usr/local/lib/libsharpyuv.0.dylib' (no such file), '/Applications/Widelands.app/Contents/MacOS/../libs/libsharpyuv.0.dylib' (no such file), '/usr/local/lib/libsharpyuv.0.dylib' (no such file), '/Applications/Widelands.app/Contents/MacOS/../libs/libsharpyuv.0.dylib' (no such file), '/usr/local/lib/libsharpyuv.0.dylib' (no such file), '/usr/lib/libsharpyuv.0.dylib' (no such file)Library not loaded: '@rpath/libsharpyuv.0.dylib'
  Referenced from: '/Applications/Widelands.app/Contents/libs/libwebp.7.dylib'
  Reason: tried: '/Applications/Widelands.app/Contents/libs/../lib/libsharpyuv.0.dylib' (no such file), '/usr/local/lib/libsharpyuv.0.dylib' (no such file), '/Applications/Widelands.app/Contents/MacOS/../libs/libsharpyuv.0.dylib' (no such file), '/usr/local/lib/libsharpyuv.0.dylib' (no such file), '/Applications/Widelands.app/Contents/MacOS/../libs/libsharpyuv.0.dylib' (no such file), '/usr/local/lib/libsharpyuv.0.dylib' (no such file), '/usr/lib/libsharpyuv.0.dylib' (no such file)
Abort trap: 6
@stixpjr stixpjr added the bug Something isn't working label May 1, 2024
@bunnybot
Copy link

bunnybot commented May 1, 2024

Mirrored on Codeberg as #CB4806.

@bunnybot
Copy link

bunnybot commented May 1, 2024

hessenfarmerMirrored from Codeberg
On Wed May 01 15:36:01 CEST 2024, Stephan Lutz (hessenfarmer) wrote:


<@>Klaus_Halfmann any idea

@bunnybot
Copy link

bunnybot commented May 1, 2024

hessenfarmerMirrored from Codeberg
On Wed May 01 15:36:53 CEST 2024, Stephan Lutz (hessenfarmer) wrote:


<@>Nordfriese
this might be a candidate for the point release as it seems to prevent playing on some macs

@bunnybot bunnybot added this to the v1.2.1 milestone May 1, 2024
@klaus-halfmann
Copy link
Contributor

This is - of cause - not an expected behavior. This should be https://github.com/libjxl/libjxl
which could come via some SDL dependencies. Checking …

  • We do not have this in widelands 1.1 Arm nor 1.1 Intel
  • The script to package the libs should be utils/macos/bundle-dylibs.sh
  • I found it in /Applications/Widelands1.2_intel.app/Contents/libs/libjxl.0.9.dylib
  • AND /Applications/Widelands.app/Contents/libs/libjxl.0.9.dylib (This is the ARM version as I am working on a M1 mac)

I can reproduce this when trying to run Widelands1.2_intel.app :-(

The Arm version works as expected.

I added the xattr -d com.apple.quarantine Widelands.app command to the 1.2 release,
as this was needed once again.

I assume the libraries must be packed in some different way for the Intel Build
(found this when comparing the 1.1 and 1.2 release). we should find
this via some diff between the 1.1 and 1.2 version.

@stixpjr in case you are brave enough you can (try to) do this inside the .app Folder.
I need to revive some x86 Mac in some shelve nearby and do this again.
BUT this will take a lot of time I currently can not spend right now.
My Job needs most of my attention right now.

@stixpjr
Copy link
Author

stixpjr commented May 1, 2024

After installing MacPorts and sudo port install libjxl, I copied libsharpyuv.0.dylib and libjxl_cms.0.10.2.dylib into Widelands.app/Contents/libs/, then created a symlink for libjxl_cms.0.9.dylib pointing to libjxl_cms.0.10.2.dylib - which I assumed wouldn't work, but did. Maybe not all apps introduce API compatibility changes on major version changes…
Yet to play a game, but it seems to now start fine.

@stixpjr
Copy link
Author

stixpjr commented May 2, 2024

My son played a game - works fine!

Looking at widelands/utils/macos/bundle-dylibs.sh, I see it uses otool -L on the executable, and then recursively on the dylibs. I'm not seeing why it wouldn't pick up these deps.

bash$ otool -L MacOS/widelands 
MacOS/widelands:
        /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 23.0.0)
        @rpath/libSDL2_ttf-2.0.0.dylib (compatibility version 2201.0.0, current version 2201.0.0)
        @rpath/libSDL2_mixer-2.0.0.dylib (compatibility version 801.0.0, current version 801.0.0)
        @rpath/libGLEW.2.2.dylib (compatibility version 2.2.0, current version 2.2.0)
        /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
        @rpath/libpng16.16.dylib (compatibility version 58.0.0, current version 58.0.0)
        @rpath/libSDL2_image-2.0.0.dylib (compatibility version 801.0.0, current version 801.2.0)
        @rpath/libicuuc.73.dylib (compatibility version 73.0.0, current version 73.2.0)
        @rpath/libicudata.73.dylib (compatibility version 73.0.0, current version 73.2.0)
        @rpath/libintl.8.dylib (compatibility version 13.0.0, current version 13.0.0)
        /usr/lib/libz.1.dylib (compatibility version 1.0.0, current version 1.2.11)
        @rpath/libSDL2-2.0.0.dylib (compatibility version 3001.0.0, current version 3001.0.0)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.36.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1319.0.0)
bash$ otool -L libs/libSDL2_image-2.0.0.dylib 
libs/libSDL2_image-2.0.0.dylib:
        @rpath/libSDL2_image-2.0.0.dylib (compatibility version 801.0.0, current version 801.2.0)
        @rpath/libpng16.16.dylib (compatibility version 57.0.0, current version 57.0.0)
        @rpath/libjxl.0.9.dylib (compatibility version 0.9.0, current version 0.9.0)
        @rpath/libjpeg.8.dylib (compatibility version 8.0.0, current version 8.3.2)
        @rpath/libtiff.6.dylib (compatibility version 7.0.0, current version 7.2.0)
        @rpath/libavif.16.dylib (compatibility version 16.0.0, current version 16.0.3)
        @rpath/libwebpdemux.2.dylib (compatibility version 3.0.0, current version 3.14.0)
        @rpath/libwebp.7.dylib (compatibility version 9.0.0, current version 9.8.0)
        @rpath/libSDL2-2.0.0.dylib (compatibility version 2801.0.0, current version 2801.5.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)
bash$ otool -L libs/libjxl.0.9.dylib 
libs/libjxl.0.9.dylib:
        @rpath/libjxl.0.9.dylib (compatibility version 0.9.0, current version 0.9.1)
        @rpath/libjxl_cms.0.9.dylib (compatibility version 0.9.0, current version 0.9.1)
        @rpath/libhwy.1.dylib (compatibility version 1.0.0, current version 1.0.7)
        @rpath/libbrotlidec.1.dylib (compatibility version 1.0.0, current version 1.1.0)
        @rpath/libbrotlicommon.1.dylib (compatibility version 1.0.0, current version 1.1.0)
        @rpath/libbrotlienc.1.dylib (compatibility version 1.0.0, current version 1.1.0)
        /usr/lib/libc++.1.dylib (compatibility version 1.0.0, current version 1300.23.0)
        /usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1311.100.3)

@klaus-halfmann
Copy link
Contributor

Hello @stixpjr thanks for checking. I assume you did all of those test on some x86 Mac?

  • How does the intel Version make it into the release? it once was manually compiled by @SirVer
    Can someone point me to the part of the build script?

@stixpjr
Copy link
Author

stixpjr commented May 3, 2024

Correct; machine is:

bash$ uname -a
Darwin xxxxx-macbook.private 21.6.0 Darwin Kernel Version 21.6.0: Mon Feb 19 20:24:34 PST 2024; root:xnu-8020.240.18.707.4~1/RELEASE_X86_64 x86_64
bash$ sw_vers 
ProductName:    macOS
ProductVersion: 12.7.4
BuildVersion:   21H1123

@hessenfarmer
Copy link
Contributor

Hello @stixpjr thanks for checking. I assume you did all of those test on some x86 Mac?

* How does the intel Version make it into the release? it once was manually compiled by @SirVer
  Can someone point me to the part of the build script?

this is the build script which calls for bundle_dylibs.sh.
https://github.com/widelands/widelands/blob/master/.github/workflows/build_macos.yaml

I am not sure but from the buildlogs it seems that we do only pickup the dependencies for 2 levels i.e. we do not perform the recursion till the end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants