Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
gruve-p committed Dec 5, 2024
2 parents 6ca04be + 6a1e613 commit e1e3472
Show file tree
Hide file tree
Showing 132 changed files with 2,013 additions and 1,150 deletions.
2 changes: 1 addition & 1 deletion .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ global_task_template: &GLOBAL_TASK_TEMPLATE
<< : *MAIN_TEMPLATE

task:
name: 'Win64, no unit tests, no gui tests, no functional tests'
name: 'Win64-cross'
<< : *GLOBAL_TASK_TEMPLATE
container:
docker_arguments:
Expand Down
23 changes: 16 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,24 @@ env:

jobs:
macos-native-arm64:
name: 'macOS 14 native, arm64, no depends, sqlite only, gui'
name: ${{ matrix.job-name }}
# Use latest image, but hardcode version to avoid silent upgrades (and breaks).
# See: https://github.com/actions/runner-images#available-images.
runs-on: macos-14

timeout-minutes: 120

strategy:
fail-fast: false
matrix:
job-type: [standard]
include:
- job-type: standard
file-env: './ci/test/00_setup_env_mac_native.sh'
job-name: 'macOS 14 native, arm64, no depends, sqlite only, gui'

env:
DANGER_RUN_CI_ON_HOST: 1
FILE_ENV: './ci/test/00_setup_env_mac_native.sh'
BASE_ROOT_DIR: ${{ github.workspace }}

steps:
Expand All @@ -50,8 +58,7 @@ jobs:
run: |
# A workaround for "The `brew link` step did not complete successfully" error.
brew install --quiet python@3 || brew link --overwrite python@3
# Update to install pkgconf, once the GHA image has been updated.
brew install --quiet coreutils ninja gnu-getopt ccache boost libevent zeromq qt@5 qrencode
brew install --quiet coreutils ninja pkgconf gnu-getopt ccache boost libevent zeromq qt@5 qrencode
- name: Set Ccache directory
run: echo "CCACHE_DIR=${RUNNER_TEMP}/ccache_dir" >> "$GITHUB_ENV"
Expand All @@ -61,19 +68,21 @@ jobs:
uses: actions/cache/restore@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ github.job }}-ccache-${{ github.run_id }}
restore-keys: ${{ github.job }}-ccache-
key: ${{ github.job }}-${{ matrix.job-type }}-ccache-${{ github.run_id }}
restore-keys: ${{ github.job }}-${{ matrix.job-type }}-ccache-

- name: CI script
run: ./ci/test_run_all.sh
env:
FILE_ENV: ${{ matrix.file-env }}

- name: Save Ccache cache
uses: actions/cache/save@v4
if: github.event_name != 'pull_request' && steps.ccache-cache.outputs.cache-hit != 'true'
with:
path: ${{ env.CCACHE_DIR }}
# https://github.com/actions/cache/blob/main/tips-and-workarounds.md#update-a-cache
key: ${{ github.job }}-ccache-${{ github.run_id }}
key: ${{ github.job }}-${{ matrix.job-type }}-ccache-${{ github.run_id }}

asan-lsan-ubsan-integer-no-depends-usdt:
name: 'ASan + LSan + UBSan + integer, no depends, USDT'
Expand Down
25 changes: 17 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,8 @@ if(WIN32)
]=]

target_compile_definitions(core_interface INTERFACE
_WIN32_WINNT=0x0601
_WIN32_IE=0x0501
_WIN32_WINNT=0x0A00
_WIN32_IE=0x0A00
WIN32_LEAN_AND_MEAN
NOMINMAX
)
Expand Down Expand Up @@ -292,9 +292,11 @@ if(WIN32)
# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=54412.
try_append_cxx_flags("-Wa,-muse-unaligned-vector-move" TARGET core_interface SKIP_LINK)
try_append_linker_flag("-static" TARGET core_interface)
# We require Windows 7 (NT 6.1) or later.
# We support Windows 10+, however it's not possible to set these values accordingly,
# due to a bug in mingw-w64. See https://sourceforge.net/p/mingw-w64/bugs/968/.
# As a best effort, target Windows 8.
try_append_linker_flag("-Wl,--major-subsystem-version,6" TARGET core_interface)
try_append_linker_flag("-Wl,--minor-subsystem-version,1" TARGET core_interface)
try_append_linker_flag("-Wl,--minor-subsystem-version,2" TARGET core_interface)
endif()
endif()

Expand Down Expand Up @@ -436,8 +438,16 @@ configure_file(contrib/filter-lcov.py filter-lcov.py USE_SOURCE_PERMISSIONS COPY
# Don't allow extended (non-ASCII) symbols in identifiers. This is easier for code review.
try_append_cxx_flags("-fno-extended-identifiers" TARGET core_interface SKIP_LINK)

try_append_cxx_flags("-ffile-prefix-map=A=B" TARGET core_interface SKIP_LINK
IF_CHECK_PASSED "-ffile-prefix-map=${PROJECT_SOURCE_DIR}/src=."
# Avoiding the `-ffile-prefix-map` compiler option because it implies
# `-fcoverage-prefix-map` on Clang or `-fprofile-prefix-map` on GCC,
# which can cause issues with coverage builds, particularly when using
# Clang in the OSS-Fuzz environment due to its use of other options
# and a third party script, or with GCC.
try_append_cxx_flags("-fdebug-prefix-map=A=B" TARGET core_interface SKIP_LINK
IF_CHECK_PASSED "-fdebug-prefix-map=${PROJECT_SOURCE_DIR}/src=."
)
try_append_cxx_flags("-fmacro-prefix-map=A=B" TARGET core_interface SKIP_LINK
IF_CHECK_PASSED "-fmacro-prefix-map=${PROJECT_SOURCE_DIR}/src=."
)

# Currently all versions of gcc are subject to a class of bugs, see the
Expand Down Expand Up @@ -478,8 +488,7 @@ if(ENABLE_HARDENING)
try_append_cxx_flags("-fcf-protection=full" TARGET hardening_interface)

if(MINGW)
# stack-clash-protection doesn't compile with GCC 10 and earlier.
# In any case, it is a no-op for Windows.
# stack-clash-protection is a no-op for Windows.
# See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90458 for more details.
else()
try_append_cxx_flags("-fstack-clash-protection" TARGET hardening_interface)
Expand Down
2 changes: 1 addition & 1 deletion ci/lint/04_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ curl -sL "https://github.com/koalaman/shellcheck/releases/download/${SHELLCHECK_
tar --xz -xf - --directory /tmp/
mv "/tmp/shellcheck-${SHELLCHECK_VERSION}/shellcheck" /usr/bin/

MLC_VERSION=v0.18.0
MLC_VERSION=v0.19.0
MLC_BIN=mlc-x86_64-linux
curl -sL "https://github.com/becheran/mlc/releases/download/${MLC_VERSION}/${MLC_BIN}" -o "/usr/bin/mlc"
chmod +x /usr/bin/mlc
Expand Down
16 changes: 16 additions & 0 deletions ci/test/00_setup_env_mac_native_fuzz.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
#
# Copyright (c) The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.

export LC_ALL=C.UTF-8

export CMAKE_GENERATOR="Ninja"
export BITCOIN_CONFIG="-DBUILD_FOR_FUZZING=ON"
export CI_OS_NAME="macos"
export NO_DEPENDS=1
export OSX_SDK=""
export RUN_UNIT_TESTS=false
export RUN_FUNCTIONAL_TESTS=false
export RUN_FUZZ_TESTS=true
4 changes: 4 additions & 0 deletions ci/test/00_setup_env_win64.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ export CI_IMAGE_NAME_TAG="docker.io/amd64/debian:bookworm" # Check that https:/
export HOST=x86_64-w64-mingw32
export DPKG_ADD_ARCH="i386"
export PACKAGES="nsis g++-mingw-w64-x86-64-posix wine-binfmt wine64 wine32 file"
# Install wine, but do not run unit tests, as they surface frequent
# false-positives.
export RUN_UNIT_TESTS=${RUN_UNIT_TESTS:-false}
export RUN_FUNCTIONAL_TESTS=false
export GOAL="deploy"
# Prior to 11.0.0, the mingw-w64 headers were missing noreturn attributes, causing warnings when
# cross-compiling for Windows. https://sourceforge.net/p/mingw-w64/bugs/306/
Expand Down
25 changes: 23 additions & 2 deletions contrib/devtools/gen-manpages.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import subprocess
import sys
import tempfile
import argparse

BINARIES = [
'src/groestlcoind',
Expand All @@ -16,6 +17,18 @@
'src/qt/groestlcoin-qt',
]

parser = argparse.ArgumentParser(
formatter_class=argparse.RawDescriptionHelpFormatter,
)
parser.add_argument(
"-s",
"--skip-missing-binaries",
action="store_true",
default=False,
help="skip generation for binaries that are not found in the build path",
)
args = parser.parse_args()

# Paths to external utilities.
git = os.getenv('GIT', 'git')
help2man = os.getenv('HELP2MAN', 'help2man')
Expand All @@ -38,8 +51,12 @@
try:
r = subprocess.run([abspath, "--version"], stdout=subprocess.PIPE, check=True, text=True)
except IOError:
print(f'{abspath} not found or not an executable', file=sys.stderr)
sys.exit(1)
if(args.skip_missing_binaries):
print(f'{abspath} not found or not an executable. Skipping...', file=sys.stderr)
continue
else:
print(f'{abspath} not found or not an executable', file=sys.stderr)
sys.exit(1)
# take first line (which must contain version)
verstr = r.stdout.splitlines()[0]
# last word of line is the actual version e.g. v22.99.0-5c6b3d5b3508
Expand All @@ -51,6 +68,10 @@

versions.append((abspath, verstr, copyright))

if not versions:
print(f'No binaries found in {builddir}. Please ensure the binaries are present in {builddir}, or set another build path using the BUILDDIR env variable.')
sys.exit(1)

if any(verstr.endswith('-dirty') for (_, verstr, _) in versions):
print("WARNING: Binaries were built from a dirty tree.")
print('man pages generated from dirty binaries should NOT be committed.')
Expand Down
2 changes: 1 addition & 1 deletion contrib/devtools/symbol-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ def check_PE_libraries(binary) -> bool:
def check_PE_subsystem_version(binary) -> bool:
major: int = binary.optional_header.major_subsystem_version
minor: int = binary.optional_header.minor_subsystem_version
if major == 6 and minor == 1:
if major == 6 and minor == 2:
return True
return False

Expand Down
4 changes: 2 additions & 2 deletions contrib/devtools/test-symbol-check.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def test_PE(self):
}
''')

self.assertEqual(call_symbol_check(cxx, source, executable, ['-lpdh', '-Wl,--major-subsystem-version', '-Wl,6', '-Wl,--minor-subsystem-version', '-Wl,1']),
self.assertEqual(call_symbol_check(cxx, source, executable, ['-lpdh', '-Wl,--major-subsystem-version', '-Wl,6', '-Wl,--minor-subsystem-version', '-Wl,2']),
(1, 'pdh.dll is not in ALLOWED_LIBRARIES!\n' +
executable + ': failed DYNAMIC_LIBRARIES'))

Expand Down Expand Up @@ -166,7 +166,7 @@ def test_PE(self):
}
''')

self.assertEqual(call_symbol_check(cxx, source, executable, ['-lole32', '-Wl,--major-subsystem-version', '-Wl,6', '-Wl,--minor-subsystem-version', '-Wl,1']),
self.assertEqual(call_symbol_check(cxx, source, executable, ['-lole32', '-Wl,--major-subsystem-version', '-Wl,6', '-Wl,--minor-subsystem-version', '-Wl,2']),
(0, ''))


Expand Down
4 changes: 2 additions & 2 deletions contrib/guix/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ section](#choosing-your-security-model) before proceeding to perform a build.

In order to perform a build for macOS (which is included in the default set of
platform triples to build), you'll need to extract the macOS SDK tarball using
tools found in the [`macdeploy` directory](../macdeploy/README.md).
tools found in the [`macdeploy` directory](../macdeploy/README.md#sdk-extraction).

You can then either point to the SDK using the `SDK_PATH` environment variable:

Expand Down Expand Up @@ -68,7 +68,7 @@ following from the top of a clean repository:

The `guix-codesign` command attaches codesignatures (produced by codesigners) to
existing non-codesigned outputs. Please see the [release process
documentation](/doc/release-process.md) for more context.
documentation](/doc/release-process.md#codesigning) for more context.

It respects many of the same environment variable flags as `guix-build`, with 2
crucial differences:
Expand Down
36 changes: 33 additions & 3 deletions contrib/guix/manifest.scm
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@
((gnu packages linux) #:select (linux-libre-headers-6.1))
(gnu packages llvm)
(gnu packages mingw)
(gnu packages moreutils)
(gnu packages pkg-config)
((gnu packages python) #:select (python-minimal))
((gnu packages python-build) #:select (python-tomli))
((gnu packages python-crypto) #:select (python-asn1crypto))
((gnu packages tls) #:select (openssl))
((gnu packages version-control) #:select (git-minimal))
(guix build-system cmake)
(guix build-system gnu)
(guix build-system python)
(guix build-system trivial)
(guix download)
(guix gexp)
(guix git-download)
((guix licenses) #:prefix license:)
(guix packages)
((guix utils) #:select (substitute-keyword-arguments)))
((guix utils) #:select (cc-for-target substitute-keyword-arguments)))

(define-syntax-rule (search-our-patches file-name ...)
"Return the list of absolute file names corresponding to each
Expand Down Expand Up @@ -487,6 +487,36 @@ inspecting signatures in Mach-O binaries.")
(("^install-others =.*$")
(string-append "install-others = " out "/etc/rpc\n")))))))))))))

;; The sponge tool from moreutils.
(define-public sponge
(package
(name "sponge")
(version "0.69")
(source (origin
(method url-fetch)
(uri (string-append
"https://git.joeyh.name/index.cgi/moreutils.git/snapshot/
moreutils-" version ".tar.gz"))
(file-name (string-append "moreutils-" version ".tar.gz"))
(sha256
(base32
"1l859qnzccslvxlh5ghn863bkq2vgmqgnik6jr21b9kc6ljmsy8g"))))
(build-system gnu-build-system)
(arguments
(list #:phases
#~(modify-phases %standard-phases
(delete 'configure)
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(let ((bin (string-append (assoc-ref outputs "out") "/bin")))
(install-file "sponge" bin)))))
#:make-flags
#~(list "sponge" (string-append "CC=" #$(cc-for-target)))))
(home-page "https://joeyh.name/code/moreutils/")
(synopsis "Miscellaneous general-purpose command-line tools")
(description "Just sponge")
(license license:gpl2+)))

(packages->manifest
(append
(list ;; The Basics
Expand All @@ -502,7 +532,7 @@ inspecting signatures in Mach-O binaries.")
patch
gawk
sed
moreutils
sponge
;; Compression and archiving
tar
gzip
Expand Down
4 changes: 2 additions & 2 deletions depends/hosts/mingw32.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ mingw32_debug_CXXFLAGS=$(mingw32_debug_CFLAGS)
mingw32_debug_CPPFLAGS=-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC

mingw32_cmake_system_name=Windows
# Windows 7 (NT 6.1).
mingw32_cmake_system_version=6.1
# Windows 10
mingw32_cmake_system_version=10.0
4 changes: 2 additions & 2 deletions depends/packages/libevent.mk
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ $(package)_patches=cmake_fixups.patch
$(package)_build_subdir=build

# When building for Windows, we set _WIN32_WINNT to target the same Windows
# version as we do in configure. Due to quirks in libevents build system, this
# version as we do in releases. Due to quirks in libevents build system, this
# is also required to enable support for ipv6. See #19375.
define $(package)_set_vars
$(package)_config_opts=-DEVENT__DISABLE_BENCHMARK=ON -DEVENT__DISABLE_OPENSSL=ON
$(package)_config_opts+=-DEVENT__DISABLE_SAMPLES=ON -DEVENT__DISABLE_REGRESS=ON
$(package)_config_opts+=-DEVENT__DISABLE_TESTS=ON -DEVENT__LIBRARY_TYPE=STATIC
$(package)_cppflags += -D_GNU_SOURCE
$(package)_cppflags_mingw32=-D_WIN32_WINNT=0x0601
$(package)_cppflags_mingw32=-D_WIN32_WINNT=0x0A00

ifeq ($(NO_HARDEN),)
$(package)_cppflags+=-D_FORTIFY_SOURCE=3
Expand Down
2 changes: 1 addition & 1 deletion depends/packages/zeromq.mk
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ define $(package)_set_vars
$(package)_config_opts += -DBUILD_SHARED=OFF -DBUILD_TESTS=OFF -DZMQ_BUILD_TESTS=OFF
$(package)_config_opts += -DENABLE_DRAFTS=OFF -DZMQ_BUILD_TESTS=OFF
$(package)_cxxflags += -ffile-prefix-map=$($(package)_extract_dir)=/usr
$(package)_config_opts_mingw32 += -DZMQ_WIN32_WINNT=0x0601 -DZMQ_HAVE_IPC=OFF
$(package)_config_opts_mingw32 += -DZMQ_WIN32_WINNT=0x0A00 -DZMQ_HAVE_IPC=OFF
endef

define $(package)_preprocess_cmds
Expand Down
9 changes: 9 additions & 0 deletions depends/toolchain.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,21 @@ set(DEPENDS_COMPILE_DEFINITIONS_DEBUG @CPPFLAGS_DEBUG@)
if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_INIT)
set(CMAKE_EXE_LINKER_FLAGS_INIT "@LDFLAGS@")
endif()
if(NOT DEFINED CMAKE_SHARED_LINKER_FLAGS_INIT)
set(CMAKE_SHARED_LINKER_FLAGS_INIT "@LDFLAGS@")
endif()
if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT)
set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO_INIT "@LDFLAGS_RELEASE@")
endif()
if(NOT DEFINED CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT)
set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO_INIT "@LDFLAGS_RELEASE@")
endif()
if(NOT DEFINED CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT)
set(CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT "@LDFLAGS_DEBUG@")
endif()
if(NOT DEFINED CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT)
set(CMAKE_SHARED_LINKER_FLAGS_DEBUG_INIT "@LDFLAGS_DEBUG@")
endif()

set(CMAKE_AR "@AR@")
set(CMAKE_RANLIB "@RANLIB@")
Expand Down
3 changes: 3 additions & 0 deletions doc/descriptors.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ Supporting RPCs are:
- `listdescriptors` outputs descriptors imported into a descriptor wallet (since v22).
- `scanblocks` takes as input descriptors to scan for in blocks and returns the
relevant blockhashes (since v25).
- `getdescriptoractivity` takes as input descriptors and blockhashes (as output
by `scanblocks`) and returns rich event data related to spends or receives associated
with the given descriptors.

This document describes the language. For the specifics on usage, see the RPC
documentation for the functions mentioned above.
Expand Down
Loading

0 comments on commit e1e3472

Please sign in to comment.