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 Mar 7, 2025
2 parents bda983c + ee68b05 commit 813c6ac
Show file tree
Hide file tree
Showing 51 changed files with 469 additions and 466 deletions.
8 changes: 7 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@
# - CMake 3.26.5, https://mirror.stream.centos.org/9-stream/AppStream/x86_64/os/Packages/
cmake_minimum_required(VERSION 3.22)

if (${CMAKE_SOURCE_DIR} STREQUAL ${CMAKE_BINARY_DIR})
if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR)
message(FATAL_ERROR "In-source builds are not allowed.")
endif()

if(POLICY CMP0171)
# `codegen` is a reserved target name.
# See: https://cmake.org/cmake/help/latest/policy/CMP0171.html
cmake_policy(SET CMP0171 NEW)
endif()

#=============================
# Project / Package metadata
#=============================
Expand Down
2 changes: 1 addition & 1 deletion ci/test/00_setup_env_native_fuzz_with_msan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export CONTAINER_NAME="ci_native_fuzz_msan"
export PACKAGES="ninja-build"
# BDB generates false-positives and will be removed in future
export DEP_OPTS="DEBUG=1 NO_BDB=1 NO_QT=1 CC=clang CXX=clang++ CFLAGS='${MSAN_FLAGS}' CXXFLAGS='${MSAN_AND_LIBCXX_FLAGS}'"
export GOAL="install"
export GOAL="all"
# Setting CMAKE_{C,CXX}_FLAGS_DEBUG flags to an empty string ensures that the flags set in MSAN_FLAGS remain unaltered.
# _FORTIFY_SOURCE is not compatible with MSAN.
export GROESTLCOIN_CONFIG="\
Expand Down
2 changes: 1 addition & 1 deletion ci/test/00_setup_env_native_fuzz_with_valgrind.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export CI_IMAGE_NAME_TAG="mirror.gcr.io/ubuntu:24.04"
export CONTAINER_NAME=ci_native_fuzz_valgrind
export PACKAGES="clang-16 llvm-16 libclang-rt-16-dev libevent-dev libboost-dev libsqlite3-dev valgrind"
export NO_DEPENDS=1
export GOAL="install"
export GOAL="all"
export GROESTLCOIN_CONFIG="\
-DBUILD_FOR_FUZZING=ON \
-DSANITIZERS=fuzzer \
Expand Down
2 changes: 1 addition & 1 deletion ci/test/01_base_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ if [ -n "$PIP_PACKAGES" ]; then
fi

if [[ ${USE_MEMORY_SANITIZER} == "true" ]]; then
${CI_RETRY_EXE} git clone --depth=1 https://github.com/llvm/llvm-project -b "llvmorg-20.1.0-rc1" /msan/llvm-project
${CI_RETRY_EXE} git clone --depth=1 https://github.com/llvm/llvm-project -b "llvmorg-20.1.0" /msan/llvm-project

cmake -G Ninja -B /msan/clang_build/ \
-DLLVM_ENABLE_PROJECTS="clang" \
Expand Down
2 changes: 2 additions & 0 deletions cmake/ccache.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ if(NOT MSVC)
else()
set(WITH_CCACHE OFF)
endif()
else()
set(WITH_CCACHE OFF)
endif()

mark_as_advanced(CCACHE_EXECUTABLE)
29 changes: 0 additions & 29 deletions cmake/module/GenerateHeaders.cmake

This file was deleted.

55 changes: 55 additions & 0 deletions cmake/module/TargetDataSources.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Copyright (c) 2023-present The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or https://opensource.org/license/mit/.

macro(set_add_custom_command_options)
set(DEPENDS_EXPLICIT_OPT "")
if(CMAKE_VERSION VERSION_GREATER_EQUAL 3.27)
set(DEPENDS_EXPLICIT_OPT DEPENDS_EXPLICIT_ONLY)
endif()
set(CODEGEN_OPT "")
if(POLICY CMP0171)
cmake_policy(GET CMP0171 _cmp0171_status)
if(_cmp0171_status STREQUAL "NEW")
set(CODEGEN_OPT CODEGEN)
endif()
unset(_cmp0171_status)
endif()
endmacro()

# Specifies JSON data files to be processed into corresponding
# header files for inclusion when building a target.
function(target_json_data_sources target)
set_add_custom_command_options()
foreach(json_file IN LISTS ARGN)
set(header ${CMAKE_CURRENT_BINARY_DIR}/${json_file}.h)
add_custom_command(
OUTPUT ${header}
COMMAND ${CMAKE_COMMAND} -DJSON_SOURCE_PATH=${CMAKE_CURRENT_SOURCE_DIR}/${json_file} -DHEADER_PATH=${header} -P ${PROJECT_SOURCE_DIR}/cmake/script/GenerateHeaderFromJson.cmake
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${json_file} ${PROJECT_SOURCE_DIR}/cmake/script/GenerateHeaderFromJson.cmake
VERBATIM
${CODEGEN_OPT}
${DEPENDS_EXPLICIT_OPT}
)
target_sources(${target} PRIVATE ${header})
endforeach()
endfunction()

# Specifies raw binary data files to be processed into corresponding
# header files for inclusion when building a target.
function(target_raw_data_sources target)
cmake_parse_arguments(PARSE_ARGV 1 _ "" "NAMESPACE" "")
set_add_custom_command_options()
foreach(raw_file IN LISTS __UNPARSED_ARGUMENTS)
set(header ${CMAKE_CURRENT_BINARY_DIR}/${raw_file}.h)
add_custom_command(
OUTPUT ${header}
COMMAND ${CMAKE_COMMAND} -DRAW_SOURCE_PATH=${CMAKE_CURRENT_SOURCE_DIR}/${raw_file} -DHEADER_PATH=${header} -DRAW_NAMESPACE=${__NAMESPACE} -P ${PROJECT_SOURCE_DIR}/cmake/script/GenerateHeaderFromRaw.cmake
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${raw_file} ${PROJECT_SOURCE_DIR}/cmake/script/GenerateHeaderFromRaw.cmake
VERBATIM
${CODEGEN_OPT}
${DEPENDS_EXPLICIT_OPT}
)
target_sources(${target} PRIVATE ${header})
endforeach()
endfunction()
2 changes: 1 addition & 1 deletion contrib/devtools/headerssync-params.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# Parameters:

# Aim for still working fine at some point in the future. [datetime]
TIME = datetime(2027, 4, 1)
TIME = datetime(2027, 10, 6)

# Expected block interval. [timedelta]
BLOCK_INTERVAL = timedelta(seconds=60)
Expand Down
24 changes: 12 additions & 12 deletions contrib/guix/guix-codesign
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ fi


################
# Unsigned tarballs SHOULD exist
# Codesigning tarballs SHOULD exist
################

# Usage: outdir_for_host HOST SUFFIX
Expand All @@ -149,13 +149,13 @@ outdir_for_host() {
}


unsigned_tarball_for_host() {
codesigning_tarball_for_host() {
case "$1" in
*mingw*)
echo "$(outdir_for_host "$1")/${DISTNAME}-win64-unsigned.tar.gz"
echo "$(outdir_for_host "$1")/${DISTNAME}-win64-codesigning.tar.gz"
;;
*darwin*)
echo "$(outdir_for_host "$1")/${DISTNAME}-${1}-unsigned.tar.gz"
echo "$(outdir_for_host "$1")/${DISTNAME}-${1}-codesigning.tar.gz"
;;
*)
exit 1
Expand All @@ -164,22 +164,22 @@ unsigned_tarball_for_host() {
}

# Accumulate a list of build directories that already exist...
hosts_unsigned_tarball_missing=""
hosts_codesigning_tarball_missing=""
for host in $HOSTS; do
if [ ! -e "$(unsigned_tarball_for_host "$host")" ]; then
hosts_unsigned_tarball_missing+=" ${host}"
if [ ! -e "$(codesigning_tarball_for_host "$host")" ]; then
hosts_codesigning_tarball_missing+=" ${host}"
fi
done

if [ -n "$hosts_unsigned_tarball_missing" ]; then
if [ -n "$hosts_codesigning_tarball_missing" ]; then
# ...so that we can print them out nicely in an error message
cat << EOF
ERR: Unsigned tarballs do not exist
ERR: Codesigning tarballs do not exist
...
EOF
for host in $hosts_unsigned_tarball_missing; do
echo " ${host} '$(unsigned_tarball_for_host "$host")'"
for host in $hosts_codesigning_tarball_missing; do
echo " ${host} '$(codesigning_tarball_for_host "$host")'"
done
exit 1
fi
Expand Down Expand Up @@ -371,7 +371,7 @@ EOF
OUTDIR="$(OUTDIR_BASE=/outdir-base && outdir_for_host "$HOST" codesigned)" \
DIST_ARCHIVE_BASE=/outdir-base/dist-archive \
DETACHED_SIGS_REPO=/detached-sigs \
UNSIGNED_TARBALL="$(OUTDIR_BASE=/outdir-base && unsigned_tarball_for_host "$HOST")" \
CODESIGNING_TARBALL="$(OUTDIR_BASE=/outdir-base && codesigning_tarball_for_host "$HOST")" \
bash -c "cd /groestlcoin && bash contrib/guix/libexec/codesign.sh"
)

Expand Down
53 changes: 28 additions & 25 deletions contrib/guix/libexec/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -281,24 +281,6 @@ mkdir -p "$DISTSRC"
;;
esac

case "$HOST" in
*darwin*)
cmake --build build --target deploy ${V:+--verbose}
mv build/dist/Groestlcoin-Core.zip "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.zip"
mkdir -p "unsigned-app-${HOST}"
cp --target-directory="unsigned-app-${HOST}" \
contrib/macdeploy/detached-sig-create.sh
mv --target-directory="unsigned-app-${HOST}" build/dist
(
cd "unsigned-app-${HOST}"
find . -print0 \
| sort --zero-terminated \
| tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \
| gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.tar.gz" \
|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.tar.gz" && exit 1 )
)
;;
esac
(
cd installed

Expand Down Expand Up @@ -327,16 +309,16 @@ mkdir -p "$DISTSRC"

cp -r "${DISTSRC}/share/rpcauth" "${DISTNAME}/share/"

# Finally, deterministically produce {non-,}debug binary tarballs ready
# Deterministically produce {non-,}debug binary tarballs ready
# for release
case "$HOST" in
*mingw*)
find "${DISTNAME}" -not -name "*.dbg" -print0 \
| xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}"
find "${DISTNAME}" -not -name "*.dbg" \
| sort \
| zip -X@ "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}.zip" \
|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}.zip" && exit 1 )
| zip -X@ "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}-unsigned.zip" \
|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST//x86_64-w64-mingw32/win64}-unsigned.zip" && exit 1 )
find "${DISTNAME}" -name "*.dbg" -print0 \
| xargs -0r touch --no-dereference --date="@${SOURCE_DATE_EPOCH}"
find "${DISTNAME}" -name "*.dbg" \
Expand All @@ -360,24 +342,45 @@ mkdir -p "$DISTSRC"
find "${DISTNAME}" -print0 \
| sort --zero-terminated \
| tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \
| gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}.tar.gz" \
|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}.tar.gz" && exit 1 )
| gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.tar.gz" \
|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.tar.gz" && exit 1 )
;;
esac
) # $DISTSRC/installed

# Finally make tarballs for codesigning
case "$HOST" in
*mingw*)
cp -rf --target-directory=. contrib/windeploy
(
cd ./windeploy
mkdir -p unsigned
cp --target-directory=unsigned/ "${OUTDIR}/${DISTNAME}-win64-setup-unsigned.exe"
cp -r --target-directory=unsigned/ "${INSTALLPATH}"
find unsigned/ -name "*.dbg" -print0 \
| xargs -0r rm
find . -print0 \
| sort --zero-terminated \
| tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \
| gzip -9n > "${OUTDIR}/${DISTNAME}-win64-codesigning.tar.gz" \
|| ( rm -f "${OUTDIR}/${DISTNAME}-win64-codesigning.tar.gz" && exit 1 )
)
;;
*darwin*)
cmake --build build --target deploy ${V:+--verbose}
mv build/dist/Groestlcoin-Core.zip "${OUTDIR}/${DISTNAME}-${HOST}-unsigned.zip"
mkdir -p "unsigned-app-${HOST}"
cp --target-directory="unsigned-app-${HOST}" \
contrib/macdeploy/detached-sig-create.sh
mv --target-directory="unsigned-app-${HOST}" build/dist
cp -r --target-directory="unsigned-app-${HOST}" "${INSTALLPATH}"
(
cd "unsigned-app-${HOST}"
find . -print0 \
| sort --zero-terminated \
| tar --create --no-recursion --mode='u+rw,go+r-w,a+X' --null --files-from=- \
| gzip -9n > "${OUTDIR}/${DISTNAME}-win64-unsigned.tar.gz" \
|| ( rm -f "${OUTDIR}/${DISTNAME}-win64-unsigned.tar.gz" && exit 1 )
| gzip -9n > "${OUTDIR}/${DISTNAME}-${HOST}-codesigning.tar.gz" \
|| ( rm -f "${OUTDIR}/${DISTNAME}-${HOST}-codesigning.tar.gz" && exit 1 )
)
;;
esac
Expand Down
Loading

0 comments on commit 813c6ac

Please sign in to comment.