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

[7.14 release branch] PyInstaller refuses to build Tribler on Mac #8002

Closed
kozlovsky opened this issue Apr 24, 2024 · 0 comments
Closed

[7.14 release branch] PyInstaller refuses to build Tribler on Mac #8002

kozlovsky opened this issue Apr 24, 2024 · 0 comments
Assignees

Comments

@kozlovsky
Copy link
Contributor

Suddenly, PyInstaller stopped building Tribler binaries on Mac yesterday.

with the following error:

85597 INFO: Loading module hook 'hook-cryptography.py' from '/Users/tribler/jenkins/workspace/Tribler/Build/Build-macOS/tribler/build-env/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks'...
85600 DEBUG: Hook failed with:
Traceback (most recent call last):
  File "/Users/tribler/jenkins/workspace/Tribler/Build/Build-macOS/tribler/build-env/lib/python3.8/site-packages/PyInstaller/depend/imphook.py", line 408, in _load_hook_module
    self._hook_module = importlib_load_source(
  File "/Users/tribler/jenkins/workspace/Tribler/Build/Build-macOS/tribler/build-env/lib/python3.8/site-packages/PyInstaller/compat.py", line 598, in importlib_load_source
    return mod_loader.load_module()
  File "<frozen importlib._bootstrap_external>", line 462, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 962, in load_module
  File "<frozen importlib._bootstrap_external>", line 787, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 702, in _load
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/tribler/jenkins/workspace/Tribler/Build/Build-macOS/tribler/build-env/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-cryptography.py", line 21, in <module>
    from PyInstaller import isolated
ImportError: cannot import name 'isolated' from 'PyInstaller' (/Users/tribler/jenkins/workspace/Tribler/Build/Build-macOS/tribler/build-env/lib/python3.8/site-packages/PyInstaller/__init__.py)
Traceback (most recent call last):
  File "/Users/tribler/jenkins/workspace/Tribler/Build/Build-macOS/tribler/build-env/lib/python3.8/site-packages/PyInstaller/depend/imphook.py", line 408, in _load_hook_module
    self._hook_module = importlib_load_source(
  File "/Users/tribler/jenkins/workspace/Tribler/Build/Build-macOS/tribler/build-env/lib/python3.8/site-packages/PyInstaller/compat.py", line 598, in importlib_load_source
    return mod_loader.load_module()
  File "<frozen importlib._bootstrap_external>", line 462, in _check_name_wrapper
  File "<frozen importlib._bootstrap_external>", line 962, in load_module
  File "<frozen importlib._bootstrap_external>", line 787, in load_module
  File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
  File "<frozen importlib._bootstrap>", line 702, in _load
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/Users/tribler/jenkins/workspace/Tribler/Build/Build-macOS/tribler/build-env/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-cryptography.py", line 21, in <module>
    from PyInstaller import isolated
ImportError: cannot import name 'isolated' from 'PyInstaller' (/Users/tribler/jenkins/workspace/Tribler/Build/Build-macOS/tribler/build-env/lib/python3.8/site-packages/PyInstaller/__init__.py)

After some investigation, this is what happened:

  • For Mac, we specify PyInstaller==4.2 in makedist_macos.sh
  • PyInstaller 4.2 requires pyinstaller-hooks-contrib>=2020.6; that is, it uses the latest version of pyinstaller-hooks-contrib by default
  • Yesterday, pyinstaller-hooks-contrib 2024.5 was released, which is incompatible with Pyinstaller 4.x (works with PyInstaller>=5.0).

So, PyInstaller 4.2 installed pyinstaller-hooks-contrib 2024.5 as a dependency. Then, pyinstaller-hooks-contrib tried importing from PyInstaller import isolated, which works only for Pyinstaller>=5.0.

As a workaround, we can pre-install pyinstaller-hooks-contrib 2024.4, which works with PyInstaller 4.2.

Later, we can reconsider specifying PyInstaller and pyinstaller-hooks-contrib directly in makedist_macos.sh and specify them in requirements-build.txt instead. We can probably also update PyInstaller to version >= 5.0.

@kozlovsky kozlovsky self-assigned this Apr 24, 2024
@kozlovsky kozlovsky changed the title PyInstaller refuses to build Tribler on Mac [7.14 release branch] PyInstaller refuses to build Tribler on Mac Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant