Tribler / tribler

Privacy enhanced BitTorrent client with P2P content discovery
https://www.tribler.org
GNU General Public License v3.0
4.86k stars 450 forks source link

Mac build does not run #8121

Closed xoriole closed 2 months ago

xoriole commented 3 months ago

Mac build does not run on Macbook Pro M2.

Fails with the following stacktrace on console:

Traceback (most recent call last):
  File "PyInstaller/loader/pyimod03_ctypes.py", line 53, in __init__
  File "ctypes/__init__.py", line 374, in __init__
OSError: dlopen(/opt/homebrew/lib/libsodium.dylib, 0x0006): tried: '/opt/homebrew/lib/libsodium.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/lib/libsodium.dylib' (no such file), '/opt/homebrew/lib/libsodium.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/opt/homebrew/Cellar/libsodium/1.0.20/lib/libsodium.26.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/libsodium/1.0.20/lib/libsodium.26.dylib' (no such file), '/opt/homebrew/Cellar/libsodium/1.0.20/lib/libsodium.26.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "run_tribler.py", line 19, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller/loader/pyimod02_importers.py", line 378, in exec_module
  File "tribler/core/session.py", line 10, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller/loader/pyimod02_importers.py", line 378, in exec_module
  File "ipv8/loader.py", line 13, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller/loader/pyimod02_importers.py", line 378, in exec_module
  File "ipv8/keyvault/crypto.py", line 9, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller/loader/pyimod02_importers.py", line 378, in exec_module
  File "ipv8/keyvault/private/libnaclkey.py", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "PyInstaller/loader/pyimod02_importers.py", line 378, in exec_module
  File "libnacl/__init__.py", line 87, in <module>
  File "libnacl/__init__.py", line 21, in _get_nacl
  File "ctypes/__init__.py", line 452, in LoadLibrary
  File "PyInstaller/loader/pyimod03_ctypes.py", line 55, in __init__
pyimod03_ctypes.install.<locals>.PyInstallerImportError: Failed to load dynlib/dll '/opt/homebrew/lib/libsodium.dylib'. Most likely this dynlib/dll was not found when the application was frozen.
[PYI-50476:ERROR] Failed to execute script 'run_tribler' due to unhandled exception!
xoriole commented 3 months ago

Tested on the build machine, both the current Github build and Jenkins build are not working on both Intel and Apple silicon. No stacktrace is available for Intel mac.

qstokkink commented 2 months ago

Based on have 'arm64', need 'x86_64', I guess we'll need to make a separate build for arm64.

We're now building on a macos-12 image, which is x86_64. It seems like we'll have to add a macos-14 image build for arm64.