1
0
Commit Graph

335 Commits

Author SHA1 Message Date
ThomasV
fa1eb9f286 update hash for winehq.key
Looks like upstream key file changed. Still the same crypto key, just updated expiration date.

```
$ sha256sum winehq_20*
78b185fabdb323971d13bd329fefc8038e08559aa51c4996de18db0639a51df6 *winehq_2019.key
d965d646defe94b3dfba6d5b4406900ac6c81065428bf9d9303ad7a72ee8d1b8 *winehq_2024.key

$ gpg winehq_2019.key
gpg: WARNING: no command supplied.  Trying to guess what you mean ...
pub   rsa3072 2018-12-10 [SC]
      D43F640145369C51D786DDEA76F1A20FF987672F
uid           WineHQ packages <wine-devel@winehq.org>
sub   rsa3072 2018-12-10 [E] [expired: 2020-12-09]

$ gpg winehq_2024.key
gpg: WARNING: no command supplied.  Trying to guess what you mean ...
pub   rsa3072 2018-12-10 [SC]
      D43F640145369C51D786DDEA76F1A20FF987672F
uid           WineHQ packages <wine-devel@winehq.org>
sub   rsa3072 2018-12-10 [E]
```

Co-authored-by: SomberNight <somber.night@protonmail.com>
2024-10-14 15:59:16 +00:00
SomberNight
51bc23c92f build scripts: (trivial) add quotes around some shell variables 2023-12-18 18:15:33 +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
1ff4130804 contrib/docker_notes.md: add notes re debian apt mirror, and envvars
related https://github.com/spesmilo/electrum/issues/8496
2023-06-22 15:45:30 +00:00
SomberNight
9b14b87936 win build: tighten pip install with --no-binary somewhat
related https://github.com/spesmilo/electrum/pull/7918
2023-06-02 23:12:36 +00:00
SomberNight
e455677284 win build: bump pyinstaller (4.10->5.11)
In `build-electrum-git.sh`, the `-w` CLI arg is removed: it was apparently ignored as we are using a .spec file,
and pyinstaller 5.0+ is now raising a hard error (see https://github.com/pyinstaller/pyinstaller/issues/6660).
```
option(s) not allowed:
  --console/--nowindowed/--windowed/--noconsole
makespec options not valid when a .spec file is given
```

-----

In ecc_fast.py, we don't sys.exit() anymore as pyinstaller 5.0+ tries to import electrum during the Analysis phase.
see https://github.com/pyinstaller/pyinstaller/pull/6171

```
57912 INFO: Looking for dynamic libraries
1746 INFO: gettext setting initial language to None
1932 ERROR: libsecp256k1 library failed to load. exceptions: [FileNotFoundError("Could not find module 'C:\\python3\\lib\\site-packages\\electrum\\libsecp256k1-2.dll' (or one of its depende
ncies). 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 dependenc
ies). 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 dependencie
s). Try using the full path with constructor syntax."), FileNotFoundError("Could not find module 'libsecp256k1-2.dll' (or one of its 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.")]
Traceback (most recent call last):
  File "C:\python3\lib\runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "C:\python3\lib\runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "C:\python3\scripts\pyinstaller.exe\__main__.py", line 7, in <module>
  File "C:\python3\lib\site-packages\PyInstaller\__main__.py", line 194, in _console_script_run
    run()
  File "C:\python3\lib\site-packages\PyInstaller\__main__.py", line 180, in run
    run_build(pyi_config, spec_file, **vars(args))
  File "C:\python3\lib\site-packages\PyInstaller\__main__.py", line 61, in run_build
    PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
  File "C:\python3\lib\site-packages\PyInstaller\building\build_main.py", line 1006, in main
    build(specfile, distpath, workpath, clean_build)
  File "C:\python3\lib\site-packages\PyInstaller\building\build_main.py", line 928, in build
    exec(code, spec_namespace)
  File "deterministic.spec", line 55, in <module>
    a = Analysis([home+'run_electrum',
  File "C:\python3\lib\site-packages\PyInstaller\building\build_main.py", line 428, in __init__
    self.__postinit__()
  File "C:\python3\lib\site-packages\PyInstaller\building\datastruct.py", line 184, in __postinit__
    self.assemble()
  File "C:\python3\lib\site-packages\PyInstaller\building\build_main.py", line 736, in assemble
    isolated.call(find_binary_dependencies, self.binaries, self.binding_redirects, collected_packages)
  File "C:\python3\lib\site-packages\PyInstaller\isolated\_parent.py", line 372, in call
    return isolated.call(function, *args, **kwargs)
  File "C:\python3\lib\site-packages\PyInstaller\isolated\_parent.py", line 302, in call
    raise RuntimeError(f"Child process call to {function.__name__}() failed with:\n" + output)
RuntimeError: Child process call to find_binary_dependencies() failed with:
  File "C:\python3\lib\site-packages\PyInstaller\isolated\_child.py", line 63, in run_next_command
    output = function(*args, **kwargs)
  File "C:\python3\lib\site-packages\PyInstaller\building\build_main.py", line 177, in find_binary_dependencies
    __import__(package)
  File "C:\python3\lib\site-packages\electrum\__init__.py", line 20, in <module>
    from .wallet import Wallet
  File "C:\python3\lib\site-packages\electrum\wallet.py", line 53, in <module>
    from .bip32 import BIP32Node, convert_bip32_intpath_to_strpath, convert_bip32_strpath_to_intpath
  File "C:\python3\lib\site-packages\electrum\bip32.py", line 11, in <module>
    from . import constants
  File "C:\python3\lib\site-packages\electrum\constants.py", line 30, in <module>
    from . import bitcoin
  File "C:\python3\lib\site-packages\electrum\bitcoin.py", line 35, in <module>
    from . import ecc
  File "C:\python3\lib\site-packages\electrum\ecc.py", line 39, in <module>
    from .ecc_fast import _libsecp256k1, SECP256K1_EC_UNCOMPRESSED
  File "C:\python3\lib\site-packages\electrum\ecc_fast.py", line 151, in <module>
    sys.exit(f"Error: Failed to load libsecp256k1.")
SystemExit: Error: Failed to load libsecp256k1.
🗯 ERROR: build-electrum-git failed
```

Also, the -OO flag is removed from wine python, for similar reasons:
pyinstaller imports electrum, and in electrum/__init__.py, we raise
if -O is used: 9b1fb0e5fe/electrum/__init__.py (L40)
2023-06-02 22:37:43 +00:00
SomberNight
21cf85afca win build: bump python version (3.9.13->3.10.11) 2023-06-02 17:17:33 +00:00
SomberNight
66f219cdf3 win build: update wine 2023-06-02 17:17:30 +00:00
SomberNight
2be71c2dcc windows README: update reference to libsecp256k1-0.dll to incl newer
related: https://github.com/spesmilo/electrum/pull/8185
2023-04-21 16:38:58 +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
16fcfe34a7 build: rm "contrib" from debian apt sources lists 2023-04-18 16:09:50 +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
SomberNight
c9b6a6c01e build: fix repro builds where host userid != 1000
- repro builds to use fixed uid=1000 inside the container
  - in case the file permissions leak into the binaries, they are still reproducible
  - chown 1000:1000 fresh_clone
- repro builds to create fresh_clone dir outside git clone
  - otherwise the local dev build would still interact with the fresh_clone dir
    - due to e.g. recursive "find -exec touch",
    - and even the "docker build" cmd itself would try to stat/read it
      - see https://github.com/docker/for-linux/issues/380
  - and "rm -rf fresh_clone" needs sudo if the host uid is not 1000
  - this way the local dev build does not need sudo

to recap:
- local dev builds use the host userid inside the container, directly operate on the project dir
  - does not need sudo
- repro builds create a fresh git clone, chown it to 1000, and use userid=1000 inside the container
  - if the host userid is 1000, does not need sudo
  - otherwise, needs sudo

closes https://github.com/spesmilo/electrum/issues/8261
2023-03-20 23:32:59 +00:00
SomberNight
6e472efd5f build: follow-up prev: only use host userid for local dev builds
reproducibility probably needs a hardcoded userid

Also, move the UID arg later in the dockerfiles, for better caching.
(if local dev build and repro build set different UIDs, the build caches
will diverge at that step)
2023-03-20 02:06:54 +00:00
Sander van Grieken
ab073827cf build: use uid of user building the build containers 2023-03-20 02:06:50 +00:00
SomberNight
08ae0a73b2 build: add separate .dockerignore files
The .dockerignore symlink in the project root dir is only picked up by the android build.
The android build has the project root as its build context for "docker build" --
the other builds have their own subdirectories as build context, e.g. contrib/build-linux/appimage.
2023-03-20 02:05:40 +00:00
SomberNight
d8abab34d8 build: rm "non-free" from debian apt sources lists
was not needed, and better to avoid :)
2023-03-18 06:22:38 +00:00
Sander van Grieken
8faf8f4a31 wine: add --allow-downgrades to second apt-get command 2023-02-27 12:45:44 +01:00
Sander van Grieken
65abb90049 build: update build container base image versions, update apt sources to current 2023-02-27 11:16:04 +01:00
ghost43
0eea47c78d libsecp256k1: update hardcoded .so lib name in binaries (#8186)
follow-up 7d83335e34
2023-02-04 01:36:19 +00:00
SomberNight
ee2e255699 contrib/build-wine/unsign.sh: small improvements/fixes
- follow-up prev: CONTRIB was not defined
- rm folder signed/stripped if already exists (otherwise script early-exited silently)
- quote paths to guard against whitespace shenanigans
2023-01-26 18:30:11 +00:00
SomberNight
563180c94c build: scripts to not require electrum to be installed 2023-01-26 18:15:04 +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
Sander van Grieken
acde8cd0b7 add apt --allow-downgrades in more places.
build sdist also from debian bullseye container
2022-11-06 10:55:10 +01:00
Sander van Grieken
c0772019f1 rerun freeze_container_distro.sh and update docker base images for debian buster and bullseye 2022-11-06 10:42:39 +01: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
accumulator
d51ee07a81 use debian makensis instead of windows makensis executable through wine (#8057) 2022-11-04 20:31:01 +00:00
SomberNight
54e22105b8 CI: cache more in Windows build 2022-11-04 15:49:19 +00:00
SomberNight
98d29cba56 wine build: build win-iconv-mingw-w64-dev, instead of using debian sid
This commit reintroduces b8240bec3e, which was previously reverted
due to making the build non-reproducible.
I have found building with "make -j1" seems to work.
see https://github.com/win-iconv/win-iconv/issues/42

closes https://github.com/spesmilo/electrum/issues/7994
related https://github.com/spesmilo/electrum/pull/7992
2022-10-24 18:08:51 +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
f174b9164c build scripts: minor formatting clean-up
follow-up f8f77c14a2
2022-09-27 13:25:11 +00:00
ThomasV
ef89a695db fix typo 2022-09-27 14:57:09 +02:00
ThomasV
f8f77c14a2 release.sh: store signing password 2022-09-27 14:48:12 +02:00
SomberNight
52b03e1f78 win build: use of debian unstable snapshots needs check-valid-until=no
see https://snapshot.debian.org/
>  To access snapshots of suites using Valid-Until that are older than a dozen days, it is necessary to ignore the Valid-Until header within Release files, in order to prevent apt from disregarding snapshot entries ("Release file expired"). Use aptitude -o Acquire::Check-Valid-Until=false update or apt-get -o Acquire::Check-Valid-Until=false update for this purpose.

(thanks to Axel Gembe for pointing this out)
2022-09-27 11:56:43 +00:00
SomberNight
846c073ee8 Revert "wine build: build win-iconv-mingw-w64-dev, instead of using debian sid"
This reverts commit b8240bec3e.

Looks like the win-iconv build is not deterministic...
Reverting this for now, will have to debug later.
2022-09-27 11:46:58 +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
2d458d3b06 (trivial) contrib/build-wine: convert line-endings (CRLF -> LF)
otherwise no-op
2022-08-29 15:20:26 +00:00
SomberNight
4f574afe5a Merge remote-tracking branch 'remotes/spesmilo/appimage-debian-base'
Change Docker base images from Ubuntu to Debian, and use `snapshot.debian.org` as apt source list.
Ubuntu occasionally removes version-pinned packages from apt (see #7484), which
- breaks historical reproducible builds
- introduces maintenance burden as we have to update the version pins
Hopefully this change fixes both issues.

merges https://github.com/spesmilo/electrum/pull/7926
closes https://github.com/spesmilo/electrum/issues/7484
2022-08-22 13:10:25 +00:00
SomberNight
b8240bec3e wine build: build win-iconv-mingw-w64-dev, instead of using debian sid
without this, when using a ~week old debian sid snapshot, I got:
```
E: Release file for https://snapshot.debian.org/archive/debian/20220811T031049Z/dists/sid/InRelease is expired (invalid since 1d 11h 56min 39s). Updates for this repository will not be applied.
```
2022-08-22 12:47:31 +00:00
SomberNight
c2b5e3ec15 build: use build-locale.sh in all build scripts 2022-08-16 19:06:47 +00:00
Sander van Grieken
f63df43614 wine: rename freeze_appimage_distro.sh to freeze_containers_distro.sh and
adapt build-wine container to Debian+snapshots base
2022-08-11 12:36:48 +02:00
SomberNight
87904e2c7e win build: force using source dist for some of our python dependencies
Instead of using pre-built binary wheels from PyPI.
We should tighten this more (re other requirements-*.txt files),
but there is no C compiler available inside the wine environment atm...
2022-08-06 06:43:31 +02:00
SomberNight
787dd69282 win build: clear $CONTRIB_WINE/dist between builds 2022-08-05 17:53:20 +02:00
gruve-p
e50db4bf2b appimage: update libssl-dev libssl1.1 openssl
Windows image: update gnupg2 dirmngr
2022-07-09 14:41:41 +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