- could not find a single project that still actually cares about bip70 [0]
- well except maybe BitPay.
- but I cannot test with BitPay:
- they have a testnet3 staging environment on test.bitpay.com
- but the SSL cert they use for bip70 has expired in 2021
- the webUI probably also has not been updated since then...
- they claim to have added LN support in 2022 in a blog post,
but it's not there on test.bitpay.com
- on mainnet, they require KYC before payment
- < ... angry noises >
- their loss then, I don't care.
- this is code that no one wants to maintain
- this does not yet delete the signed bip70 payment data for historical txs
- but it is no longer possible to export it from the GUI
[0]: https://bitcoinops.org/en/topics/bip70-payment-protocol/
- (zbar requires [0] iconv)
- issues [1][3] compiling win-iconv:
- pre-existing issue: lots of "-Wincompatible-pointer-types" warnings when compiling zbar with win-iconv
- new debian means newer GCC
- new GCC changed that [2] warning type to "error"
- GNU libiconv works as an alternative
- drawback: win-iconv is more minimal, it uses the win32 API to do most of the work
- still, is a 25+ year old GNU project with one release every ~2 years, so IMO fine
[0]: https://github.com/mchehab/zbar/blob/a549566ea11eb03622bd4458a1728ffe3f589163/README-windows.md
[1]: https://github.com/SomberNight/electrum/commit/cb00cb60cf9a0cb059dcac5e7acfe5186620cabe
[2]: https://gcc.gnu.org/pipermail/gcc-cvs/2023-December/394351.html
[3]: see snippet when compiling libzbar:
```
decoder.c: In function ‘zbar_decoder_reset’:
decoder.c:116:22: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
116 | memset(dcode, 0, (long)&dcode->buf_alloc - (long)dcode);
| ^
decoder.c:116:48: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
116 | memset(dcode, 0, (long)&dcode->buf_alloc - (long)dcode);
| ^
CC processor/libzbar_la-win.lo
/bin/bash ../libtool --tag=RC \
--mode=compile x86_64-w64-mingw32-windres -DHAVE_CONFIG_H -I. -I../include \
-I../include -o libzbar-rc.lo libzbar.rc
CC processor/libzbar_la-lock.lo
CC decoder/libzbar_la-qr_finder.lo
CC qrcode/libzbar_la-qrdec.lo
In file included from ./processor.h:26,
from processor/lock.c:25:
../include/config.h:423:9: warning: "_WIN32_WINNT" redefined
423 | #define _WIN32_WINNT 0x0500
| ^~~~~~~~~~~~
In file included from /usr/share/mingw-w64/include/corecrt.h:10,
from /usr/share/mingw-w64/include/crtdefs.h:10,
from /usr/share/mingw-w64/include/assert.h:15,
from processor/lock.c:24:
/usr/share/mingw-w64/include/_mingw.h:232:9: note: this is the location of the previous definition
232 | #define _WIN32_WINNT 0xa00
| ^~~~~~~~~~~~
libtool: compile: x86_64-w64-mingw32-windres -DHAVE_CONFIG_H -I. -I../include -I../include libzbar.rc -o .libs/libzbar-rc.o
CC qrcode/libzbar_la-qrdectxt.lo
CC qrcode/libzbar_la-rs.lo
CC qrcode/libzbar_la-isaac.lo
CC qrcode/libzbar_la-bch15_5.lo
CC qrcode/libzbar_la-binarize.lo
CC qrcode/libzbar_la-util.lo
In file included from ./image.h:26,
from qrcode/binarize.c:10:
../include/config.h:423:9: warning: "_WIN32_WINNT" redefined
423 | #define _WIN32_WINNT 0x0500
| ^~~~~~~~~~~~
In file included from /usr/share/mingw-w64/include/corecrt.h:10,
from /usr/share/mingw-w64/include/crtdefs.h:10,
from /usr/share/mingw-w64/include/math.h:13,
from qrcode/binarize.c:7:
/usr/share/mingw-w64/include/_mingw.h:232:9: note: this is the location of the previous definition
232 | #define _WIN32_WINNT 0xa00
| ^~~~~~~~~~~~
CC video/libzbar_la-dshow.lo
CC window/libzbar_la-win.lo
In file included from ./window.h:26,
from window/win.c:26:
../include/config.h:423:9: warning: "_WIN32_WINNT" redefined
423 | #define _WIN32_WINNT 0x0500
| ^~~~~~~~~~~~
In file included from /usr/share/mingw-w64/include/corecrt.h:10,
from /usr/share/mingw-w64/include/crtdefs.h:10,
from /usr/share/mingw-w64/include/ctype.h:9,
from window/win.c:24:
/usr/share/mingw-w64/include/_mingw.h:232:9: note: this is the location of the previous definition
232 | #define _WIN32_WINNT 0xa00
| ^~~~~~~~~~~~
In file included from ./processor.h:26,
from processor/win.c:29:
../include/config.h:423:9: warning: "_WIN32_WINNT" redefined
423 | #define _WIN32_WINNT 0x0500
| ^~~~~~~~~~~~
In file included from /usr/share/mingw-w64/include/corecrt.h:10,
from /usr/share/mingw-w64/include/crtdefs.h:10,
from /usr/share/mingw-w64/include/assert.h:15,
from processor/win.c:24:
/usr/share/mingw-w64/include/_mingw.h:232:9: note: this is the location of the previous definition
232 | #define _WIN32_WINNT 0xa00
| ^~~~~~~~~~~~
processor/win.c: In function ‘_zbar_processor_open’:
processor/win.c:282:47: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
282 | proc->display = CreateWindowEx(EXT_STYLE, (LPCTSTR)(long)wca, "ZBar",
| ^
processor/win.c: In function ‘_zbar_processor_close’:
processor/win.c:297:25: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
297 | UnregisterClass((LPCTSTR)(long)proc->state->registeredClass, 0);
| ^
CC window/libzbar_la-dib.lo
qrcode/qrdectxt.c: In function ‘qr_code_data_list_extract_text’:
qrcode/qrdectxt.c:302:62: error: passing argument 2 of ‘iconv’ from incompatible pointer type [-Wincompatible-pointer-types]
302 | iconv(utf8_cd, &in, &inleft, &out,
| ^~~
| |
| char **
In file included from qrcode/qrdectxt.c:12:
/usr/x86_64-w64-mingw32/include/iconv.h:43:56: note: expected ‘const char **’ but argument is of type ‘char **’
43 | size_t iconv(iconv_t cd, WINICONV_CONST char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
qrcode/qrdectxt.c:352:71: error: passing argument 2 of ‘iconv’ from incompatible pointer type [-Wincompatible-pointer-types]
352 | err = iconv(enc_list[ei], &in,
| ^~~
| |
| char **
/usr/x86_64-w64-mingw32/include/iconv.h:43:56: note: expected ‘const char **’ but argument is of type ‘char **’
43 | size_t iconv(iconv_t cd, WINICONV_CONST char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
qrcode/qrdectxt.c:374:53: error: passing argument 2 of ‘iconv’ from incompatible pointer type [-Wincompatible-pointer-types]
374 | iconv(eci_cd, &in, &inleft, &out,
| ^~~
| |
| char **
/usr/x86_64-w64-mingw32/include/iconv.h:43:56: note: expected ‘const char **’ but argument is of type ‘char **’
43 | size_t iconv(iconv_t cd, WINICONV_CONST char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
make[2]: *** [Makefile:1089: qrcode/libzbar_la-qrdectxt.lo] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/opt/wine64/drive_c/electrum/contrib/zbar/zbar'
make[1]: *** [Makefile:1895: all-recursive] Error 1
make[1]: Leaving directory '/opt/wine64/drive_c/electrum/contrib/zbar'
make: *** [Makefile:989: all] Error 2
🗯 ERROR: Could not build zbar
🗯 ERROR: Could not build zbar
```
In the GUIs, on the language-select screen, show e.g.
Czech (100%), Danish (13%), Dutch (54%)
instead of
Czech, Danish, Dutch
- we count the source strings when creating the .pot PO-template file
and add an "X-Electrum-SourceStringCount" header to it, in the push_locale.py script that uploads the .pot file to crowdin.
- later, when we run electrum-locale/update.py to download the translations in .po files, these files will also contain the same header.
- then when the build_locale.sh script compiles those .po files, we can read the header and use it to populate a new "stats.json" file
that we place in electrum/locale/locale/ and bundle in the all release binaries/distributables.
- stats.json also includes the number of translated strings for each lang
- at runtime we simply read stats.json and use the values to calculate the percentages
- a prior implementation did not pre-calc stats.json but did all calculations at runtime (by opening all .mo translations)
- however that was deemed to slow, hence the build-time pre-calc
- runtime calc took 40 ms on my laptop, so I guess it could easily take 10x that on an old phone
- just as we have always been very tolerant of any locale files or even the whole locale/ dir missing, we also tolerate stats.json missing
xgettext and related tools have a -s/--sort-output option, which results in the output being lexicographically sorted. The gettext maintainers recommend against using this option and even started deprecating it in some of their tools (xgettext included):
- with -s, source strings are lexicographically sorted in the .pot/.po files
- without -s, source string are output in the same order they are found in the code
- this way, translators have to do much fewer context switches when contributing translations
note that the qml part we have already *not* been sorting
Tries to remove differences caused by filesystem-order in the generated .pot file.
The crowdin activity stream is full of events:
```
SomberNight_CI_BOT changed the context of 126 strings
02:42
String Previous context New context File Time
{} blocks #: electrum/gui/qt/channel_details.py:256 #: electrum/gui/qt/channel_details.py:257 electrum/gui/qt/network_dialog.py:514 #: electrum/gui/qt/network_dialog.py:514 electrum/gui/qt/channel_details.py:256 #: electrum/gui/qt/channel_details.py:257 messages.pot 02:42
[...]
```
^ i.e. on every CI push, the comments containing the file paths and line-numbers were getting mixed up randomly
This is undesirable noise.
This script used to work, I assume my breakage is due to the python version.
```
Traceback (most recent call last):
File "/home/user/wspace/electrum/./contrib/add_cosigner", line 35, in <module>
version_spec = importlib.util.spec_from_file_location('version', 'electrum/version.py')
^^^^^^^^^^^^^^
AttributeError: module 'importlib' has no attribute 'util'
```
We had been using an ancient version of "cryptography" so far in our p4a fork,
however it is not compatible with OpenSSL 3.0. (Previously we were building it with OpenSSL 1.1)
Bumping "cryptography" is difficult, as building new versions of it from source requires a full rust toolchain.
Instead, this commit switches to "pycryptodomex", as a replacement, which is much easier to build from source.
The string is not translated and might not be accessible for non-english
speakers, even though its relatively self-explanatory i think adding
this emoji makes it more accessible.
Extend "create new user to avoid using root" copypasta to support being run as root
(ARG UID=0).
When running build.sh directly on a cirrus CI runner, we are running as root.
from https://stackoverflow.com/a/69088164
I am trying to run the build.sh scripts directly on a cirrus CI runner, and "docker run -it" is erroring due to lack of a tty.
- it was originally added in https://github.com/spesmilo/electrum/pull/1334,
with the goal of simplifying running the tests on local dev machines.
However this usage is not documented anywhere, and AFAIK regular contributors
don't use it either.
- tox just adds another layer of abstraction that is not that useful IMO
- I want more control over which electrum-deps are installed, which tox is
(in this case) unhelpfully abstracting away
p4a ref: electrum_20240930_android_16kb_page_alignment
Dockerfile: obtain 16kb aligned NDK r23 from google CI (dl-ndk-ci.sh)
barcode, zxing-cpp: add 16kb align patch
build_tools_util.sh: add function to apply a patch
Updates the appimage build scripts to use the newer
https://github.com/AppImage/appimagetool tool to bundle the appimage
instead of the discontinued https://github.com/AppImage/AppImageKit.
To prevent the new appimagetool from downloading a random "latest"
appimage runtime (`type2-runtime`) binary this PR also adds
functionality to clone and build
https://github.com/AppImage/type2-runtime from source. This is done
using the build scripts provided in the `type2-runtime` repository,
however the Dockerfile they use for building is replaced by a copy with
pinned package versions to prevent issues with reproducibility.
This should fix the issue of missing libfuse2 which users of the appimage
have on "modern" distributions.
The new `type2-runtime` is statically linked and includes the required
dependencies now instead of relying on the host to provide it.
if I ran the script with the *.sombernight_releasekey.asc sigs present in dist/,
"SomberNight" and "sombernight_releasekey" were both included as signers