1
0
Commit Graph

1056 Commits

Author SHA1 Message Date
SomberNight
c9ed717bea dependencies: remove bitstring
- `bitstring` started depending on `bitarray` in version 4.1 [0]
  - that would mean one additional dependency for us (from yet another maintainer), which is not even pure python
- we only use bitstring for bolt11-parsing
- hence this PR rewrites the bolt11-parsing and removes `bitstring` as dependency
- note: I benchmarked lndecode using [1], and the new code performs better,
  taking around 80% time needed for old code (when using bitstring 3.1.9, pure python).
  Though the variance is quite large in both cases.

[0]: 95ee533ee4/release_notes.txt (L108)
[1]: d7597d96d0
2024-05-27 14:24:45 +00:00
robertmin2
815a5272f0 AppArmor Profiles for Electrum
AppArmor Profiles for Electrum
2024-05-27 14:20:00 +00:00
Jamie C. Driver
a8620bd3c0 jade: update Jade api to 1.0.29
Updates cbor dependency to cbor2, required for modern linux/python
versions.
2024-05-27 14:16:33 +00:00
SomberNight
3d588fada6 requirements: bump pinned (and max) aiorpcx versions to 0.23.1
related https://github.com/spesmilo/electrum/issues/8954
2024-05-27 14:14:14 +00:00
ThomasV
1b3b6c7f7e contrib/osx:
- rename make_osx2.sh -> sign_osx.sh
- add command to unlock keychain
- chmod +x
2024-05-27 14:06:32 +00:00
SomberNight
0a94ea0bc2 build: split make_osx.sh script into two: "build" and "sign" parts 2024-05-27 14:06:23 +00:00
SomberNight
8b26d310a3 android readme: update outdated "debug vs release build" section 2024-02-26 15:56:44 +00:00
SomberNight
2975d34c91 update locale 2024-02-22 11:26:06 +00:00
Sander van Grieken
b84a7508a3 android: p4a ref 0c507ead85
PythonActivity.setSecureWindow: don't redraw after clearing FLAG_SECURE
2024-02-22 10:15:51 +01:00
SomberNight
564036e71d build: partial rerun freeze_packages 2024-02-21 16:45:00 +00:00
SomberNight
2ca180ddee bump libsecp256k1 version 2024-02-21 16:39:05 +00:00
SomberNight
d7b0260534 requirements: bump min aiohttp-socks to 0.8.4
This version has the bugfix for https://github.com/romis2012/aiohttp-socks/issues/27

see 80e330d365
2024-02-21 16:17:45 +00:00
SomberNight
27bb28e35b tests: follow-up move of folder
follow-up https://github.com/spesmilo/electrum/pull/8897
2024-02-19 12:00:08 +00:00
SomberNight
ea4481a8dd android readme: de-dupe "qml_gui" requirements
follow-up https://github.com/spesmilo/electrum/pull/8881
2024-02-15 14:53:51 +00:00
Sander van Grieken
6738e1e90f p4a: python-for-android ref 4f1a1a3a41f6bf8d28984bfd1ec8af3c5d8eb362
> qt6: replace synchronizedList with explicit synchronize block, as we still see ConcurrentModificationExceptions
  in the play store.
2024-02-07 12:08:10 +01:00
ThomasV
2390a76d1f update locale 2024-01-18 17:01:31 +01:00
accumulator
3b841a8dcd Merge pull request #8761 from accumulator/minsdk_23
qml: android.minapi and android.ndk_api to 23 (android 6.0+)
2024-01-18 01:00:15 +01:00
Sander van Grieken
de76eb94d0 android: allow override of FRESH_CLONE target directory
my /tmp is not large enough, this allows override of build location using

export FRESH_CLONE=/some/other/location
2024-01-13 01:19:43 +01:00
Sander van Grieken
a8dc27ef4c android: buildozer ref 4403ecf445f10b5fbf7c74f4621bf2b922ad35b5
buildozer didn't pass android target_sdk_version from spec file
2024-01-13 01:15:52 +01:00
SomberNight
11764f9a79 android build: make apt less quiet, for more feedback about progress 2024-01-10 20:49:18 +00:00
SomberNight
5369be66da appimage build: build zbar ourselves
to be able to package new version, which has security fixes
2024-01-10 20:48:27 +00:00
SomberNight
0a6283b1ef build: bump zbar version in win/mac/android builds
- new version (0.23.93) fixes a security issue
  bb05ec54ee/ChangeLog (L5)
2024-01-10 20:46:38 +00:00
Sander van Grieken
3935e378b3 android: p4a ref d976b539dc7c808d103a7edfe6dc1fd300582a89
> don't keep build dir around after succesful build
2023-12-29 16:16:07 +01:00
Sander van Grieken
c1ebc42724 android: p4a ref f534fe9bcd692c4df97e644d34c5bd8acede01eb
> qt6: don't copy entire build tree to dist, use select set of include patterns.
2023-12-29 13:58:46 +01:00
SomberNight
872ab29436 android build: bump some security-sensitive packages (py3, ssl) 2023-12-24 05:18:47 +00:00
SomberNight
615cb66692 appimage build: bump python version (3.10.11->3.10.13) 2023-12-24 05:15:39 +00:00
Sander van Grieken
4382578235 qml: android.minapi and android.ndk_api to 23 (android 6.0+) 2023-12-19 15:35:09 +01:00
SomberNight
be9dc06aaf contrib/add_cosigner: print "usage: ..." if called incorrectly 2023-12-19 14:18:29 +00:00
SomberNight
e08302ac4a release.sh: fix missing android apk names
follow-up e441d4b15e

These are used later in the script.
2023-12-18 18:17:26 +00:00
SomberNight
51bc23c92f build scripts: (trivial) add quotes around some shell variables 2023-12-18 18:15:33 +00:00
SomberNight
bf4934bb9f android build: update p4a fork with qt6 build repro fixes
related https://github.com/spesmilo/electrum/issues/8746
2023-12-16 09:05:28 +00:00
SomberNight
adb1db57ff android readme: update commands in "reproducibility fail" section
I think file was renamed in upstream p4a
2023-12-13 19:41:38 +00: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
5f309e95c8 release.sh: don't hardcode ".0" suffix in APK_VERSION
does not work with current beta:
```
d142c5534f4da4a7f0a1f52676716908f674ff9e06b87f7b153384b161296eaf  /home/user/wspace/electrum/contrib/android/../../dist/Electrum-4.5.0.0-armeabi-v7a-release-unsigned.apk
+ mv dist/Electrum-4.5.0b0.0-armeabi-v7a-release-unsigned.apk dist/Electrum-4.5.0b0.0-armeabi-v7a-release.apk
mv: cannot stat 'dist/Electrum-4.5.0b0.0-armeabi-v7a-release-unsigned.apk': No such file or directory
```
2023-12-13 17:21:33 +00:00
ThomasV
b21fed0142 update locale submodule 2023-12-13 16:35:05 +01:00
SomberNight
a36e7a4d28 build: partial rerun freeze_packages
just update a few key packages

trezorlib update might fix https://github.com/spesmilo/electrum/issues/8722 (untested)
2023-12-12 13:20:13 +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
xiaolou86
00c584d557 contrib: fix typos 2023-12-04 14:15:38 +08:00
Sander van Grieken
05758432d6 android: exclude more unnecessary directories 2023-12-01 16:01:46 +01:00
SomberNight
80e330d365 build: update pinned aiohttp-socks (partial rerun freeze_packages)
This should fix an issue when running with python 3.11 (possibly only 3.11.5<= ).

```
 47.45 | I | exchange_rate.CoinGecko | getting fx quotes for EUR
 48.18 | E | exchange_rate.CoinGecko | failed fx quotes: ClientOSError('Cannot write to closing transport')
Traceback (most recent call last):
  File "...\electrum\env11\Lib\site-packages\aiohttp\client.py", line 599, in _request
    resp = await req.send(conn)
           ^^^^^^^^^^^^^^^^^^^^
  File "...\electrum\env11\Lib\site-packages\aiohttp\client_reqrep.py", line 712, in send
    await writer.write_headers(status_line, self.headers)
  File "...\electrum\env11\Lib\site-packages\aiohttp\http_writer.py", line 130, in write_headers
    self._write(buf)
  File "...\electrum\env11\Lib\site-packages\aiohttp\http_writer.py", line 75, in _write
    raise ConnectionResetError("Cannot write to closing transport")
ConnectionResetError: Cannot write to closing transport

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

Traceback (most recent call last):
  File "...\electrum\electrum\exchange_rate.py", line 85, in update_safe
    self._quotes = await self.get_rates(ccy)
                   ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "...\electrum\electrum\exchange_rate.py", line 345, in get_rates
    json = await self.get_json('api.coingecko.com', '/api/v3/exchange_rates')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "...\electrum\electrum\exchange_rate.py", line 69, in get_json
    async with session.get(url) as response:
  File "...\electrum\env11\Lib\site-packages\aiohttp\client.py", line 1187, in __aenter__
    self._resp = await self._coro
                 ^^^^^^^^^^^^^^^^
  File "...\electrum\env11\Lib\site-packages\aiohttp\client.py", line 613, in _request
    raise ClientOSError(*exc.args) from exc
aiohttp.client_exceptions.ClientOSError: Cannot write to closing transport
```

related:
https://github.com/romis2012/aiohttp-socks/issues/27
https://github.com/python/cpython/issues/109321
2023-11-30 19:16:33 +00:00
ThomasV
e441d4b15e release-sh: build each android apk separately
this triggers a cleanup of the fresh clone directory
2023-11-30 17:56:59 +01: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