Skip to content

Commit 1576667

Browse files
committed
Merge commit 'b92d609fb25637ccda000e182da854d4b762eee9' into main
2 parents 4ac6a40 + b92d609 commit 1576667

File tree

100 files changed

+787
-648
lines changed

Some content is hidden

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

100 files changed

+787
-648
lines changed

.cirrus.yml

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ main_template: &MAIN_TEMPLATE
3939
ci_script:
4040
- ./ci/test_run_all.sh
4141

42-
global_task_template: &GLOBAL_TASK_TEMPLATE
42+
container_depends_template: &CONTAINER_DEPENDS_TEMPLATE
4343
<< : *BASE_TEMPLATE
4444
container:
4545
# https://cirrus-ci.org/faq/#are-there-any-limits
@@ -49,15 +49,10 @@ global_task_template: &GLOBAL_TASK_TEMPLATE
4949
memory: 8G # Set to 8GB to avoid OOM. https://cirrus-ci.org/guide/linux/#linux-containers
5050
depends_built_cache:
5151
folder: "depends/built"
52-
fingerprint_script: echo $CIRRUS_TASK_NAME $(git rev-list -1 HEAD ./depends)
53-
<< : *MAIN_TEMPLATE
52+
fingerprint_script: echo $CIRRUS_TASK_NAME $(git rev-parse HEAD:depends)
5453

55-
macos_native_task_template: &MACOS_NATIVE_TASK_TEMPLATE
56-
<< : *BASE_TEMPLATE
57-
check_clang_script:
58-
- clang --version
59-
brew_install_script:
60-
- brew install boost libevent qt@5 miniupnpc libnatpmp ccache zeromq qrencode libtool automake gnu-getopt
54+
global_task_template: &GLOBAL_TASK_TEMPLATE
55+
<< : *CONTAINER_DEPENDS_TEMPLATE
6156
<< : *MAIN_TEMPLATE
6257

6358
compute_credits_template: &CREDITS_TEMPLATE
@@ -313,13 +308,13 @@ task:
313308

314309
task:
315310
name: 'macOS 10.15 [gui, no tests] [focal]'
316-
<< : *BASE_TEMPLATE
311+
<< : *CONTAINER_DEPENDS_TEMPLATE
312+
container:
313+
image: ubuntu:focal
317314
macos_sdk_cache:
318315
folder: "depends/SDKs/$MACOS_SDK"
319316
fingerprint_key: "$MACOS_SDK"
320317
<< : *MAIN_TEMPLATE
321-
container:
322-
image: ubuntu:focal
323318
env:
324319
MACOS_SDK: "Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers"
325320
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
@@ -336,25 +331,30 @@ task:
336331
macos_instance:
337332
# Use latest image, but hardcode version to avoid silent upgrades (and breaks)
338333
image: ghcr.io/cirruslabs/macos-ventura-xcode:14.1 # https://cirrus-ci.org/guide/macOS
339-
<< : *MACOS_NATIVE_TASK_TEMPLATE
334+
<< : *BASE_TEMPLATE
335+
check_clang_script:
336+
- clang --version
337+
brew_install_script:
338+
- brew install boost libevent qt@5 miniupnpc libnatpmp ccache zeromq qrencode libtool automake gnu-getopt
339+
<< : *MAIN_TEMPLATE
340340
env:
341341
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
342342
CI_USE_APT_INSTALL: "no"
343343
PACKAGE_MANAGER_INSTALL: "echo" # Nothing to do
344344
FILE_ENV: "./ci/test/00_setup_env_mac_native_arm64.sh"
345345

346346
task:
347-
name: 'ARM64 Android APK [focal]'
348-
<< : *BASE_TEMPLATE
347+
name: 'ARM64 Android APK [jammy]'
348+
<< : *CONTAINER_DEPENDS_TEMPLATE
349+
container:
350+
image: ubuntu:jammy
349351
android_sdk_cache:
350352
folder: "depends/SDKs/android"
351353
fingerprint_key: "ANDROID_API_LEVEL=28 ANDROID_BUILD_TOOLS_VERSION=28.0.3 ANDROID_NDK_VERSION=23.2.8568313"
352354
depends_sources_cache:
353355
folder: "depends/sources"
354-
fingerprint_script: git rev-list -1 HEAD ./depends
356+
fingerprint_script: git rev-parse HEAD:depends/packages
355357
<< : *MAIN_TEMPLATE
356-
container:
357-
image: ubuntu:focal
358358
env:
359359
<< : *CIRRUS_EPHEMERAL_WORKER_TEMPLATE_ENV
360360
FILE_ENV: "./ci/test/00_setup_env_android.sh"

REVIEWERS

Lines changed: 0 additions & 17 deletions
This file was deleted.

ci/test/00_setup_env_android.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export LC_ALL=C.UTF-8
99
export HOST=aarch64-linux-android
1010
export PACKAGES="unzip openjdk-8-jdk gradle"
1111
export CONTAINER_NAME=ci_android
12-
export CI_IMAGE_NAME_TAG="ubuntu:focal"
12+
export CI_IMAGE_NAME_TAG="ubuntu:jammy"
1313

1414
export RUN_UNIT_TESTS=false
1515
export RUN_FUNCTIONAL_TESTS=false

ci/test/00_setup_env_i686_centos.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export CI_IMAGE_NAME_TAG=quay.io/centos/centos:stream8
1212
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"
1313
export PIP_PACKAGES="pyzmq"
1414
export GOAL="install"
15+
export NO_WERROR=1 # GCC 8
1516
export BITCOIN_CONFIG="--enable-zmq --with-gui=qt5 --enable-reduce-exports"
1617
export CONFIG_SHELL="/bin/dash"
1718
export TEST_RUNNER_ENV="LC_ALL=en_US.UTF-8"

ci/test/00_setup_env_native_nowallet_libbitcoinkernel.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,5 @@ export PACKAGES="-t buster-backports python3-zmq clang-8 llvm-8 libc++abi-8-dev
1313
export APPEND_APT_SOURCES_LIST="deb http://deb.debian.org/debian buster-backports main"
1414
export DEP_OPTS="NO_WALLET=1 CC=clang-8 CXX='clang++-8 -stdlib=libc++'"
1515
export GOAL="install"
16+
export NO_WERROR=1
1617
export BITCOIN_CONFIG="--enable-reduce-exports CC=clang-8 CXX='clang++-8 -stdlib=libc++' --enable-experimental-util-chainstate --with-experimental-kernel-lib --enable-shared"

ci/test/00_setup_env_native_qt5.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ export TEST_RUNNER_EXTRA="--previous-releases --coverage --extended --exclude fe
1414
export RUN_UNIT_TESTS_SEQUENTIAL="true"
1515
export RUN_UNIT_TESTS="false"
1616
export GOAL="install"
17+
export NO_WERROR=1
1718
export DOWNLOAD_PREVIOUS_RELEASES="true"
1819
export BITCOIN_CONFIG="--enable-zmq --with-libs=no --with-gui=qt5 --enable-reduce-exports \
1920
--enable-debug CFLAGS=\"-g0 -O2 -funsigned-char\" CXXFLAGS=\"-g0 -O2 -funsigned-char\" CC=gcc-9 CXX=g++-9"

ci/test/01_base_install.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
#
3+
# Copyright (c) 2018-2022 The Bitcoin Core developers
4+
# Distributed under the MIT software license, see the accompanying
5+
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
6+
7+
export LC_ALL=C.UTF-8
8+
9+
CI_EXEC_ROOT () { bash -c "$*"; }
10+
export -f CI_EXEC_ROOT
11+
12+
if [ -n "$DPKG_ADD_ARCH" ]; then
13+
CI_EXEC_ROOT dpkg --add-architecture "$DPKG_ADD_ARCH"
14+
fi
15+
16+
if [[ $CI_IMAGE_NAME_TAG == *centos* ]]; then
17+
${CI_RETRY_EXE} CI_EXEC_ROOT dnf -y install epel-release
18+
${CI_RETRY_EXE} CI_EXEC_ROOT dnf -y --allowerasing install "$CI_BASE_PACKAGES" "$PACKAGES"
19+
elif [ "$CI_USE_APT_INSTALL" != "no" ]; then
20+
if [[ "${ADD_UNTRUSTED_BPFCC_PPA}" == "true" ]]; then
21+
# Ubuntu 22.04 LTS and Debian 11 both have an outdated bpfcc-tools packages.
22+
# The iovisor PPA is outdated as well. The next Ubuntu and Debian releases will contain updated
23+
# packages. Meanwhile, use an untrusted PPA to install an up-to-date version of the bpfcc-tools
24+
# package.
25+
# TODO: drop this once we can use newer images in GCE
26+
CI_EXEC_ROOT add-apt-repository ppa:hadret/bpfcc
27+
fi
28+
if [[ -n "${APPEND_APT_SOURCES_LIST}" ]]; then
29+
CI_EXEC_ROOT echo "${APPEND_APT_SOURCES_LIST}" \>\> /etc/apt/sources.list
30+
fi
31+
${CI_RETRY_EXE} CI_EXEC_ROOT apt-get update
32+
${CI_RETRY_EXE} CI_EXEC_ROOT apt-get install --no-install-recommends --no-upgrade -y "$PACKAGES" "$CI_BASE_PACKAGES"
33+
fi

ci/test/04_install.sh

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
3333

3434
# the name isn't important, so long as we use the same UID
3535
LOCAL_USER=nonroot
36-
${CI_RETRY_EXE} docker pull "$CI_IMAGE_NAME_TAG"
36+
DOCKER_BUILDKIT=1 ${CI_RETRY_EXE} docker build \
37+
--file "${BASE_ROOT_DIR}/ci/test_imagefile" \
38+
--build-arg "CI_IMAGE_NAME_TAG=${CI_IMAGE_NAME_TAG}" \
39+
--build-arg "FILE_ENV=${FILE_ENV}" \
40+
--tag="${CONTAINER_NAME}" \
41+
"${BASE_ROOT_DIR}"
3742

3843
if [ -n "${RESTART_CI_DOCKER_BEFORE_RUN}" ] ; then
3944
echo "Restart docker before run to stop and clear all containers started with --rm"
@@ -49,7 +54,7 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
4954
-w $BASE_ROOT_DIR \
5055
--env-file /tmp/env \
5156
--name $CONTAINER_NAME \
52-
$CI_IMAGE_NAME_TAG)
57+
$CONTAINER_NAME)
5358
export CI_CONTAINER_ID
5459

5560
# Create a non-root user inside the container which matches the local user.
@@ -63,6 +68,7 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
6368
export CI_EXEC_CMD_PREFIX="docker exec -u $LOCAL_UID $CI_CONTAINER_ID"
6469
else
6570
echo "Running on host system without docker wrapper"
71+
"${BASE_ROOT_DIR}/ci/test/01_base_install.sh"
6672
fi
6773

6874
CI_EXEC () {
@@ -76,29 +82,6 @@ export -f CI_EXEC_ROOT
7682

7783
CI_EXEC mkdir -p "${BINS_SCRATCH_DIR}"
7884

79-
if [ -n "$DPKG_ADD_ARCH" ]; then
80-
CI_EXEC_ROOT dpkg --add-architecture "$DPKG_ADD_ARCH"
81-
fi
82-
83-
if [[ $CI_IMAGE_NAME_TAG == *centos* ]]; then
84-
${CI_RETRY_EXE} CI_EXEC_ROOT dnf -y install epel-release
85-
${CI_RETRY_EXE} CI_EXEC_ROOT dnf -y --allowerasing install "$CI_BASE_PACKAGES" "$PACKAGES"
86-
elif [ "$CI_USE_APT_INSTALL" != "no" ]; then
87-
if [[ "${ADD_UNTRUSTED_BPFCC_PPA}" == "true" ]]; then
88-
# Ubuntu 22.04 LTS and Debian 11 both have an outdated bpfcc-tools packages.
89-
# The iovisor PPA is outdated as well. The next Ubuntu and Debian releases will contain updated
90-
# packages. Meanwhile, use an untrusted PPA to install an up-to-date version of the bpfcc-tools
91-
# package.
92-
# TODO: drop this once we can use newer images in GCE
93-
CI_EXEC_ROOT add-apt-repository ppa:hadret/bpfcc
94-
fi
95-
if [[ -n "${APPEND_APT_SOURCES_LIST}" ]]; then
96-
CI_EXEC_ROOT echo "${APPEND_APT_SOURCES_LIST}" \>\> /etc/apt/sources.list
97-
fi
98-
${CI_RETRY_EXE} CI_EXEC_ROOT apt-get update
99-
${CI_RETRY_EXE} CI_EXEC_ROOT apt-get install --no-install-recommends --no-upgrade -y "$PACKAGES" "$CI_BASE_PACKAGES"
100-
fi
101-
10285
if [ -n "$PIP_PACKAGES" ]; then
10386
if [ "$CI_OS_NAME" == "macos" ]; then
10487
sudo -H pip3 install --upgrade pip

ci/test/06_script_b.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ if [ "${RUN_TIDY}" = "true" ]; then
6060
" src/rpc/signmessage.cpp"\
6161
" src/test/fuzz/txorphan.cpp"\
6262
" src/test/fuzz/util/"\
63+
" src/uint256.cpp"\
6364
" src/util/bip32.cpp"\
6465
" src/util/bytevectorhash.cpp"\
6566
" src/util/check.cpp"\
@@ -75,7 +76,12 @@ if [ "${RUN_TIDY}" = "true" ]; then
7576
" src/util/syserror.cpp"\
7677
" src/util/threadinterrupt.cpp"\
7778
" src/zmq"\
78-
" -p . ${MAKEJOBS} -- -Xiwyu --cxx17ns -Xiwyu --mapping_file=${BASE_BUILD_DIR}/bitcoin-$HOST/contrib/devtools/iwyu/bitcoin.core.imp"
79+
" -p . ${MAKEJOBS}"\
80+
" -- -Xiwyu --cxx17ns -Xiwyu --mapping_file=${BASE_BUILD_DIR}/bitcoin-$HOST/contrib/devtools/iwyu/bitcoin.core.imp"\
81+
" |& tee /tmp/iwyu_ci.out"
82+
export P_CI_DIR="${BASE_ROOT_DIR}/src"
83+
CI_EXEC "python3 ${DIR_IWYU}/include-what-you-use/fix_includes.py --nosafe_headers < /tmp/iwyu_ci.out"
84+
CI_EXEC "git --no-pager diff"
7985
fi
8086

8187
if [ "$RUN_SECURITY_TESTS" = "true" ]; then

ci/test_imagefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
ARG CI_IMAGE_NAME_TAG
2+
FROM ${CI_IMAGE_NAME_TAG}
3+
4+
ARG FILE_ENV
5+
ENV FILE_ENV=${FILE_ENV}
6+
7+
COPY ./ci/retry/retry /usr/bin/retry
8+
COPY ./ci/test/00_setup_env.sh ./${FILE_ENV} ./ci/test/01_base_install.sh /ci_base_install/ci/test/
9+
10+
RUN ["bash", "-c", "cd /ci_base_install/ && set -o errexit && source ./ci/test/00_setup_env.sh && ./ci/test/01_base_install.sh"]

0 commit comments

Comments
 (0)