Skip to content

Commit 83a5c20

Browse files
Merge branch 'spesmilo:master' into master
2 parents 5f6ad1c + 8942cea commit 83a5c20

73 files changed

Lines changed: 1005 additions & 1797 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.cirrus.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,29 @@ task:
243243
main_script:
244244
- contrib/ban_unicode.py
245245

246+
task:
247+
name: "security review: Claude Code"
248+
# NOTE: claude has access to all API keys available in the Cirrus CI environment.
249+
# If we would add some critical api keys in here we should consider this.
250+
matrix:
251+
- trigger_type: automatic
252+
only_if: $CIRRUS_PR != '' && ($CIRRUS_USER_PERMISSION == 'write' || $CIRRUS_USER_PERMISSION == 'admin')
253+
- trigger_type: manual
254+
only_if: $CIRRUS_PR != '' && !($CIRRUS_USER_PERMISSION == 'write' || $CIRRUS_USER_PERMISSION == 'admin')
255+
container:
256+
image: node:20
257+
cpu: 1
258+
memory: 2G
259+
# CLAUDE_CODE_OAUTH_TOKEN is set as an encrypted "override" in https://cirrus-ci.com/settings/...
260+
# It must be stored encrypted (ENCRYPTED[...]) so Cirrus CI refuses to decrypt it for
261+
# fork PRs from users without write permission.
262+
# Generate with: claude setup-token
263+
# Optional: set GITHUB_TOKEN to enable PR comments on failure
264+
install_script:
265+
- npm install -g @anthropic-ai/claude-code
266+
review_script:
267+
- python3 contrib/ci/claude_security_review.py
268+
246269
# Cron jobs configured in https://cirrus-ci.com/settings/...
247270
# - job "nightly" on branch "master" at "0 30 2 * * ?" (every day at 02:30Z)
248271
task:

contrib/build-linux/sdist/README.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,5 +53,3 @@ The differences are as follows:
5353
- the normal tarball includes compiled (.mo) locale files, the source-only tarball does not.
5454
Both tarballs contain (.po) source locale files. If you are packaging for a Linux distro,
5555
you probably want to compile the .mo locale files yourself (see `contrib/locale/build_locale.sh`).
56-
- the normal tarball includes generated `*_pb2.py` files. These are created
57-
using `protobuf-compiler` from `.proto` files (see `contrib/generate_payreqpb2.sh`)

contrib/build-linux/sdist/make_sdist.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,6 @@ info "preparing electrum-locale."
3535
fi
3636
)
3737

38-
if ([ "$OMIT_UNCLEAN_FILES" = 1 ]); then
39-
# FIXME side-effecting repo... though in practice, this script probably runs in fresh_clone
40-
rm -f "$PROJECT_ROOT/electrum/paymentrequest_pb2.py"
41-
fi
42-
4338
(
4439
cd "$PROJECT_ROOT"
4540

contrib/build-wine/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM debian:bookworm@sha256:b37bc259c67238d814516548c17ad912f26c3eed48dd9bb54893eafec8739c89
1+
FROM debian:trixie@sha256:13f29b6806e531c3ff3b565bb6eed73f2132506c8c9d41bb996065ca20fb27f2
22

33
# need ca-certificates before using snapshot packages
44
RUN apt update -qq > /dev/null && apt install -qq --yes --no-install-recommends \
@@ -14,14 +14,16 @@ ENV DEBIAN_FRONTEND=noninteractive
1414
RUN dpkg --add-architecture i386 && \
1515
apt-get update -q && \
1616
apt-get install -qy --allow-downgrades \
17+
lsb-release \
1718
wget \
1819
gnupg2 \
1920
dirmngr \
20-
python3-software-properties \
21-
software-properties-common \
21+
python3 \
2222
git \
2323
p7zip-full \
2424
make \
25+
cmake \
26+
pkgconf \
2527
mingw-w64 \
2628
mingw-w64-tools \
2729
autotools-dev \
@@ -37,7 +39,7 @@ RUN dpkg --add-architecture i386 && \
3739
apt-get clean
3840

3941
RUN DEBIAN_CODENAME=$(lsb_release --codename --short) && \
40-
WINEVERSION="10.0.0.0~${DEBIAN_CODENAME}-1" && \
42+
WINEVERSION="11.0.0.0~${DEBIAN_CODENAME}-1" && \
4143
wget -nc https://dl.winehq.org/wine-builds/winehq.key && \
4244
echo "d965d646defe94b3dfba6d5b4406900ac6c81065428bf9d9303ad7a72ee8d1b8 winehq.key" | sha256sum -c - && \
4345
cat winehq.key | gpg --dearmor -o /etc/apt/keyrings/winehq.gpg && \
@@ -49,8 +51,6 @@ RUN DEBIAN_CODENAME=$(lsb_release --codename --short) && \
4951
wine-stable-i386:i386=${WINEVERSION} \
5052
wine-stable:amd64=${WINEVERSION} \
5153
winehq-stable:amd64=${WINEVERSION} \
52-
libvkd3d1:amd64=1.3~${DEBIAN_CODENAME}-1 \
53-
libvkd3d1:i386=1.3~${DEBIAN_CODENAME}-1 \
5454
&& \
5555
rm -rf /var/lib/apt/lists/* && \
5656
apt-get autoremove -y && \
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
deb https://snapshot.debian.org/archive/debian/20250530T143637Z/ bookworm main
2-
deb-src https://snapshot.debian.org/archive/debian/20250530T143637Z/ bookworm main
1+
deb https://snapshot.debian.org/archive/debian/20260227T144551Z/ trixie main
2+
deb-src https://snapshot.debian.org/archive/debian/20260227T144551Z/ trixie main

contrib/build-wine/make_win.sh

Lines changed: 27 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -53,28 +53,34 @@ if [ -f "$DLL_TARGET_DIR/libzbar-0.dll" ]; then
5353
info "libzbar already built, skipping"
5454
else
5555
(
56-
# As debian bullseye doesn't provide win-iconv-mingw-w64-dev, we need to build it:
57-
WIN_ICONV_COMMIT="9f98392dfecadffd62572e73e9aba878e03496c4"
58-
# ^ tag "v0.0.8"
59-
info "Building win-iconv..."
60-
cd "$CACHEDIR"
61-
if [ ! -d win-iconv ]; then
62-
git clone https://github.com/win-iconv/win-iconv.git
63-
fi
64-
cd win-iconv
65-
if ! $(git cat-file -e ${WIN_ICONV_COMMIT}) ; then
66-
info "Could not find requested version $WIN_ICONV_COMMIT in local clone; fetching..."
67-
git fetch --all
68-
fi
69-
git reset --hard
70-
git clean -dfxq
71-
git checkout "${WIN_ICONV_COMMIT}^{commit}"
72-
73-
# note: "-j1" as parallel jobs lead to non-reproducibility seemingly due to ordering issues
74-
# see https://github.com/win-iconv/win-iconv/issues/42
75-
CC="${GCC_TRIPLET_HOST}-gcc" make -j1 || fail "Could not build win-iconv"
56+
# iconv is needed for zbar. see https://github.com/mchehab/zbar/blob/a549566ea11eb03622bd4458a1728ffe3f589163/README-windows.md
57+
# (previously were using win-iconv, but changed to GNU libiconv due to compilation errors with modern gcc)
58+
LIBICONV_VER="1.18"
59+
download_if_not_exist "$CACHEDIR/libiconv-${LIBICONV_VER}.tar.gz" "https://ftp.gnu.org/pub/gnu/libiconv/libiconv-${LIBICONV_VER}.tar.gz"
60+
verify_hash "$CACHEDIR/libiconv-${LIBICONV_VER}.tar.gz" "3b08f5f4f9b4eb82f151a7040bfd6fe6c6fb922efe4b1659c66ea933276965e8"
61+
tar xf "$CACHEDIR/libiconv-${LIBICONV_VER}.tar.gz" -C "$CACHEDIR"
62+
# ref https://github.com/msys2/MINGW-packages/blob/7f68e9f2488737bbe03888ade094eaee8021d1c5/mingw-w64-libiconv/PKGBUILD
63+
info "Building libiconv..."
64+
cd "$CACHEDIR/libiconv-${LIBICONV_VER}"
65+
# Patches taken from msys2/MINGW-packages
66+
patch -p1 < "$here/patches/libiconv-fix-pointer-buf.patch"
67+
./configure \
68+
$AUTOCONF_FLAGS \
69+
--prefix="/usr/${GCC_TRIPLET_HOST}" \
70+
--disable-static \
71+
--enable-shared \
72+
--enable-extra-encodings \
73+
--enable-relocatable \
74+
--disable-rpath \
75+
--enable-silent-rules \
76+
--enable-nls
77+
CC="${GCC_TRIPLET_HOST}-gcc" make "-j$CPU_COUNT" || fail "Could not build libiconv"
78+
cp -fpv "libcharset/lib/.libs/libcharset-1.dll" "$DLL_TARGET_DIR/" || fail "Could not copy the libcharset binary to DLL_TARGET_DIR"
79+
cp -fpv "lib/.libs/libiconv-2.dll" "$DLL_TARGET_DIR/" || fail "Could not copy the libiconv binary to DLL_TARGET_DIR"
7680
# FIXME avoid using sudo
77-
sudo make install prefix="/usr/${GCC_TRIPLET_HOST}" || fail "Could not install win-iconv"
81+
sudo make install || fail "Could not install libiconv"
82+
# workaround to delete files owned by root, created by "make install":
83+
make clean
7884
)
7985
"$CONTRIB"/make_zbar.sh || fail "Could not build zbar"
8086
fi
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
--- a/lib/iconv.c 2018-05-03 23:18:55.997221700 -0400
2+
+++ b/lib/iconv.c 2018-05-03 23:26:47.611682700 -0400
3+
@@ -170,12 +170,12 @@ static const struct stringpool2_t string
4+
#include "aliases2.h"
5+
#undef S
6+
};
7+
#define stringpool2 ((const char *) &stringpool2_contents)
8+
static const struct alias sysdep_aliases[] = {
9+
-#define S(tag,name,encoding_index) { (int)(long)&((struct stringpool2_t *)0)->stringpool_##tag, encoding_index },
10+
+#define S(tag,name,encoding_index) { (int)(intptr_t)&((struct stringpool2_t *)0)->stringpool_##tag, encoding_index },
11+
#include "aliases2.h"
12+
#undef S
13+
};
14+
#ifdef __GNUC__
15+
__inline
16+
#else
17+
--- a/lib/genaliases.c 2023-01-14 00:00:00.000000000 +0000
18+
+++ b/lib/genaliases.c 2023-01-14 10:18:00.000000000 +0000
19+
@@ -50,7 +50,7 @@
20+
putc(c, out2);
21+
}
22+
}
23+
- fprintf(out2,"\")' tmp.h | sed -e 's|^.*\\(stringpool_str[0-9]*\\).*$| (int)(long)\\&((struct stringpool_t *)0)->\\1,|'\n");
24+
+ fprintf(out2,"\")' tmp.h | sed -e 's|^.*\\(stringpool_str[0-9]*\\).*$| (int)(intptr_t)\\&((struct stringpool_t *)0)->\\1,|'\n");
25+
for (; n > 0; names++, n--)
26+
emit_alias(out1, *names, c_name);
27+
}
28+
--- a/lib/genaliases2.c 2023-01-14 00:00:00.000000000 +0000
29+
+++ b/lib/genaliases2.c 2023-01-14 10:18:00.000000000 +0000
30+
@@ -44,6 +44,6 @@
31+
static void emit_encoding (FILE* out1, FILE* out2, const char* tag, const char* const* names, size_t n, const char* c_name)
32+
{
33+
- fprintf(out2," (int)(long)&((struct stringpool2_t *)0)->stringpool_%s_%u,\n",tag,counter);
34+
+ fprintf(out2," (int)(intptr_t)&((struct stringpool2_t *)0)->stringpool_%s_%u,\n",tag,counter);
35+
for (; n > 0; names++, n--)
36+
emit_alias(out1, tag, *names, c_name);
37+
}

contrib/build-wine/prepare-wine.sh

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,7 @@ $WINE_PYTHON -m pip install --no-build-isolation --no-dependencies --no-binary :
5353

5454

5555
# copy already built DLLs
56-
cp "$DLL_TARGET_DIR"/libsecp256k1-*.dll $WINEPREFIX/drive_c/electrum/electrum/ || fail "Could not copy libsecp to its destination"
57-
cp "$DLL_TARGET_DIR/libzbar-0.dll" $WINEPREFIX/drive_c/electrum/electrum/ || fail "Could not copy libzbar to its destination"
58-
cp "$DLL_TARGET_DIR/libusb-1.0.dll" $WINEPREFIX/drive_c/electrum/electrum/ || fail "Could not copy libusb to its destination"
56+
cp "$DLL_TARGET_DIR"/*.dll "$WINEPREFIX/drive_c/electrum/electrum/" || fail "Could not copy DLLs to destination"
5957

6058

6159
info "Building PyInstaller."

0 commit comments

Comments
 (0)