From 88881cf7ac029aea660c2413ca8e2a5136fcd41b Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Tue, 18 Apr 2023 14:12:35 +0200 Subject: [PATCH 1/3] Bump python minimum version to 3.8 Also, switch ci_native_qt5 to g++-9 (from g++-8) to work around bugs. This should be fine, because the i686_centos task still checks for g++-8 compatibility. See https://github.com/bitcoin/bitcoin/pull/27483#issuecomment-1513477050 for the list of bugs. --- .cirrus.yml | 2 +- .python-version | 2 +- ci/test/00_setup_env_i686_centos.sh | 3 ++- .../00_setup_env_native_nowallet_libbitcoinkernel.sh | 4 ++-- ci/test/00_setup_env_native_qt5.sh | 10 +++++----- configure.ac | 4 ++-- doc/dependencies.md | 2 +- 7 files changed, 14 insertions(+), 13 deletions(-) diff --git a/.cirrus.yml b/.cirrus.yml index 680024d155c..0b91aad00c0 100644 --- a/.cirrus.yml +++ b/.cirrus.yml @@ -228,7 +228,7 @@ task: PACKAGE_MANAGER_INSTALL: "yum install -y" task: - name: '[previous releases, uses qt5 dev package and some depends packages, DEBUG] [unsigned char] [buster]' + name: '[previous releases, qt5 dev package and depends packages, DEBUG] [focal]' previous_releases_cache: folder: "releases" << : *GLOBAL_TASK_TEMPLATE diff --git a/.python-version b/.python-version index 36f601f10e9..eee6392d5c7 100644 --- a/.python-version +++ b/.python-version @@ -1 +1 @@ -3.7.16 +3.8.16 diff --git a/ci/test/00_setup_env_i686_centos.sh b/ci/test/00_setup_env_i686_centos.sh index 8a931d44e5e..544d6150a61 100755 --- a/ci/test/00_setup_env_i686_centos.sh +++ b/ci/test/00_setup_env_i686_centos.sh @@ -8,7 +8,8 @@ export LC_ALL=C.UTF-8 export HOST=i686-pc-linux-gnu export CONTAINER_NAME=ci_i686_centos -export CI_IMAGE_NAME_TAG=quay.io/centos/centos:stream8 +export CI_IMAGE_NAME_TAG="quay.io/centos/centos:stream8" +# Use minimum supported python3.8 and gcc-8, see doc/dependencies.md export CI_BASE_PACKAGES="gcc-c++ glibc-devel.x86_64 libstdc++-devel.x86_64 glibc-devel.i686 libstdc++-devel.i686 ccache libtool make git python38 python38-pip which patch lbzip2 xz procps-ng dash rsync coreutils bison" export PIP_PACKAGES="pyzmq" export GOAL="install" diff --git a/ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh b/ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh index 3fdb49765c7..b86fa6f3212 100755 --- a/ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh +++ b/ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh @@ -7,8 +7,8 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_native_nowallet_libbitcoinkernel -export CI_IMAGE_NAME_TAG=ubuntu:focal -# Use minimum supported python3.7 (or python3.8, as best-effort) and clang-8, see doc/dependencies.md +export CI_IMAGE_NAME_TAG="ubuntu:20.04" +# Use minimum supported python3.8 and clang-8, see doc/dependencies.md export PACKAGES="python3-zmq clang-8 llvm-8 libc++abi-8-dev libc++-8-dev" export DEP_OPTS="NO_WALLET=1 CC=clang-8 CXX='clang++-8 -stdlib=libc++'" export GOAL="install" diff --git a/ci/test/00_setup_env_native_qt5.sh b/ci/test/00_setup_env_native_qt5.sh index 5cc0addd33c..59d8c7c8712 100755 --- a/ci/test/00_setup_env_native_qt5.sh +++ b/ci/test/00_setup_env_native_qt5.sh @@ -7,10 +7,10 @@ export LC_ALL=C.UTF-8 export CONTAINER_NAME=ci_native_qt5 -export CI_IMAGE_NAME_TAG=debian:buster -# Use minimum supported python3.7 and gcc-8, see doc/dependencies.md -export PACKAGES="gcc-8 g++-8 python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev" -export DEP_OPTS="NO_QT=1 NO_UPNP=1 NO_NATPMP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1 CC=gcc-8 CXX=g++-8" +export CI_IMAGE_NAME_TAG="ubuntu:20.04" +# Use minimum supported python3.8 and gcc-8 (or best-effort gcc-9), see doc/dependencies.md +export PACKAGES="gcc-9 g++-9 python3-zmq qtbase5-dev qttools5-dev-tools libdbus-1-dev libharfbuzz-dev" +export DEP_OPTS="NO_QT=1 NO_UPNP=1 NO_NATPMP=1 DEBUG=1 ALLOW_HOST_PACKAGES=1 CC=gcc-9 CXX=g++-9" export TEST_RUNNER_EXTRA="--previous-releases --coverage --extended --exclude feature_dbcrash" # Run extended tests so that coverage does not fail, but exclude the very slow dbcrash export RUN_UNIT_TESTS_SEQUENTIAL="true" export RUN_UNIT_TESTS="false" @@ -18,4 +18,4 @@ export GOAL="install" export NO_WERROR=1 export DOWNLOAD_PREVIOUS_RELEASES="true" export BITCOIN_CONFIG="--enable-zmq --with-libs=no --with-gui=qt5 --enable-reduce-exports \ ---enable-debug CFLAGS=\"-g0 -O2 -funsigned-char\" CXXFLAGS=\"-g0 -O2 -funsigned-char\" CC=gcc-8 CXX=g++-8" +--enable-debug CFLAGS=\"-g0 -O2 -funsigned-char\" CXXFLAGS=\"-g0 -O2 -funsigned-char\"" diff --git a/configure.ac b/configure.ac index b5116922f94..cbbf8d61724 100644 --- a/configure.ac +++ b/configure.ac @@ -126,8 +126,8 @@ AC_PATH_TOOL([AR], [ar]) AC_PATH_TOOL([GCOV], [gcov]) AC_PATH_TOOL([LLVM_COV], [llvm-cov]) AC_PATH_PROG([LCOV], [lcov]) -dnl Python 3.7 is specified in .python-version and should be used if available, see doc/dependencies.md -AC_PATH_PROGS([PYTHON], [python3.7 python3.8 python3.9 python3.10 python3.11 python3.12 python3 python]) +dnl Python 3.8 is specified in .python-version and should be used if available, see doc/dependencies.md +AC_PATH_PROGS([PYTHON], [python3.8 python3.9 python3.10 python3.11 python3.12 python3 python]) AC_PATH_PROG([GENHTML], [genhtml]) AC_PATH_PROG([GIT], [git]) AC_PATH_PROG([CCACHE], [ccache]) diff --git a/doc/dependencies.md b/doc/dependencies.md index 182d026c581..c8417f49e6e 100644 --- a/doc/dependencies.md +++ b/doc/dependencies.md @@ -10,7 +10,7 @@ You can find installation instructions in the `build-*.md` file for your platfor | [Automake](https://www.gnu.org/software/automake/) | [1.13](https://github.com/bitcoin/bitcoin/pull/18290) | | [Clang](https://clang.llvm.org) | [8.0](https://github.com/bitcoin/bitcoin/pull/24164) | | [GCC](https://gcc.gnu.org) | [8.1](https://github.com/bitcoin/bitcoin/pull/23060) | -| [Python](https://www.python.org) (tests) | [3.7](https://github.com/bitcoin/bitcoin/pull/26226) | +| [Python](https://www.python.org) (scripts, tests) | [3.8](https://github.com/bitcoin/bitcoin/pull/27483) | | [systemtap](https://sourceware.org/systemtap/) ([tracing](tracing.md))| N/A | ## Required From fa6eb6516727a8675dc6e46634d8343e282528ab Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Tue, 18 Apr 2023 14:06:25 +0200 Subject: [PATCH 2/3] test: Use python3.8 pow() --- test/functional/test_framework/util.py | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/test/functional/test_framework/util.py b/test/functional/test_framework/util.py index a1b90860f67..5eeb67c00a1 100644 --- a/test/functional/test_framework/util.py +++ b/test/functional/test_framework/util.py @@ -542,18 +542,7 @@ def modinv(a, n): """Compute the modular inverse of a modulo n using the extended Euclidean Algorithm. See https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm#Modular_integers. """ - # TODO: Change to pow(a, -1, n) available in Python 3.8 - t1, t2 = 0, 1 - r1, r2 = n, a - while r2 != 0: - q = r1 // r2 - t1, t2 = t2, t1 - q * t2 - r1, r2 = r2, r1 - q * r2 - if r1 > 1: - return None - if t1 < 0: - t1 += n - return t1 + return pow(a, -1, n) class TestFrameworkUtil(unittest.TestCase): def test_modinv(self): From fac395e5eb2cd3210ba6345f777a586a9bec84e3 Mon Sep 17 00:00:00 2001 From: MarcoFalke <*~=`'#}+{/-|&$^_@721217.xyz> Date: Fri, 21 Apr 2023 14:35:06 +0200 Subject: [PATCH 3/3] ci: Bump ci/lint/Dockerfile This bump should not be needed, see discussion starting at https://github.com/bitcoin/bitcoin/pull/27483#issuecomment-1517739626 --- ci/lint/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/lint/Dockerfile b/ci/lint/Dockerfile index 03c20c72860..a0a45164803 100644 --- a/ci/lint/Dockerfile +++ b/ci/lint/Dockerfile @@ -5,7 +5,7 @@ # entire repo as docker context during build; if it lived elsewhere, it wouldn't be # able to make back-references to pull in the install scripts. So here it lives. -FROM python:3.7-buster +FROM python:3.8-buster ENV DEBIAN_FRONTEND=noninteractive ENV LC_ALL=C.UTF-8