Skip to content

Commit 0b68fe0

Browse files
committed
Merge branch 'auxpow'
Some of the new miniscript signing tests in wallet_miniscript.py are disabled for now as they fail on Namecoin, this needs debugging and fixing in the future. These were introduced upstream in bitcoin/bitcoin#24149.
2 parents 925e7ef + 64df75b commit 0b68fe0

File tree

182 files changed

+4220
-1367
lines changed

Some content is hidden

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

182 files changed

+4220
-1367
lines changed

ci/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ Be aware that the tests will be built and run in-place, so please run at your ow
88
If the repository is not a fresh git clone, you might have to clean files from previous builds or test runs first.
99

1010
The ci needs to perform various sysadmin tasks such as installing packages or writing to the user's home directory.
11-
While most of the actions are done inside a docker container, this is not possible for all. Thus, cache directories,
12-
such as the depends cache, previous release binaries, or ccache, are mounted as read-write into the docker container. While it should be fine to run
11+
While it should be fine to run
1312
the ci system locally on you development box, the ci scripts can generally be assumed to have received less review and
1413
testing compared to other parts of the codebase. If you want to keep the work tree clean, you might want to run the ci
1514
system in a virtual machine with a Linux operating system of your choice.

ci/test/00_setup_env.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ export LC_ALL=C.UTF-8
88

99
# The root dir.
1010
# The ci system copies this folder.
11-
# This is where the depends build is done.
1211
BASE_ROOT_DIR=$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../../ >/dev/null 2>&1 && pwd )
1312
export BASE_ROOT_DIR
1413
# The depends dir.
15-
# This folder exists on the ci host and ci guest. Changes are propagated back and forth.
14+
# This folder exists only on the ci guest, and on the ci host as a volume.
1615
export DEPENDS_DIR=${DEPENDS_DIR:-$BASE_ROOT_DIR/depends}
1716
# A folder for the ci system to put temporary files (ccache, datadirs for tests, ...)
1817
# This folder only exists on the ci host.
@@ -58,12 +57,14 @@ export CCACHE_SIZE=${CCACHE_SIZE:-100M}
5857
export CCACHE_TEMPDIR=${CCACHE_TEMPDIR:-/tmp/.ccache-temp}
5958
export CCACHE_COMPRESS=${CCACHE_COMPRESS:-1}
6059
# The cache dir.
61-
# This folder exists on the ci host and ci guest. Changes are propagated back and forth.
60+
# This folder exists only on the ci guest, and on the ci host as a volume.
6261
export CCACHE_DIR=${CCACHE_DIR:-$BASE_SCRATCH_DIR/.ccache}
6362
# Folder where the build result is put (bin and lib).
6463
export BASE_OUTDIR=${BASE_OUTDIR:-$BASE_SCRATCH_DIR/out/$HOST}
6564
# Folder where the build is done (dist and out-of-tree build).
6665
export BASE_BUILD_DIR=${BASE_BUILD_DIR:-$BASE_SCRATCH_DIR/build}
66+
# The folder for previous release binaries.
67+
# This folder exists only on the ci guest, and on the ci host as a volume.
6768
export PREVIOUS_RELEASES_DIR=${PREVIOUS_RELEASES_DIR:-$BASE_ROOT_DIR/releases/$HOST}
6869
export SDK_URL=${SDK_URL:-https://bitcoincore.org/depends-sources/sdks}
6970
export CI_BASE_PACKAGES=${CI_BASE_PACKAGES:-build-essential libtool autotools-dev automake pkg-config bsdmainutils curl ca-certificates ccache python3 rsync git procps bison}

ci/test/04_install.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
3939
--build-arg "FILE_ENV=${FILE_ENV}" \
4040
--tag="${CONTAINER_NAME}" \
4141
"${BASE_ROOT_DIR}"
42+
docker volume create "${CONTAINER_NAME}_ccache" || true
43+
docker volume create "${CONTAINER_NAME}_depends" || true
44+
docker volume create "${CONTAINER_NAME}_previous_releases" || true
4245

4346
if [ -n "${RESTART_CI_DOCKER_BEFORE_RUN}" ] ; then
4447
echo "Restart docker before run to stop and clear all containers started with --rm"
@@ -48,9 +51,9 @@ if [ -z "$DANGER_RUN_CI_ON_HOST" ]; then
4851
# shellcheck disable=SC2086
4952
CI_CONTAINER_ID=$(docker run $CI_CONTAINER_CAP --rm --interactive --detach --tty \
5053
--mount type=bind,src=$BASE_ROOT_DIR,dst=/ro_base,readonly \
51-
--mount type=bind,src=$CCACHE_DIR,dst=$CCACHE_DIR \
52-
--mount type=bind,src=$DEPENDS_DIR,dst=$DEPENDS_DIR \
53-
--mount type=bind,src=$PREVIOUS_RELEASES_DIR,dst=$PREVIOUS_RELEASES_DIR \
54+
--mount "type=volume,src=${CONTAINER_NAME}_ccache,dst=$CCACHE_DIR" \
55+
--mount "type=volume,src=${CONTAINER_NAME}_depends,dst=$DEPENDS_DIR" \
56+
--mount "type=volume,src=${CONTAINER_NAME}_previous_releases,dst=$PREVIOUS_RELEASES_DIR" \
5457
-w $BASE_ROOT_DIR \
5558
--env-file /tmp/env \
5659
--name $CONTAINER_NAME \

ci/test/06_script_b.sh

Lines changed: 1 addition & 0 deletions
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/test/util/coins.cpp"\
6364
" src/uint256.cpp"\
6465
" src/util/bip32.cpp"\
6566
" src/util/bytevectorhash.cpp"\

configure.ac

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,14 +1418,15 @@ if test "$use_upnp" != "no"; then
14181418
[AC_CHECK_LIB([miniupnpc], [upnpDiscover], [MINIUPNPC_LIBS="$MINIUPNPC_LIBS -lminiupnpc"], [have_miniupnpc=no], [$MINIUPNPC_LIBS])],
14191419
[have_miniupnpc=no]
14201420
)
1421-
dnl The minimum supported miniUPnPc API version is set to 10. This keeps compatibility
1422-
dnl with Ubuntu 16.04 LTS and Debian 8 libminiupnpc-dev packages.
1421+
1422+
dnl The minimum supported miniUPnPc API version is set to 17. This excludes
1423+
dnl versions with known vulnerabilities.
14231424
if test "$have_miniupnpc" != "no"; then
14241425
AC_MSG_CHECKING([whether miniUPnPc API version is supported])
14251426
AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
14261427
@%:@include <miniupnpc/miniupnpc.h>
14271428
]], [[
1428-
#if MINIUPNPC_API_VERSION >= 10
1429+
#if MINIUPNPC_API_VERSION >= 17
14291430
// Everything is okay
14301431
#else
14311432
# error miniUPnPc API version is too old
@@ -1434,7 +1435,7 @@ if test "$use_upnp" != "no"; then
14341435
AC_MSG_RESULT([yes])
14351436
],[
14361437
AC_MSG_RESULT([no])
1437-
AC_MSG_WARN([miniUPnPc API version < 10 is unsupported, disabling UPnP support.])
1438+
AC_MSG_WARN([miniUPnPc API version < 17 is unsupported, disabling UPnP support.])
14381439
have_miniupnpc=no
14391440
])
14401441
fi

contrib/devtools/symbol-check.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,30 +15,30 @@
1515

1616
import lief #type:ignore
1717

18-
# Debian 9 (Stretch) EOL: 2022. https://wiki.debian.org/DebianReleases#Production_Releases
18+
# Debian 10 (Buster) EOL: 2024. https://wiki.debian.org/LTS
1919
#
20-
# - g++ version 6.3.0 (https://packages.debian.org/search?suite=stretch&arch=any&searchon=names&keywords=g%2B%2B)
21-
# - libc version 2.24 (https://packages.debian.org/search?suite=stretch&arch=any&searchon=names&keywords=libc6)
20+
# - libgcc version 8.3.0 (https://packages.debian.org/search?suite=buster&arch=any&searchon=names&keywords=libgcc1)
21+
# - libc version 2.28 (https://packages.debian.org/search?suite=buster&arch=any&searchon=names&keywords=libc6)
2222
#
23-
# Ubuntu 16.04 (Xenial) EOL: 2026. https://wiki.ubuntu.com/Releases
23+
# Ubuntu 18.04 (Bionic) EOL: 2028. https://wiki.ubuntu.com/ReleaseTeam
2424
#
25-
# - g++ version 5.3.1
26-
# - libc version 2.23
25+
# - libgcc version 8.4.0 (https://packages.ubuntu.com/bionic/libgcc1)
26+
# - libc version 2.27 (https://packages.ubuntu.com/bionic/libc6)
2727
#
2828
# CentOS Stream 8 EOL: 2024. https://wiki.centos.org/About/Product
2929
#
30-
# - g++ version 8.5.0 (http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/)
30+
# - libgcc version 8.5.0 (http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/)
3131
# - libc version 2.28 (http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/Packages/)
3232
#
3333
# See https://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html for more info.
3434

3535
MAX_VERSIONS = {
3636
'GCC': (4,8,0),
3737
'GLIBC': {
38-
lief.ELF.ARCH.x86_64: (2,18),
39-
lief.ELF.ARCH.ARM: (2,18),
40-
lief.ELF.ARCH.AARCH64:(2,18),
41-
lief.ELF.ARCH.PPC64: (2,18),
38+
lief.ELF.ARCH.x86_64: (2,27),
39+
lief.ELF.ARCH.ARM: (2,27),
40+
lief.ELF.ARCH.AARCH64:(2,27),
41+
lief.ELF.ARCH.PPC64: (2,27),
4242
lief.ELF.ARCH.RISCV: (2,27),
4343
},
4444
'LIBATOMIC': (1,0),

contrib/devtools/test-symbol-check.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -38,31 +38,6 @@ def test_ELF(self):
3838
executable = 'test1'
3939
cc = determine_wellknown_cmd('CC', 'gcc')
4040

41-
# there's no way to do this test for RISC-V at the moment; we build for
42-
# RISC-V in a glibc 2.27 environment and we allow all symbols from 2.27.
43-
if 'riscv' in get_machine(cc):
44-
self.skipTest("test not available for RISC-V")
45-
46-
# nextup was introduced in GLIBC 2.24, so is newer than our supported
47-
# glibc (2.18), and available in our release build environment (2.24).
48-
with open(source, 'w', encoding="utf8") as f:
49-
f.write('''
50-
#define _GNU_SOURCE
51-
#include <math.h>
52-
53-
double nextup(double x);
54-
55-
int main()
56-
{
57-
nextup(3.14);
58-
return 0;
59-
}
60-
''')
61-
62-
self.assertEqual(call_symbol_check(cc, source, executable, ['-lm']),
63-
(1, executable + ': symbol nextup from unsupported version GLIBC_2.24(3)\n' +
64-
executable + ': failed IMPORTED_SYMBOLS'))
65-
6641
# -lutil is part of the libc6 package so a safe bet that it's installed
6742
# it's also out of context enough that it's unlikely to ever become a real dependency
6843
source = 'test2.c'

contrib/guix/libexec/build.sh

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,6 @@ case "$HOST" in
238238
*mingw*) HOST_LDFLAGS="-Wl,--no-insert-timestamp" ;;
239239
esac
240240

241-
# Using --no-tls-get-addr-optimize retains compatibility with glibc 2.18, by
242-
# avoiding a PowerPC64 optimisation available in glibc 2.22 and later.
243-
# https://sourceware.org/binutils/docs-2.35/ld/PowerPC64-ELF64.html
244-
case "$HOST" in
245-
*powerpc64*) HOST_LDFLAGS="${HOST_LDFLAGS} -Wl,--no-tls-get-addr-optimize" ;;
246-
esac
247-
248241
# Make $HOST-specific native binaries from depends available in $PATH
249242
export PATH="${BASEPREFIX}/${HOST}/native/bin:${PATH}"
250243
mkdir -p "$DISTSRC"

contrib/guix/manifest.scm

Lines changed: 14 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ chain for " target " development."))
147147
#:key
148148
(base-gcc-for-libc base-gcc)
149149
(base-kernel-headers base-linux-kernel-headers)
150-
(base-libc (make-glibc-with-bind-now (make-glibc-without-werror glibc-2.24)))
150+
(base-libc (hardened-glibc (make-glibc-without-werror glibc-2.27)))
151151
(base-gcc (make-gcc-rpath-link (hardened-gcc base-gcc))))
152152
"Convenience wrapper around MAKE-CROSS-TOOLCHAIN with default values
153153
desirable for building Bitcoin Core release binaries."
@@ -537,48 +537,30 @@ inspecting signatures in Mach-O binaries.")
537537
(define (make-glibc-without-werror glibc)
538538
(package-with-extra-configure-variable glibc "enable_werror" "no"))
539539

540-
(define (make-glibc-with-stack-protector glibc)
541-
(package-with-extra-configure-variable glibc "--enable-stack-protector" "all"))
542-
543-
(define (make-glibc-with-bind-now glibc)
544-
(package-with-extra-configure-variable glibc "--enable-bind-now" "yes"))
545-
546-
(define-public glibc-2.24
547-
(package
548-
(inherit glibc-2.31)
549-
(version "2.24")
550-
(source (origin
551-
(method git-fetch)
552-
(uri (git-reference
553-
(url "https://sourceware.org/git/glibc.git")
554-
(commit "0d7f1ed30969886c8dde62fbf7d2c79967d4bace")))
555-
(file-name (git-file-name "glibc" "0d7f1ed30969886c8dde62fbf7d2c79967d4bace"))
556-
(sha256
557-
(base32
558-
"0g5hryia5v1k0qx97qffgwzrz4lr4jw3s5kj04yllhswsxyjbic3"))
559-
(patches (search-our-patches "glibc-ldd-x86_64.patch"
560-
"glibc-versioned-locpath.patch"
561-
"glibc-2.24-elfm-loadaddr-dynamic-rewrite.patch"
562-
"glibc-2.24-no-build-time-cxx-header-run.patch"
563-
"glibc-2.24-fcommon.patch"
564-
"glibc-2.24-guix-prefix.patch"))))))
540+
;; https://www.gnu.org/software/libc/manual/html_node/Configuring-and-compiling.html
541+
(define (hardened-glibc glibc)
542+
(package-with-extra-configure-variable (
543+
package-with-extra-configure-variable glibc
544+
"--enable-stack-protector" "all")
545+
"--enable-bind-now" "yes"))
565546

566-
(define-public glibc-2.27/bitcoin-patched
547+
(define-public glibc-2.27
567548
(package
568549
(inherit glibc-2.31)
569550
(version "2.27")
570551
(source (origin
571552
(method git-fetch)
572553
(uri (git-reference
573554
(url "https://sourceware.org/git/glibc.git")
574-
(commit "23158b08a0908f381459f273a984c6fd328363cb")))
575-
(file-name (git-file-name "glibc" "23158b08a0908f381459f273a984c6fd328363cb"))
555+
(commit "73886db6218e613bd6d4edf529f11e008a6c2fa6")))
556+
(file-name (git-file-name "glibc" "73886db6218e613bd6d4edf529f11e008a6c2fa6"))
576557
(sha256
577558
(base32
578-
"1b2n1gxv9f4fd5yy68qjbnarhf8mf4vmlxk10i3328c1w5pmp0ca"))
559+
"0azpb9cvnbv25zg8019rqz48h8i2257ngyjg566dlnp74ivrs9vq"))
579560
(patches (search-our-patches "glibc-ldd-x86_64.patch"
561+
"glibc-versioned-locpath.patch"
580562
"glibc-2.27-riscv64-Use-__has_include-to-include-asm-syscalls.h.patch"
581-
"glibc-2.27-dont-redefine-nss-database.patch"
563+
"glibc-2.27-fcommon.patch"
582564
"glibc-2.27-guix-prefix.patch"))))))
583565

584566
(packages->manifest
@@ -627,12 +609,7 @@ inspecting signatures in Mach-O binaries.")
627609
(make-nsis-for-gcc-10 nsis-x86_64)
628610
osslsigncode))
629611
((string-contains target "-linux-")
630-
(list (cond ((string-contains target "riscv64-")
631-
(make-bitcoin-cross-toolchain target
632-
#:base-libc (make-glibc-with-stack-protector
633-
(make-glibc-with-bind-now (make-glibc-without-werror glibc-2.27/bitcoin-patched)))))
634-
(else
635-
(make-bitcoin-cross-toolchain target)))))
612+
(list (make-bitcoin-cross-toolchain target)))
636613
((string-contains target "darwin")
637614
(list clang-toolchain-10 binutils cmake xorriso python-signapple))
638615
(else '())))))

contrib/guix/patches/glibc-2.24-elfm-loadaddr-dynamic-rewrite.patch

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

contrib/guix/patches/glibc-2.24-guix-prefix.patch

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

0 commit comments

Comments
 (0)