1
0
Commit Graph

138 Commits

Author SHA1 Message Date
SomberNight
47d094fda0 mac build: bump declared min supported macos version (10.13->11)
due to the qt 5.15 -> qt 6.7 bump

related https://github.com/spesmilo/electrum/issues/3685
2024-09-18 15:48:43 +00:00
SomberNight
cfe8502f96 qt desktop gui: upgrade qt5->qt6
closes https://github.com/spesmilo/electrum/issues/8007
2024-09-18 15:48:38 +00:00
SomberNight
d46e724816 win/mac build: bump pyinstaller (5.13.2->6.6.0) 2024-04-19 13:07:39 +00:00
SomberNight
85af0b8030 win/mac build: bump pyinstaller (5.11.0->5.13.2)
- needed for bumping python version, as 3.11+ is borked without https://github.com/pyinstaller/pyinstaller/issues/7692
- plugin.py: adapt to pyinstaller 5.12+
    loader was renamed in b9111db8a8
2024-04-18 18:16:10 +00:00
SomberNight
41d6f08de9 win/mac build: bump python version (3.10.11->3.11.9) 2024-04-18 18:15:26 +00:00
ThomasV
de5ca461d4 contrib/osx:
- rename make_osx2.sh -> sign_osx.sh
- add command to unlock keychain
- chmod +x
2024-03-15 11:02:45 +01:00
SomberNight
409bd0199c build: split make_osx.sh script into two: "build" and "sign" parts 2024-03-15 11:02:45 +01:00
SomberNight
9c7b2bd877 mac build: log hash of .app for quick checking of build-repro
I think that hash should match between unsigned and release builds,
as the codesigning/notarisation is done right after.
2023-12-13 18:16:57 +00:00
SomberNight
c98830d091 mac build: follow-up prev (altool -> notarytool migration)
related 7ee078852a
2023-12-12 00:57:01 +00:00
ThomasV
99da6507fc osx builds: use notarytool 2023-12-12 00:56:58 +00:00
SomberNight
86f6e3dbcb mac build: update README for new macOS 11 build VM
- For the notarisation, we were using "altool" (part of xcode), but Apple now fully deprecated that.
    - need to migrate from altool to notarytool
        https://developer.apple.com/news/?id=y5mjxqmn
    - currently using macOS 10.14.6
                  and xcode 11.3.1
    - notarytool requires xcode 13+
    - xcode 13 requires macOS 11.3
        https://en.wikipedia.org/wiki/Xcode#Version_comparison_table
    ==> created new build VM with macOS 11.7.10 and xcode 13.2
2023-12-12 00:56:55 +00:00
SomberNight
77f84060f4 mac build: clang to always target x86_64
With newer xcode (12+, I think), the default behaviour is to build
universal binaries that include native code for both arm64 and x86_64.
On older xcode, the default was to only target x86_64.

I am not sure why, but "hid.cpython-310-darwin.so" is not built
reproducibly when it is "universal".
(Even for consecutive builds done on the same machine.)
```
- + diff='Files /tmp/electrum_compare_dmg/signed_app/Electrum.app/Contents/MacOS/hid.cpython-310-darwin.so and /tmp/electrum_compare_dmg/dmg2/Electrum.app/Contents/MacOS/hid.cpython-310-darwin.so differ
```

This commit works around the reproducibly issue by making clang only
build for the x86_64 target. The binary should still be able to run
on arm64 macs using rosetta (same with previous versions of Electrum).

-----

The `lipo` tool can tell what archs a shared object is built for, e.g.:
```
$ lipo -info /Users/vagrant/electrum/contrib/osx/build-venv/lib/python3.10/site-packages/hid.cpython-310-darwin.so
Non-fat file: /Users/vagrant/electrum/contrib/osx/build-venv/lib/python3.10/site-packages/hid.cpython-310-darwin.so is architecture: x86_64
```

For quick testing, we don't need to build the whole .app, only hid.so:
```
source /Users/vagrant/electrum/contrib/osx/build-venv/bin/activate
export CFLAGS="-g0"
python3 -m pip install -I --no-build-isolation --no-dependencies --no-binary :all: --no-warn-script-location hidapi==0.14.0
strip -x /Users/vagrant/electrum/contrib/osx/build-venv/lib/python3.10/site-packages/hid.cpython-310-darwin.so
cp /Users/vagrant/electrum/contrib/osx/build-venv/lib/python3.10/site-packages/hid.cpython-310-darwin.so /Users/vagrant/wspace/tmp/try7/hid10.so
```

Re ARCHFLAGS env var, see https://stackoverflow.com/a/5808548

-----

Note: I've found several xcode build settings that looked relevant
but in the end were not useful, e.g. ARCHS, ONLY_ACTIVE_ARCH,
EXCLUDED_ARCHS, VALID_ARCHS.
- see https://developer.apple.com/documentation/technotes/tn3117-resolving-build-errors-for-apple-silicon
- see https://stackoverflow.com/a/64422757
2023-12-12 00:56:43 +00:00
SomberNight
9743bd5219 pyinstaller build: (trivial) format so that win/osx look more similar 2023-11-30 13:52:20 +00:00
SomberNight
b551cb5f75 pyinstaller build: better parameterise .spec 2023-11-30 13:50:21 +00:00
SomberNight
0912e5615d pyinstaller build: follow-up: dirty hack for duplicate plugins
Ah ok, I give up for now... the prev does not really work.

The prior commit works on Windows but not on macOS.
On Windows, it would package all plugins as code and only as code.
On MacOS however, it would not package any plugins at all. And with this commit,
where I mark the plugins folder to be packaged as *data*, it packages all plugins as *both* code and data.
Not sure why.

Let's just package all plugins as both code and data, and ignore the code instances explicitly...
2023-11-30 13:48:53 +00:00
SomberNight
4cc9ef2078 pyinstaller build: clean-up .spec, fix issue described in prev commit
The hw_wallet and jade plugins were being included twice in the pyinstaller binaries.
They were apparently the only two plugins being picked as "modules" (a.pure),
which by default are included as compiled-bytecode.
In addition, we included "electrum/plugins" as data (a.data), which meant all
plugins in source form.

Instead of hacking around to fix the specific issue, this attempts a larger clean-up.
2023-11-30 13:44:31 +00:00
SomberNight
1451ec936a win/mac build: fix pyinstaller missing libsecp during part of Analysis
```
602 WARNING: Failed to collect submodules for 'pkg_resources._vendor.pyparsing.diagram' because importing 'pkg_resources._vendor.pyparsing.diagram' raised: ModuleNotFoundError: No module named 'railroad'
libsecp256k1 library failed to load. exceptions: [FileNotFoundError("Could not find module 'C:\\python3\\lib\\site-packages\\electrum\\libsecp256k1-2.dll' (or one of its dependencies). Try using the full path with constructor syntax."), FileNotFoundError("Could not find module 'C:\\python3\\lib\\site-packages\\electrum\\libsecp256k1-1.dll'(or one of its dependencies). Try using the full path with constructor syntax."), FileNotFoundError("Could not find module 'C:\\python3\\lib\\site-packages\\electrum\\libsecp256k1-0.dll' (or one of its dependencies). Try using the full path with constructor syntax."), FileNotFoundError("Could not find module 'libsecp256k1-2.dll' (or one ofits dependencies). Try using the full path with constructor syntax."), FileNotFoundError("Could not find module 'libsecp256k1-1.dll' (or one of its dependencies). Try using the full path with constructor syntax."), FileNotFoundError("Could not find module 'libsecp256k1-0.dll' (or one of its dependencies). Try using the full path with constructor syntax.")]
libsecp256k1 library failed to load. exceptions: [FileNotFoundError("Could not find module 'C:\\python3\\lib\\site-packages\\electrum\\libsecp256k1-2.dll' (or one of its dependencies). Try using the full path with constructor syntax."), FileNotFoundError("Could not find module 'C:\\python3\\lib\\site-packages\\electrum\\libsecp256k1-1.dll'(or one of its dependencies). Try using the full path with constructor syntax."), FileNotFoundError("Could not find module 'C:\\python3\\lib\\site-packages\\electrum\\libsecp256k1-0.dll' (or one of its dependencies). Try using the full path with constructor syntax."), FileNotFoundError("Could not find module 'libsecp256k1-2.dll' (or one ofits dependencies). Try using the full path with constructor syntax."), FileNotFoundError("Could not find module 'libsecp256k1-1.dll' (or one of its dependencies). Try using the full path with constructor syntax."), FileNotFoundError("Could not find module 'libsecp256k1-0.dll' (or one of its dependencies). Try using the full path with constructor syntax.")]
libsecp256k1 library failed to load. exceptions: [FileNotFoundError("Could not find module 'C:\\python3\\lib\\site-packages\\electrum\\libsecp256k1-2.dll' (or one of its dependencies). Try using the full path with constructor syntax."), FileNotFoundError("Could not find module 'C:\\python3\\lib\\site-packages\\electrum\\libsecp256k1-1.dll'(or one of its dependencies). Try using the full path with constructor syntax."), FileNotFoundError("Could not find module 'C:\\python3\\lib\\site-packages\\electrum\\libsecp256k1-0.dll' (or one of its dependencies). Try using the full path with constructor syntax."), FileNotFoundError("Could not find module 'libsecp256k1-2.dll' (or one ofits dependencies). Try using the full path with constructor syntax."), FileNotFoundError("Could not find module 'libsecp256k1-1.dll' (or one of its dependencies). Try using the full path with constructor syntax."), FileNotFoundError("Could not find module 'libsecp256k1-0.dll' (or one of its dependencies). Try using the full path with constructor syntax.")]
5921 WARNING: collect_data_files - skipping data collection for module 'electrum.plugins' as it is not a package.
```
2023-11-30 13:43:54 +00:00
SomberNight
262c009c67 pyinstaller build: towards fixing missing "gui/common_qt" folder
pyinstaller tries to import electrum and its different submodules at build-time
during the "Analysis" phase. sys._GUI_QT_VERSION was not getting set there,
and the resulting exception was blocking pyinstaller from discovering that
gui/common_qt is being used.

at runtime:
```
$ ./dist/Electrum.app/Contents/MacOS/run_electrum
  1.53 | E | daemon.Daemon | GUI raised exception: Exception('Error loading trustedcoin plugin: ModuleNotFoundError("No module named \'electrum.gui.common_qt\'")'). shutting down.
  1.53 | E | __main__ | daemon.run_gui errored
Traceback (most recent call last):
  File "electrum/plugin.py", line 135, in load_plugin
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/Users/vagrant/electrum/dist/Electrum.app/Contents/MacOS/electrum/plugins/trustedcoin/qt.py", line 51, in <module>
    from .common_qt import TrustedcoinPluginQObject
  File "/Users/vagrant/electrum/dist/Electrum.app/Contents/MacOS/electrum/plugins/trustedcoin/common_qt.py", line 16, in <module>
    from electrum.gui.common_qt.plugins import PluginQObject
ModuleNotFoundError: No module named 'electrum.gui.common_qt'

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

Traceback (most recent call last):
  File "run_electrum", line 456, in handle_cmd
    d.run_gui()
  File "electrum/daemon.py", line 617, in run_gui
    self.gui_object = gui.ElectrumGui(config=self.config, daemon=self, plugins=self._plugins)
  File "electrum/util.py", line 473, in do_profile
    o = func(*args, **kw_args)
  File "electrum/gui/qt/__init__.py", line 153, in __init__
    self.plugins.load_plugin('trustedcoin')
  File "electrum/plugin.py", line 138, in load_plugin
    raise Exception(f"Error loading {name} plugin: {repr(e)}") from e
Exception: Error loading trustedcoin plugin: ModuleNotFoundError("No module named 'electrum.gui.common_qt'")
```
2023-11-30 13:43:50 +00:00
SomberNight
48a8311849 mac build: bump pyinstaller (5.3->5.11) 2023-06-02 23:04:42 +00:00
SomberNight
6442dbb021 mac build: bump python version (3.9.13->3.10.11) 2023-06-02 17:17:40 +00:00
SomberNight
cede16a522 libsecp256k1: update hardcoded .so lib name in binaries
follow-up 2a2b683d23

TODO: maybe we should drop the version number in the lib name we bundle...
2023-04-21 14:42:51 +00:00
SomberNight
f25e384654 build: fail if not inside git clone
related: https://github.com/spesmilo/electrum/issues/8284
2023-03-28 22:35:19 +00:00
ghost43
0eea47c78d libsecp256k1: update hardcoded .so lib name in binaries (#8186)
follow-up 7d83335e34
2023-02-04 01:36:19 +00:00
SomberNight
8cfbce827c ledger plugin: fix binaries
follow-up https://github.com/spesmilo/electrum/pull/8041
(ac239a81b8)
2022-12-03 22:52:23 +00:00
SomberNight
1e404f4e30 binaries: update python and openssl
note: python 3.9.x is now in source-only mode, so could not update to latest...
it is time to investigate upgrading to python 3.10 in the win and mac binaries
2022-11-05 14:41:23 +00:00
SomberNight
3b03bc9b29 CI: cache built *.dylib on macOS
note: the extra copies in make_osx.sh are needed because of the CI caching
(pyinstaller needs to see the .dylib's inside electrum/, e.g. when importing electrum during Analysis)
2022-11-04 15:49:12 +00:00
SomberNight
b5900eae98 contrib: reformat most shell scripts
Mostly just indentations.
For consistency, to conform to .editorconfig.
2022-09-27 14:55:22 +00:00
SomberNight
1cecd2c6e8 contrib: rename some shell scripts to have ".sh" extension
The extension gives formatting hints to some editors. (especially if they support .editorconfig)
2022-09-27 13:34:03 +00:00
SomberNight
77c2d4ec06 mac build: note in README: pyinstaller picks up extraneous brew pkgs
ThomasV had libffi installed via brew, and this side-effected the built electrum dmg.
`('libffi.8.dylib', '/usr/local/opt/libffi/lib/libffi.8.dylib', 'BINARY')`

this was the cause of 019d213325
2022-09-26 17:58:58 +00:00
SomberNight
0abecffe6d mac build: force using source dist for most of our python dependencies
We compile from tar.gz, instead of using pre-built binary wheels from PyPI.
(or if the dep is pure-python, use tar.gz instead of "source-only" wheel)

-----
Some unorganised things below for future reference.

```
$ dsymutil -dump-debug-map dist1/hid.cpython-39-darwin.so
warning: (x86_64) /private/var/folders/1n/zc14m3td0rg4nt0ftklmm7z00000gn/T/pip-install-bm88zvc1/hidapi_cd307bc31ab34252b77d11d6d7212fc5/build/temp.macosx-10.9-x86_64-3.9/hid.o unable to open object file: No such file or directory
warning: (x86_64) /private/var/folders/1n/zc14m3td0rg4nt0ftklmm7z00000gn/T/pip-install-bm88zvc1/hidapi_cd307bc31ab34252b77d11d6d7212fc5/build/temp.macosx-10.9-x86_64-3.9/hidapi/mac/hid.o unable to open object file: No such file or directory
---
triple:          'x86_64-apple-darwin'
binary-path:     'dist1/hid.cpython-39-darwin.so'
...
```

```
$ nm -pa dist1/hid.cpython-39-darwin.so
```

- https://stackoverflow.com/questions/10044697/where-how-does-apples-gcc-store-dwarf-inside-an-executable
- https://github.com/pypa/pip/issues/6505
- https://github.com/pypa/pip/issues/7808#issuecomment-770275723
- https://github.com/NixOS/nixpkgs/pull/91272
- https://github.com/cython/cython/pull/1576
- 9d2ba1611b/Cython/Compiler/ModuleNode.py (L913)
2022-09-26 12:16:02 +00:00
SomberNight
a143d05fb9 mac build: bump pyinstaller (4.2 -> 5.3) 2022-08-29 15:22:47 +00:00
SomberNight
b3e869a5de build win/mac: do not pass custom args to pyinstaller; use envvars
custom args no longer work with pyinstaller 5.0 (see https://github.com/pyinstaller/pyinstaller/issues/6762 )

```
option(s) not allowed:
  ...
makespec options not valid when a .spec file is given
```
2022-08-29 15:22:43 +00:00
SomberNight
89e1bbf4ec mac build: add message to camera permission prompt, in Info.plist
based on 0b5b5fb228

Co-authored-by: Calin Culianu <calin.culianu@gmail.com>
2022-08-29 13:46:47 +00:00
SomberNight
e39ab1623a mac build: set minimum system version to 10.13.0 in Info.plist
based on 907e5e7009

This way users get more feedback from the OS when they attempt to launch the app on old macOS.

Co-authored-by: Calin Culianu <calin.culianu@gmail.com>
2022-08-29 13:43:57 +00:00
SomberNight
859d43d0b2 mac build: let pyinstaller handle Info.plist
note: newer versions of pyinstaller (4.4+ ?) want to sign the bundle
themselves, in which case modifying the Info.plist file after
pyinstaller returns invalidates the sig.
2022-08-29 13:35:39 +00:00
SomberNight
abec59e17d mac build: rm unused BUILDDIR 2022-08-29 12:47:31 +00:00
SomberNight
83cc2d4bc0 build: osx readme: note cli xcode needs to be deleted before install
upgrading an existing directory does not seem to work well
2022-08-19 14:32:39 +00:00
SomberNight
019d213325 Revert "mac build: force using source dist for most of our python dependencies"
This reverts commit 0c2a885c66.

Reverting for now due to reproducibility issues:
```
error: /Users/vagrant/Downloads/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate: can't open file: /tmp/electrum_compare_dmg/signed_app/Electrum.app/Contents/MacOS/libffi.8.dylib (No such file or directory)
```
`Electrum.app/Contents/MacOS/libffi.8.dylib` is included when building on one machine, but missing on the other...
Will have to investigate later.

related https://github.com/spesmilo/electrum/pull/7918
2022-08-17 17:07:22 +00:00
SomberNight
c2b5e3ec15 build: use build-locale.sh in all build scripts 2022-08-16 19:06:47 +00:00
SomberNight
0c2a885c66 mac build: force using source dist for most of our python dependencies
We compile from tar.gz, instead of using pre-built binary wheels from PyPI.
(or if the dep is pure-python, use tar.gz instead of "source-only" wheel)

-----
Some unorganised things below for future reference.

```
$ dsymutil -dump-debug-map dist1/hid.cpython-39-darwin.so
warning: (x86_64) /private/var/folders/1n/zc14m3td0rg4nt0ftklmm7z00000gn/T/pip-install-bm88zvc1/hidapi_cd307bc31ab34252b77d11d6d7212fc5/build/temp.macosx-10.9-x86_64-3.9/hid.o unable to open object file: No such file or directory
warning: (x86_64) /private/var/folders/1n/zc14m3td0rg4nt0ftklmm7z00000gn/T/pip-install-bm88zvc1/hidapi_cd307bc31ab34252b77d11d6d7212fc5/build/temp.macosx-10.9-x86_64-3.9/hidapi/mac/hid.o unable to open object file: No such file or directory
---
triple:          'x86_64-apple-darwin'
binary-path:     'dist1/hid.cpython-39-darwin.so'
...
```

```
$ nm -pa dist1/hid.cpython-39-darwin.so
```

- https://stackoverflow.com/questions/10044697/where-how-does-apples-gcc-store-dwarf-inside-an-executable
- https://github.com/pypa/pip/issues/6505
- https://github.com/pypa/pip/issues/7808#issuecomment-770275723
- https://github.com/NixOS/nixpkgs/pull/91272
- https://github.com/cython/cython/pull/1576
- 9d2ba1611b/Cython/Compiler/ModuleNode.py (L913)
2022-08-06 07:52:03 +02:00
SomberNight
150ebe116a mac build: maybe fix reproducibility fail (_cbor.cpython-39-darwin.so)
vagrants-iMac:electrum vagrant$ ./contrib/osx/compare_dmg dist/electrum-4.3.0-ghost43.dmg /Users/vagrant/Desktop/electrum-4.3.0-thomas1.dmg
[...]
Extracting signatures from release app...
Created mac_extracted_sigs.tar.gz
Applying extracted signatures to unsigned app...
Done. .app with sigs applied is at: /tmp/electrum_compare_dmg/signed_app
++ diff -qr /tmp/electrum_compare_dmg/signed_app /tmp/electrum_compare_dmg/dmg2
+ diff='Files /tmp/electrum_compare_dmg/signed_app/Electrum.app/Contents/MacOS/cbor/_cbor.cpython-39-darwin.so and /tmp/electrum_compare_dmg/dmg2/Electrum.app/Contents/MacOS/cbor/_cbor.cpython-39-darwin.so differ'
+ diff='diff errored'
+ set +x
diff errored
DMGs do *not* match.
failure

user@user-VirtualBox:~/wspace/tmp$ vbindiff comp/signed_app/_cbor.cpython-39-darwin.so comp/dmg2/_cbor.cpython-39-darwin.so

comp/signed_app/_cbor.cpython-39-darwin.so
0000 6AC0: 00 5F 50 79 49 6E 69 74  5F 5F 63 62 6F 72 2E 6D  ._PyInit __cbor.m
0000 6AD0: 6F 64 65 66 00 5F 43 62  6F 72 4D 65 74 68 6F 64  odef._Cb orMethod
0000 6AE0: 73 00 2F 70 72 69 76 61  74 65 2F 76 61 72 2F 66  s./priva te/var/f
0000 6AF0: 6F 6C 64 65 72 73 2F 35  36 2F 64 38 36 70 35 39  olders/5 6/d86p59
0000 6B00: 37 31 31 67 7A 63 62 38  73 31 71 37 31 36 78 31  711gzcb8 s1q716x1
0000 6B10: 6C 63 30 30 30 30 67 6E  2F 54 2F 70 69 70 2D 69  lc0000gn /T/pip-i
0000 6B20: 6E 73 74 61 6C 6C 2D 36  6D 69 36 68 6C 75 65 2F  nstall-6 mi6hlue/
comp/dmg2/_cbor.cpython-39-darwin.so
0000 6AC0: 00 5F 50 79 49 6E 69 74  5F 5F 63 62 6F 72 2E 6D  ._PyInit __cbor.m
0000 6AD0: 6F 64 65 66 00 5F 43 62  6F 72 4D 65 74 68 6F 64  odef._Cb orMethod
0000 6AE0: 73 00 2F 70 72 69 76 61  74 65 2F 76 61 72 2F 66  s./priva te/var/f
0000 6AF0: 6F 6C 64 65 72 73 2F 37  68 2F 70 33 30 7A 5F 74  olders/7 h/p30z_t
0000 6B00: 79 31 35 30 31 32 70 66  5F 33 64 79 78 62 73 39  y15012pf _3dyxbs9
0000 6B10: 33 34 30 30 30 30 67 6E  2F 54 2F 70 69 70 2D 69  340000gn /T/pip-i
0000 6B20: 6E 73 74 61 6C 6C 2D 30  68 64 39 63 35 6D 65 2F  nstall-0 hd9c5me/

related: https://github.com/pypa/pip/issues/6505
2022-08-05 15:57:10 +02:00
SomberNight
941db4214c README: add Windows- & macOS-specific "how to run from source" readmes
note: unclear where to put these files... `contrib/build-wine/` and `contrib/osx/`
contain binary-building-related files. maybe we could have a `doc/` folder
if the need for more similar files arise.
atm there are these two, plus maybe `contrib/docker_notes.md`.
2022-06-09 17:40:57 +02:00
SomberNight
8e9274bde4 mac build: README: add more details about installing Xcode 2022-05-27 17:51:53 +02:00
SomberNight
ecf4e3db48 mac build: compare_dmg script: if binaries mismatch, print the diff 2022-05-27 17:48:18 +02:00
SomberNight
2362d6d010 follow-up "remove email plugin"
follow-up c67c4e95dc
2022-05-24 18:33:19 +02:00
Jamie C. Driver
15f108aaa5 Add support for the Blockstream Jade hww 2022-05-20 16:03:46 +01:00
SomberNight
6c05de6fb9 osx arm notes: simplify
note: `pip install ".[crypto]"` needs quotes on macOS, at least in the default `zsh` shell.
The quotes are not needed on Ubuntu using bash, or on Windows using powershell.
```
user@users-iMac electrum % python3 -m pip install --user -e .[crypto]
zsh: no matches found: .[crypto]
```
2022-04-08 20:22:50 +02:00
Bitkarrot
36a685d560 Notes for Apple M1 build from source (#7747)
* Create notes_for_arm.md
2022-04-08 18:12:12 +00:00
SomberNight
ea21ae35e8 mac build: add workaround for installing pyinstaller with setuptools 61
- the mac build broke with 184e122c36
- 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 <module>
          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 <module>
          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 "<frozen importlib._bootstrap_external>", line 850, in exec_module
        File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
        File "/Users/user/wspace/electrum/contrib/osx/.cache/pyinstaller/PyInstaller.py", line 16, in <module>
          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.
```
2022-04-06 21:01:15 +02:00
SomberNight
3bae7dfd90 mac build: git clone pyinstaller to allow using custom commits
This allows more freedom than using releases from PyPI.
(atm there is no released version that fixes https://github.com/pyinstaller/pyinstaller/pull/6701 )
Also, we now build the pyinstaller bootloader, just like in the windows build:
one fewer binary blob to trust.
2022-04-06 21:01:11 +02:00