From 185d54de63693b3aa39d6e742adb7f7aa350adab Mon Sep 17 00:00:00 2001 From: SomberNight Date: Thu, 17 Mar 2022 18:09:04 +0100 Subject: [PATCH 1/3] win build: bump python 3.9.10->3.9.11 --- contrib/build-wine/prepare-wine.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/build-wine/prepare-wine.sh b/contrib/build-wine/prepare-wine.sh index eb59e7119..1acfd7c6a 100755 --- a/contrib/build-wine/prepare-wine.sh +++ b/contrib/build-wine/prepare-wine.sh @@ -9,7 +9,7 @@ PYINSTALLER_REPO="https://github.com/SomberNight/pyinstaller.git" PYINSTALLER_COMMIT="80ee4d613ecf75a1226b960a560ee01459e65ddb" # ^ tag 4.2, plus a custom commit that fixes cross-compilation with MinGW -PYTHON_VERSION=3.9.10 +PYTHON_VERSION=3.9.11 # Let's begin! From 0e7b7624fb98cced80c8b7b2c0728532b720174f Mon Sep 17 00:00:00 2001 From: SomberNight Date: Thu, 17 Mar 2022 20:55:33 +0100 Subject: [PATCH 2/3] win build: bump wine 6.0.2->7.0.0.0 to fix installing python MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit with wine 6.0.2 and 6.0.3, cpython 3.9.11 fails to install (but cpython 3.9.10 worked) ``` 010c:err:virtual:virtual_setup_exception stack overflow 1220 bytes in thread 010c addr 0x7bc6713d stack 0x440b3c (0x440000-0x441000-0x640000) 🗯 ERROR: wine msiexec failed for dev.msi 🗯 ERROR: prepare-wine failed ``` ----- btw, related note: After changing the Dockerfile, building the docker image from cache failed. Setting ELECBUILD_NOCACHE=1 fixed it: ``` E: Could not configure 'libc6:i386'. E: Could not perform immediate configuration on 'libgcc-s1:i386'. Please see man 5 apt.conf under APT::Immediate-Configure for details. (2) $ ELECBUILD_NOCACHE=1 ./contrib/build-wine/build.sh ``` --- contrib/build-wine/Dockerfile | 8 ++++---- contrib/build-wine/prepare-wine.sh | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/contrib/build-wine/Dockerfile b/contrib/build-wine/Dockerfile index be3a9c1e9..0d4201647 100644 --- a/contrib/build-wine/Dockerfile +++ b/contrib/build-wine/Dockerfile @@ -45,10 +45,10 @@ RUN wget -nc https://dl.winehq.org/wine-builds/Release.key && \ apt-add-repository https://dl.winehq.org/wine-builds/ubuntu/ && \ apt-get update -q && \ apt-get install -qy \ - wine-stable-amd64:amd64=6.0.2~focal-1 \ - wine-stable-i386:i386=6.0.2~focal-1 \ - wine-stable:amd64=6.0.2~focal-1 \ - winehq-stable:amd64=6.0.2~focal-1 \ + wine-stable-amd64:amd64=7.0.0.0~focal-1 \ + wine-stable-i386:i386=7.0.0.0~focal-1 \ + wine-stable:amd64=7.0.0.0~focal-1 \ + winehq-stable:amd64=7.0.0.0~focal-1 \ && \ rm -rf /var/lib/apt/lists/* && \ apt-get autoremove -y && \ diff --git a/contrib/build-wine/prepare-wine.sh b/contrib/build-wine/prepare-wine.sh index 1acfd7c6a..6b7a8dd28 100755 --- a/contrib/build-wine/prepare-wine.sh +++ b/contrib/build-wine/prepare-wine.sh @@ -44,8 +44,8 @@ for msifile in core dev exe lib pip tools; do echo "Installing $msifile..." download_if_not_exist "$PYTHON_DOWNLOADS/${msifile}.msi" "https://www.python.org/ftp/python/$PYTHON_VERSION/$PYARCH/${msifile}.msi" download_if_not_exist "$PYTHON_DOWNLOADS/${msifile}.msi.asc" "https://www.python.org/ftp/python/$PYTHON_VERSION/$PYARCH/${msifile}.msi.asc" - verify_signature "$PYTHON_DOWNLOADS/${msifile}.msi.asc" $KEYRING_PYTHON_DEV - wine msiexec /i "$PYTHON_DOWNLOADS/${msifile}.msi" /qb TARGETDIR=$WINE_PYHOME + verify_signature "$PYTHON_DOWNLOADS/${msifile}.msi.asc" $KEYRING_PYTHON_DEV || fail "invalid sig for ${msifile}.msi" + wine msiexec /i "$PYTHON_DOWNLOADS/${msifile}.msi" /qb TARGETDIR=$WINE_PYHOME || fail "wine msiexec failed for ${msifile}.msi" done break_legacy_easy_install From b5951adc29c1e39335350b8e03c316b41f33ef0f Mon Sep 17 00:00:00 2001 From: SomberNight Date: Sun, 20 Mar 2022 17:28:11 +0100 Subject: [PATCH 3/3] win build: update pyinstaller (from around 4.2 to around 4.10) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit see https://github.com/spesmilo/electrum/pull/7721#issuecomment-1072669548 ----- pyinstaller 4.2 failed (during its runtime) to create exes (worked with cpython 3.9.10, but not with cpython 3.9.11): ``` 80572 INFO: Processing module hooks... 80573 INFO: Loading module hook 'hook-certifi.py' from 'C:\\python3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'... 80618 INFO: Loading module hook 'hook-cryptography.py' from 'C:\\python3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'... 82879 INFO: Loading module hook 'hook-dns.rdata.py' from 'C:\\python3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'... 84147 INFO: Loading module hook 'hook-mnemonic.py' from 'C:\\python3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'... 84207 INFO: Loading module hook 'hook-pycparser.py' from 'C:\\python3\\lib\\site-packages\\_pyinstaller_hooks_contrib\\hooks\\stdhooks'... 84212 INFO: Loading module hook 'hook-usb1.py' from 'C:\\python3\\lib\\site-packages\\usb1\\__pyinstaller'... 84215 INFO: --- libusb1 pyinstaller hook --- 84226 INFO: Added libusb binaries: [('C:\\python3\\lib\\site-packages\\usb1\\libusb-1.0.dll', 'usb1')] 84228 INFO: Loading module hook 'hook-difflib.py' from 'C:\\python3\\lib\\site-packages\\PyInstaller\\hooks'... 84237 INFO: Excluding import of doctest from module difflib 84237 INFO: Loading module hook 'hook-distutils.py' from 'C:\\python3\\lib\\site-packages\\PyInstaller\\hooks'... Unable to find "C:\python3\Include\pyconfig.h" when adding binary and data files.This would mean your Python installation doesn't come with proper library files. This usually happens by missing development package, or unsuitable build parameters of Python installation. * On Debian/Ubuntu, you would need to install Python development packages * apt-get install python3-dev * apt-get install python-dev * If you're building Python by yourself, please rebuild your Python with `--enable-shared` (or, `--enable-framework` on Darwin) 🗯 ERROR: build-electrum-git failed ``` Looks like this might be fixed in pyinstaller 4.3 (we are using 4.2): https://github.com/pyinstaller/pyinstaller/pull/5218 ----- While trying to update pyinstaller to have that fix, several issues found with versions 4.3-4.10, now reported upstream and already fixed: https://github.com/pyinstaller/pyinstaller/issues/6338 https://github.com/pyinstaller/pyinstaller/issues/6339 https://github.com/pyinstaller/pyinstaller/issues/6686 So the pyinstaller commit pinned here is from the stable "v4" branch, some commits after the 4.10 tag, which has fixes for the above issues. --- contrib/build-wine/prepare-wine.sh | 13 ++++--------- .../deterministic-build/requirements-build-wine.txt | 6 +++--- contrib/requirements/requirements-build-wine.txt | 4 ++-- 3 files changed, 9 insertions(+), 14 deletions(-) diff --git a/contrib/build-wine/prepare-wine.sh b/contrib/build-wine/prepare-wine.sh index 6b7a8dd28..4dd644c44 100755 --- a/contrib/build-wine/prepare-wine.sh +++ b/contrib/build-wine/prepare-wine.sh @@ -5,9 +5,9 @@ NSIS_FILENAME=nsis-3.08-setup.exe NSIS_URL=https://downloads.sourceforge.net/project/nsis/NSIS%203/3.08/$NSIS_FILENAME NSIS_SHA256=bbc76be36ecb2fc00d493c91befdaf71654226ad8a4fc4dc338458916bf224d0 -PYINSTALLER_REPO="https://github.com/SomberNight/pyinstaller.git" -PYINSTALLER_COMMIT="80ee4d613ecf75a1226b960a560ee01459e65ddb" -# ^ tag 4.2, plus a custom commit that fixes cross-compilation with MinGW +PYINSTALLER_REPO="https://github.com/pyinstaller/pyinstaller.git" +PYINSTALLER_COMMIT="63438b1842eacd7f081fc53f1f5212bc20b7d02e" +# ^ latest commit from "v4" branch, somewhat after "4.10" tag PYTHON_VERSION=3.9.11 @@ -99,12 +99,7 @@ info "Building PyInstaller." pushd bootloader # cross-compile to Windows using host python python3 ./waf all CC="${GCC_TRIPLET_HOST}-gcc" \ - CFLAGS="-static \ - -Wno-dangling-else \ - -Wno-error=unused-value \ - -Wno-error=implicit-function-declaration \ - -Wno-error=int-to-pointer-cast \ - -Wno-error=stringop-truncation" + CFLAGS="-static" popd # sanity check bootloader is there: [[ -e "PyInstaller/bootloader/Windows-$PYINST_ARCH/runw.exe" ]] || fail "Could not find runw.exe in target dir!" diff --git a/contrib/deterministic-build/requirements-build-wine.txt b/contrib/deterministic-build/requirements-build-wine.txt index 5a411bea1..8eadf1ad3 100644 --- a/contrib/deterministic-build/requirements-build-wine.txt +++ b/contrib/deterministic-build/requirements-build-wine.txt @@ -14,9 +14,9 @@ pyinstaller-hooks-contrib==2022.2 \ pywin32-ctypes==0.2.0 \ --hash=sha256:24ffc3b341d457d48e8922352130cf2644024a4ff09762a2261fd34c36ee5942 \ --hash=sha256:9dc2d991b3479cc2df15930958b674a48a227d5361d413827a4cfd0b5876fc98 -setuptools==49.6.0 \ - --hash=sha256:46bd862894ed22c2edff033c758c2dc026324788d758e96788e8f7c11f4e9707 \ - --hash=sha256:4dd5bb0a0a0cff77b46ca5dd3a84857ee48c83e8223886b556613c724994073f +setuptools==60.9.2 \ + --hash=sha256:80743e57120665fa65665286369a0734bce0e7a629ad36507fb7a4b65e7d2e3b \ + --hash=sha256:93b1a3037230bf9aa07327b9fc58f527d5f4e22d36705b55d55ba3ece8606ca6 wheel==0.37.1 \ --hash=sha256:4bdcd7d840138086126cd09254dc6195fb4fc6f01c050a1d7236f2630db1d22a \ --hash=sha256:e9a504e793efbca1b8e0e9cb979a249cf4a0a7b5b8c9e8b65a5e39d49529c1c4 \ No newline at end of file diff --git a/contrib/requirements/requirements-build-wine.txt b/contrib/requirements/requirements-build-wine.txt index 1d13ad4db..4e4e0c75d 100644 --- a/contrib/requirements/requirements-build-wine.txt +++ b/contrib/requirements/requirements-build-wine.txt @@ -1,9 +1,9 @@ pip -setuptools<50.0.0 # 50.0.0 might break pyinstaller. see https://github.com/pyinstaller/pyinstaller/commit/e9f9d79d6b23c767512156323d0a5d28c6386a57 +setuptools wheel # needed by pyinstaller: pefile>=2017.8.1 altgraph pywin32-ctypes>=0.2.0 -pyinstaller-hooks-contrib>=2020.6 +pyinstaller-hooks-contrib>=2020.11