From ea21ae35e8d623955f329d0be3e3b63ab3a3bc7e Mon Sep 17 00:00:00 2001 From: SomberNight Date: Wed, 6 Apr 2022 20:56:57 +0200 Subject: [PATCH] mac build: add workaround for installing pyinstaller with setuptools 61 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - the mac build broke with https://github.com/spesmilo/electrum/commit/184e122c36555b23bd466cb7a2521c09a09ce6cc - upstream fix is at https://github.com/pyinstaller/pyinstaller/pull/6701 however, we are using an old version of pyinstaller atm, so this workaround is easier log excerpt of failed build: ``` 💬 INFO: Installing PyInstaller. Processing ./contrib/osx/.cache/pyinstaller Preparing metadata (pyproject.toml) ... error error: subprocess-exited-with-error × Preparing metadata (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> [42 lines of output] Traceback (most recent call last): File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in main() File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 164, in prepare_metadata_for_build_wheel return hook(metadata_directory, config_settings) File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/build_meta.py", line 188, in prepare_metadata_for_build_wheel self.run_setup() File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/build_meta.py", line 281, in run_setup super(_BuildMetaLegacyBackend, File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/build_meta.py", line 174, in run_setup exec(compile(code, __file__, 'exec'), locals()) File "setup.py", line 75, in setup( File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/__init__.py", line 87, in setup return distutils.core.setup(**attrs) File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 122, in setup dist.parse_config_files() File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/dist.py", line 850, in parse_config_files setupcfg.parse_configuration( File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/config/setupcfg.py", line 167, in parse_configuration meta.parse() File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/config/setupcfg.py", line 446, in parse section_parser_method(section_options) File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/config/setupcfg.py", line 417, in parse_section self[name] = value File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/config/setupcfg.py", line 238, in __setitem__ value = parser(value) File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/config/setupcfg.py", line 552, in _parse_version return expand.version(self._parse_attr(value, self.package_dir, self.root_dir)) File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/config/setupcfg.py", line 372, in _parse_attr return expand.read_attr(attr_desc, package_dir, root_dir) File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/config/expand.py", line 194, in read_attr module = _load_spec(spec, module_name) File "/Users/user/wspace/electrum/contrib/osx/build-venv/lib/python3.9/site-packages/setuptools/config/expand.py", line 214, in _load_spec spec.loader.exec_module(module) # type: ignore File "", line 850, in exec_module File "", line 228, in _call_with_frames_removed File "/Users/user/wspace/electrum/contrib/osx/.cache/pyinstaller/PyInstaller.py", line 16, in from PyInstaller.__main__ import run ModuleNotFoundError: No module named 'PyInstaller.__main__'; 'PyInstaller' is not a package [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. note: This is an issue with the package mentioned above, not pip. hint: See above for details. ``` --- contrib/osx/make_osx | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/osx/make_osx b/contrib/osx/make_osx index 3d7e02ca3..94ea087e5 100755 --- a/contrib/osx/make_osx +++ b/contrib/osx/make_osx @@ -136,6 +136,7 @@ PYINSTALLER_COMMIT="40c9abce2d8de879e414fd377c933dccaab1e156" popd # sanity check bootloader is there: [[ -e "PyInstaller/bootloader/Darwin-64bit/runw" ]] || fail "Could not find runw in target dir!" + rm pyinstaller.py # workaround for https://github.com/pyinstaller/pyinstaller/pull/6701 ) || fail "PyInstaller build failed" info "Installing PyInstaller." python3 -m pip install --no-build-isolation --no-dependencies --no-warn-script-location "$CACHEDIR/pyinstaller"