Page MenuHomePhabricator

[electrum] appimage: add freeze_appimage_distro.sh and adapt Dockerfile to use debian buster base
DraftPublic

Authored by PiRK on Jul 21 2023, 14:16.
This is a draft revision that has not yet been submitted for review.

Details

Reviewers
None
Group Reviewers
Restricted Project
Summary

This is a partial backport of electrum#7926 and electrum#8310

and https://github.com/spesmilo/electrum/commit/d8abab34d81a1c67b23f9c408770690f538417ed

The rustc version in Debian Buster is not recent enough to compile cryptography, so drop the rustc and cargo apt dependencies and don't compile cryptography.

From https://cryptography.io/en/latest/installation/#rust

On most Linux distributions, the latest version of pip will be able to install a binary wheel, so you won’t need a Rust toolchain.

Note that cryptography is not directly used in Electrum ABC, it is pulled into the release by the dnspython dependency. See https://github.com/EchterAgo/Electron-Cash/commit/a8c55d21ef236d738b6e2a9fb12c5cbe9c9ac9c3
This commit was only partially backported (I kept dnspython[DNSSEC] rather than changing it to dnspython in requirements.txt), so specifying the dependency on cryptography was actually never needed before, but now it is.

Test Plan

contrib/build-linux/appimage/build.sh

Diff Detail

Repository
rABC Bitcoin ABC
Branch
debian_docker_appimage
Lint
Lint Errors
SeverityLocationCodeMessage
Errorelectrum/contrib/freeze_appimage_distro.sh:SHELL_LOCALE1`export LC_ALL=C` or `export LC_ALL=C.UTF-8` should be the first statement.
Unit
No Test Coverage
Build Status
Buildable 24566
Build 48729: Build Diffelectrum-tests
Build 48728: arc lint + arc unit

Event Timeline

Two drawbacks of that solution:

  • we drop support for some linux distros that are newer than Ubuntu 18.04 but older than Debian 10 (most notably Ubuntu 18.04)
  • the Debian Snapshot Archive is known to be slow (but this should only be an issue on the first run or when bumping the snapshot timestamp) https://github.com/spesmilo/electrum/issues/8496)

I still think it will be mostly beneficial, because the Ubuntu repository kept dropping pinpointed packages, and now that Ubuntu 18.04 has reached EOL it has become harder to find which package version should be used instead of the dropped one.

Tail of the build log:

-- Generating done
-- Build files have been written to: /work/abc-ci-builds/electrum-tests
[1/2] link test_runner.py
[2/2] Run Electrum ABC unit tests...
FAILED: electrum/CMakeFiles/check-electrum 
cd /work/abc-ci-builds/electrum-tests/electrum && /usr/bin/python3.9 ./test_runner.py
[secp256k1] warning: libsecp256k1 library failed to load
Testing `setup.py --version`: OK

[ecc] info: libsecp256k1 library not available, falling back to python-ecdsa. This means signing operations will be slower. Try running:

  $  contrib/make_secp

(You need to be running from the git sources for contrib/make_secp to be available)
...................................................................................EEE................127.0.0.1 - - [21/Jul/2023 14:31:15] "GET /invoice HTTP/1.1" 503 -
.127.0.0.1 - - [21/Jul/2023 14:31:16] "GET / HTTP/1.1" 200 -
.127.0.0.1 - - [21/Jul/2023 14:31:16] "GET /invoice HTTP/1.1" 200 -
127.0.0.1 - - [21/Jul/2023 14:31:16] "POST /pay HTTP/1.1" 200 -
.127.0.0.1 - - [21/Jul/2023 14:31:17] "GET / HTTP/1.1" 200 -
.s..................Traceback (most recent call last):
  File "/work/electrum/electrumabc_plugins/trezor/trezor.py", line 29, in <module>
    import trezorlib
ModuleNotFoundError: No module named 'trezorlib'
..............................................................................................s.........sss....................................s.s.
======================================================================
ERROR: test_validate_rrsig_ecdsa (electrumabc.tests.test_dnssec.TestDnsSec)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/work/electrum/electrumabc/tests/test_dnssec.py", line 36, in test_validate_rrsig_ecdsa
    None, dns.dnssec.validate_rrsig(rrset, rrsig, keys, origin, now)
  File "/usr/local/lib/python3.9/dist-packages/dns/dnssec.py", line 1164, in _need_pyca
    raise ImportError(
ImportError: DNSSEC validation requires python cryptography

======================================================================
ERROR: test_validate_rrsig_fail (electrumabc.tests.test_dnssec.TestDnsSec)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/work/electrum/electrumabc/tests/test_dnssec.py", line 138, in test_validate_rrsig_fail
    dns.dnssec.validate_rrsig(rrset, rrsig, keys, origin, now)
  File "/usr/local/lib/python3.9/dist-packages/dns/dnssec.py", line 1164, in _need_pyca
    raise ImportError(
ImportError: DNSSEC validation requires python cryptography

======================================================================
ERROR: test_validate_rrsig_rsa (electrumabc.tests.test_dnssec.TestDnsSec)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/work/electrum/electrumabc/tests/test_dnssec.py", line 91, in test_validate_rrsig_rsa
    None, dns.dnssec.validate_rrsig(rrset, rrsig, keys, origin, now)
  File "/usr/local/lib/python3.9/dist-packages/dns/dnssec.py", line 1164, in _need_pyca
    raise ImportError(
ImportError: DNSSEC validation requires python cryptography

----------------------------------------------------------------------
Ran 268 tests in 10.069s

FAILED (errors=3, skipped=7)
ninja: build stopped: cannot make progress due to previous errors.
Build electrum-tests failed with exit code 1