minetest / minetest

Luanti (formerly Minetest) is an open source voxel game-creation platform with easy modding and game creation
https://www.minetest.net/
Other
10.78k stars 2.03k forks source link

minetest 5.9.0 release build cannot be run on macOS 10.15 Catalina since it was compiled for macOS 13 #15065

Open JD-Veiga opened 2 months ago

JD-Veiga commented 2 months ago

Minetest version

Minetest: 5.9.0 (download from https://www.minetest.net/downloads/)

Irrlicht device

No response

Operating system and version

macOS 10.15.7 (19H2026)

CPU model

Quad-Core Intel Core i5 3,2 GHz

GPU model

No response

Active renderer

No response

Summary

I cannot not run minetest 5.9.0 in macOS 10.15 (Catalina) from build release downloaded from minetest's website.

Steps to reproduce

When run from terminal, minetest 5.9.0 fails with:

dyld: Symbol not found: __ZNKSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strEv
  Referenced from: [...]/minetest.app/Contents/MacOS/../Frameworks/libjsoncpp.25.dylib (which was built for Mac OS X 13.0)
  Expected in: /usr/lib/libc++.1.dylib

However, the minetest download webpage states that "macOS 10.14 or later is recommended."

Please, produce a build compatible with macOS 10.14 or change the webpage for reflecting the new system requirements for macOS.

Thank you.

sfence commented 2 months ago

For some reason, homebrew installs libjsoncpp with minos 13.0 (Ventura), still page https://formulae.brew.sh/formula/jsoncpp says, it should be available for MacOS Cataline (10.5) also.

JD-Veiga commented 2 months ago

I do not use homebrew at all. I have downloaded the pre-built minetest 5.9.0.

sfence commented 2 months ago

We are using homebrew in github action to build mac os app.

JD-Veiga commented 2 months ago

Ok, I understand.

sfence commented 2 months ago

@JD-Veiga Can you please try this build minetest.zip ? Cross-platform compilation on my Mac from git tag 5.9.0. It Should fully support 10.14 and newer MacOS.

JD-Veiga commented 2 months ago

I am sorry to announce that it does not work for a completely different reason:

dyld: lazy symbol binding failed: Symbol not found: _curl_multi_poll
  Referenced from: [...]/minetest.app/Contents/MacOS/minetest
  Expected in: /usr/lib/libcurl.4.dylib

dyld: Symbol not found: _curl_multi_poll
  Referenced from: [...]/minetest.app/Contents/MacOS/minetest
  Expected in: /usr/lib/libcurl.4.dylib

Abort trap: 6

I must say that, despite of having /usr/lib/libcurl.4.dylib in my system, I think that minetest should use the (latest version) library found at /opt/local/lib/libcurl.4.dylib --I use macports. Supposedly /opt/local directories have precedence in the PATH over /usr ones.

Thanks.

sfence commented 2 months ago

I am sorry to announce that it does not work for a completely different reason:

dyld: lazy symbol binding failed: Symbol not found: _curl_multi_poll
  Referenced from: [...]/minetest.app/Contents/MacOS/minetest
  Expected in: /usr/lib/libcurl.4.dylib

dyld: Symbol not found: _curl_multi_poll
  Referenced from: [...]/minetest.app/Contents/MacOS/minetest
  Expected in: /usr/lib/libcurl.4.dylib

Abort trap: 6

I must say that, despite of having /usr/lib/libcurl.4.dylib in my system, I think that minetest should use the (latest version) library found at /opt/local/lib/libcurl.4.dylib --I use macports. Supposedly /opt/local directories have precedence in the PATH over /usr ones.

Thanks.

Thanks for the quick feedback. Looks like a different kind of problem.

The first Minetest build for MacOS and the only one build done on MacOS 10.15 in GitHub actions is in release 5.6.0. https://github.com/minetest/minetest/releases/tag/5.6.0 I checked it, and this build also links /usr/lib/curl.4.dylib, and the analysis says that this build also uses the symbol _curl_multi_poll.

I should be able to generate minetest.app with the new version of curl integrated, but another problem like this can occur on your side.

Btw: libCurl.4.dylibis loading from the system cache, it is the reason why you can't find it in /usr/libdirectory. I do not see it either. But debugging output from the dynamic loader shows, that it has been found.

Maybe it helps if you try a command like DYLD_PRINT_SEARCHING=1 ./minetest.app/Contents/MacOS/minetest and send me a log.

JD-Veiga commented 2 months ago

I have export DYLD_PRINT_LIBRARIES=1 and run 5.8.0 and 5.9.0 versions and got similar results for curl in both versions.

I have also run otool -L in 5.8.0 and 5.9.0 and got similar results for curl in both cases.

I have attached logs of otool -L for 5.9.0 and running 5.9.0 version with DYLD_PRINT_LIBRARIES=1.

I can figure out what DYLD_PRINT)SEARCHING=1 is. I suppose it is a typo. If you need anything different from DYLD_PRINT_LIBRARIES, please ask me.

I hope that was useful for you. Sorry, I really do not know so much about debugging C++ on macOS.

otool_l_log.txt dyld_log.txt

sfence commented 2 months ago

Are you able to run 5.6.0 version? it is an only one version which have .dylib libraries for minos version 10.15.

JD-Veiga commented 2 months ago

I can run 5.6.0, 5.6.1 and 5.8.0 (currently my installed version) without a problem.

sfence commented 2 months ago

Can you try this build? https://github.com/minetest/minetest/actions/runs/10645513477/artifacts/1877804712 It comes from GitHub runner under macos-12, so should works similar as 5.8.0 version. This is master branch version, so not good for permanently update at all.

JD-Veiga commented 2 months ago

Can you try this build? https://github.com/minetest/minetest/actions/runs/10645513477/artifacts/1877804712 It comes from GitHub runner under macos-12, so should works similar as 5.8.0 version. This is master branch version, so not good for permanently update at all.

This version does not work:

 dyld: Symbol not found: __ZNKSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strEv
  Referenced from: ./minetest.app/Contents/MacOS/../Frameworks/libleveldb.1.dylib (which was built for Mac OS X 12.0)
  Expected in: /usr/lib/libc++.1.dylib

Abort trap: 6
sfence commented 2 months ago

Ok. Thanks for feedback.

This looks like a problem with C++ linking problem.

By all this, I think this is a C++ linking problem.

In C++ unlike C is no guarantee that symbols names will be identical if you compile something with new compiler version.

There is still some possibilities to fix this. Probably static linking with libc++ for Minetest and all libraries it depends on can help. But I need to fix cross build first (it is now blocked by reported bug in libtool probably).

sfence commented 2 months ago

Another try. This is cross build from my Mac. It is linked with MacOSX10.5 SDK (tag 5.9.0). minetest.zip

I will try to use also old C++ header files if this does not work on your system. (C++ headers are not part of MacOSX10.5 SDK)

JD-Veiga commented 2 months ago

It still fails. Again:

dyld: lazy symbol binding failed: Symbol not found: _curl_multi_poll
  Referenced from: ./minetest.app/Contents/MacOS/minetest
  Expected in: /usr/lib/libcurl.4.dylib

dyld: Symbol not found: _curl_multi_poll
  Referenced from: ./minetest.app/Contents/MacOS/minetest
  Expected in: /usr/lib/libcurl.4.dylib

[1]+  Abort trap: 6           ./minetest.app/Contents/MacOS/minetest

Sorry.

JD-Veiga commented 2 months ago

On the other hand, I have tried to compile 5.9.0 by myself. Compilation goes fine. However, Irrlicht fails to detect my GPU and OpenGL 2.1 and stops the program.

How can I force that my GPU and proper OpenGL version will be detected? cmake does not detect OpenGL either.

Is it helpful for you that I try to compile minetest on my system?

sfence commented 2 months ago

I found a bug in my compilation script. Minetest_5.9.0_cross_MacOS11_SDK.zip

Minetest_5.9.0_cross_MacOS10.15_SDK_nocxx.zip

I checked it with grep and nm, these two builds should not try to link the symbol _curl_multi_poll. So it is hopefully linked with a good SDK, because that symbol is only in curl from MacOS 14 SDK.

sfence commented 2 months ago

This is the version from .github action: https://github.com/minetest/minetest/actions/runs/10670898499/artifacts/1883103399 , for 10.15, c++ headers from 14

No problem, you are trying it. Do you have MacOSX10.15 SDK? OpenGL framework should be in it.

JD-Veiga commented 2 months ago

Do you have MacOSX10.15 SDK? OpenGL framework should be in it.

I am not sure. XCode 12.4 is installed so I suppose that the corresponding SDK would be installed too.

sfence commented 2 months ago

Do you have MacOSX10.15 SDK? OpenGL framework should be in it.

I am not sure. XCode 14.2 is installed so I suppose that the corresponding SDK would be installed too.

Probably not. With my Xcode 15, only SDK for MacOS 14 and 13 comes.

sfence commented 2 months ago

You can use xcrun --show-sdk-path command to see your path to the SDK directory.

This can help you: https://gitlab.freedesktop.org/freetype/freetype/-/issues/1296#note_2552653

JD-Veiga commented 2 months ago

You can use xcrun --show-sdk-path command to see your path to the SDK directory.

Yeah, it is installed: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk

sfence commented 2 months ago

@JD-Veiga Did you test the last builds I sent?

JD-Veiga commented 2 months ago

This is the version from .github action: https://github.com/minetest/minetest/actions/runs/10670898499/artifacts/1883103399 , for 10.15, c++ headers from 14

No problem, you are trying it. Do you have MacOSX10.15 SDK? OpenGL framework should be in it.

5.10 works!!

Sorry, I was very busy during last days and lost this.

JD-Veiga commented 2 months ago

I found a bug in my compilation script. Minetest_5.9.0_cross_MacOS11_SDK.zip

Minetest_5.9.0_cross_MacOS10.15_SDK_nocxx.zip

I checked it with grep and nm, these two builds should not try to link the symbol _curl_multi_poll. So it is hopefully linked with a good SDK, because that symbol is only in curl from MacOS 14 SDK.

Minetest_5.9.0_cross_MacOS10.15_SDK_nocxx also works!!

(On the contrary, Minetest_5.9.0_cross_MacOS11_SDK does not work. Well, it is incompatible so I can even open it)

sfence commented 2 months ago

Thanks for the feedback. :)

JD-Veiga commented 2 months ago

Thank for your patience and persistence.

xxxlovecola commented 1 month ago

Hello, the same problem is now happening for 5.9.1 release, not compatible with Mac OS 10.15 :

Termination Reason:    DYLD, [0x4] Symbol missing

Application Specific Information:
dyld: launch, loading dependent libraries

Dyld Error Message:
  Symbol not found: __ZNKSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strEv
  Referenced from: /Applications/minetest.app/Contents/MacOS/../Frameworks/libleveldb.1.dylib (which was built for Mac OS X 12.0)
  Expected in: /usr/lib/libc++.1.dylib
appgurueu commented 1 month ago

Hello, the same problem is now happening for 5.9.1 release, not compatible with Mac OS 10.15

Of course, since #15069 hasn't been merged yet, our CI still produces incompatible builds. If you apply the CI setup from that PR to 5.9.1, you should get a compatible build.

xxxlovecola commented 1 month ago

OK, because in the 5.9.1 release notes ( https://dev.minetest.net/Changelog#5.9.0_.E2.86.92_5.9.1 ) I have read : Misc / Maintenance macOS 12 support (sfence)

And I thought it was about 10.15 I don't know why. OK so maybe for 5.9.2 :-) Thank you.

sfence commented 1 month ago

@xxxlovecola It was easy: two lines and one comment change to support macOS 12 because macOS 12 is supported by GitHub actions. There is no guarantee that #15069 will be merged.

Here is an unofficial build for Minetest 5.9.1. Minetest_5.9.1_for_macOS10.15.zip