Skip to content

Commit 95b4c2e

Browse files
committed
5.4.8.0, 2024-04-10, leisure
Added - build: add option for sanitizers #2553 (@div72) - build: CMake: Initial Windows support (MSYS2) #2733 (@CyberTailor) Changed - build: enforce SSE2 on x86 targets #2746 (@div72) - consensus: Update checkpoint data for mainnet and testnet #2756 (@jamescowens) - gui, util: Enhance verify checkpoints fail handling; use RegistryBookmarks for DB passivation #2758 (@jamescowens) Removed Fixed - build, depends: fix compilation with XCode 15 #2747 (@div72) - Fix man page installation path for cmake builds #2749 (@theMarix) - consensus, mrc, sidestake: add mrc fees to staker to rewards to be allocated via sidestaking #2753 (@jamescowens) - Fix Systemd unit install location #2754 (@theMarix) - scraper: Corrections to scraper_net after removal of cntPartsRcvd decrement and increment #2755 (@jamescowens) - rpc: fix setban segfault #2757 (@div72)
2 parents 2f4877b + 0029870 commit 95b4c2e

Some content is hidden

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

72 files changed

+1619
-481
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ jobs:
2323
script-id: native
2424
- name: x86_64 Linux [GOAL install] [GUI] [bionic] [no depends]
2525
script-id: native_old
26+
- name: x86_64 Linux [ASan] [LSan] [UBSan] [integer] [jammy] [no depends]
27+
script-id: native_asan
28+
# FIXME: depends is unable to compile Qt with clang.
29+
# - name: x86_64 Linux [TSan] [GUI] [jammy]
30+
# script-id: native_tsan
2631
- name: macOS 10.14 [GOAL deploy] [GUI] [no tests] [focal]
2732
script-id: mac
2833
env:

.github/workflows/cmake-ci.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,3 +192,87 @@ jobs:
192192
name: testlog-macos-${{matrix.tag}}
193193
path: ${{github.workspace}}/build/Testing/Temporary/LastTest.log
194194
retention-days: 7
195+
196+
test-msys2:
197+
runs-on: windows-latest
198+
defaults:
199+
run:
200+
shell: msys2 {0}
201+
env:
202+
CCACHE_DIR: ${{github.workspace}}\ccache
203+
CCACHE_MAXSIZE: 400M
204+
CCACHE_COMPILERCHECK: content
205+
strategy:
206+
matrix:
207+
tag:
208+
- minimal
209+
- no-asm
210+
- gui-full
211+
include:
212+
- tag: no-asm
213+
deps: null
214+
options: -DUSE_ASM=OFF
215+
- tag: gui-full
216+
deps: >-
217+
miniupnpc:p
218+
qrencode:p
219+
qt5-base:p
220+
qt5-tools:p
221+
options: >-
222+
-DENABLE_GUI=ON
223+
-DENABLE_QRENCODE=ON
224+
-DENABLE_UPNP=ON
225+
steps:
226+
- name: Checkout
227+
uses: actions/checkout@v3
228+
- name: Setup MSYS2
229+
uses: msys2/setup-msys2@v2
230+
with:
231+
msystem: UCRT64
232+
update: true
233+
install: >-
234+
make
235+
ninja
236+
pacboy: >-
237+
${{matrix.deps}}
238+
boost:p
239+
ccache:p
240+
cmake:p
241+
curl:p
242+
libzip:p
243+
openssl:p
244+
toolchain:p
245+
- name: Configure
246+
run: |
247+
cmake -B ./build -G Ninja \
248+
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
249+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
250+
${{matrix.options}} \
251+
-DBUILD_SHARED_LIBS=OFF -DENABLE_TESTS=ON
252+
- name: Restore cache
253+
uses: actions/cache/restore@v3
254+
if: always()
255+
with:
256+
path: ${{env.CCACHE_DIR}}
257+
key: ccache-msys2-${{matrix.tag}}-${{github.run_id}}
258+
restore-keys: |
259+
ccache-msys2-${{matrix.tag}}-
260+
- name: Build
261+
run: |
262+
cmake --build ./build -v -j $NUMBER_OF_PROCESSORS
263+
- name: Save cache
264+
uses: actions/cache/save@v3
265+
if: always()
266+
with:
267+
path: ${{env.CCACHE_DIR}}
268+
key: ccache-msys2-${{matrix.tag}}-${{github.run_id}}
269+
- name: Run tests
270+
run: |
271+
ctest --test-dir ./build -j $NUMBER_OF_PROCESSORS
272+
- name: Upload test logs
273+
uses: actions/upload-artifact@v3
274+
if: always()
275+
with:
276+
name: testlog-msys-${{matrix.tag}}
277+
path: ${{github.workspace}}\build\Testing\Temporary\LastTest.log
278+
retention-days: 7

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/)
55
and this project adheres to [Semantic Versioning](https://semver.org/).
66

7+
## [5.4.8.0], 2024-04-10, leisure
8+
9+
### Added
10+
- build: add option for sanitizers #2553 (@div72)
11+
- build: CMake: Initial Windows support (MSYS2) #2733 (@CyberTailor)
12+
13+
### Changed
14+
- build: enforce SSE2 on x86 targets #2746 (@div72)
15+
- consensus: Update checkpoint data for mainnet and testnet #2756 (@jamescowens)
16+
- gui, util: Enhance verify checkpoints fail handling; use RegistryBookmarks for DB passivation #2758 (@jamescowens)
17+
18+
### Removed
19+
20+
### Fixed
21+
- build, depends: fix compilation with XCode 15 #2747 (@div72)
22+
- Fix man page installation path for cmake builds #2749 (@theMarix)
23+
- consensus, mrc, sidestake: add mrc fees to staker to rewards to be allocated via sidestaking #2753 (@jamescowens)
24+
- Fix Systemd unit install location #2754 (@theMarix)
25+
- scraper: Corrections to scraper_net after removal of cntPartsRcvd decrement and increment #2755 (@jamescowens)
26+
- rpc: fix setban segfault #2757 (@div72)
27+
728
## [5.4.7.0], 2024-03-13, leisure
829

930
### Added

CMakeLists.txt

Lines changed: 121 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,31 @@
77
# CMake support is experimental. Use with caution and report any bugs.
88

99
cmake_minimum_required(VERSION 3.18)
10+
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/build-aux/cmake")
11+
12+
13+
# Hunter Package Manager
14+
# ======================
15+
16+
# Windows doesn't yet have a package manager that can be used for managing
17+
# dependencies, so we use Hunter on it.
18+
option(HUNTER_ENABLED "Enable Hunter package manager" OFF)
19+
include(HunterGate)
20+
HunterGate(
21+
URL "https://github.com/cpp-pm/hunter/archive/refs/tags/v0.25.3.tar.gz"
22+
SHA1 "0dfbc2cb5c4cf7e83533733bdfd2125ff96680cb"
23+
FILEPATH "${CMAKE_CURRENT_SOURCE_DIR}/build-aux/cmake/Hunter/config.cmake"
24+
)
25+
26+
27+
# Project configuration
28+
# =====================
1029

1130
project("Gridcoin"
12-
VERSION 5.4.7.0
31+
VERSION 5.4.8.0
1332
DESCRIPTION "POS-based cryptocurrency that rewards BOINC computation"
1433
HOMEPAGE_URL "https://gridcoin.us"
15-
LANGUAGES ASM C CXX
34+
LANGUAGES C CXX
1635
)
1736

1837
set(CLIENT_VERSION_IS_RELEASE "true")
@@ -24,33 +43,38 @@ set(COPYRIGHT_HOLDERS_FINAL "The Gridcoin developers")
2443
# =======================
2544

2645
set(CMAKE_CXX_STANDARD 17)
46+
set(CMAKE_CXX_STANDARD_REQUIRED ON)
2747

2848
set(CMAKE_C_VISIBILITY_PRESET hidden)
2949
set(CMAKE_CXX_VISIBILITY_PRESET hidden)
3050

31-
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded)
32-
3351
set(CMAKE_INCLUDE_CURRENT_DIR ON)
3452

35-
# Remove '-DNDEBUG' from flags because we need asserts
36-
string(REPLACE "NDEBUG" "_NDEBUG" CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")
37-
string(REPLACE "NDEBUG" "_NDEBUG" CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
38-
53+
if(MSVC)
54+
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
55+
message(FATAL_ERROR "It's not yet possible to build Gridcoin with MSVC")
56+
endif()
57+
add_compile_options(/U NDEBUG)
58+
else()
59+
add_compile_options(-UNDEBUG)
60+
endif()
3961

40-
# Load modules from the source tree
41-
# =================================
4262

43-
set(CMAKE_MODULE_PATH "${CMAKE_MODULE_PATH}" "${CMAKE_CURRENT_SOURCE_DIR}/build-aux/cmake")
63+
# Load CMake modules
64+
# ==================
4465

4566
include(CheckCXXSymbolExists)
4667
include(CheckFunctionExists)
4768
include(CheckIncludeFile)
4869
include(CheckPIESupported)
70+
include(CheckSymbolExists)
71+
4972
include(CheckSSE)
5073
include(CheckStrerrorR)
51-
include(CheckSymbolExists)
74+
include(HunterGate)
5275
include(VersionFromGit)
5376

77+
5478
# Define options
5579
# ==============
5680

@@ -60,6 +84,8 @@ option(ENABLE_GUI "Enable Qt-based GUI" OFF)
6084
option(ENABLE_DOCS "Build Doxygen documentation" OFF)
6185
option(ENABLE_TESTS "Build tests" OFF)
6286
option(LUPDATE "Update translation files" OFF)
87+
option(STATIC_LIBS "Prefer static variants of system libraries" ${WIN32})
88+
option(STATIC_RUNTIME "Link runtime statically" ${WIN32})
6389

6490
# CPU-dependent options
6591
option(ENABLE_SSE41 "Build code that uses SSE4.1 intrinsics" ${HAS_SSE41})
@@ -74,30 +100,51 @@ option(ENABLE_QRENCODE "Enable generation of QR Codes for receiving payments" O
74100
option(ENABLE_UPNP "Enable UPnP port mapping support" OFF)
75101
option(DEFAULT_UPNP "Turn UPnP on startup" OFF)
76102
option(USE_DBUS "Enable DBus support" OFF)
103+
104+
# Bundled packages
77105
option(SYSTEM_BDB "Find system installation of Berkeley DB CXX 5.3" OFF)
78106
option(SYSTEM_LEVELDB "Find system installation of leveldb" OFF)
79107
option(SYSTEM_SECP256K1 "Find system installation of libsecp256k1 with pkg-config" OFF)
80108
option(SYSTEM_UNIVALUE "Find system installation of Univalue with pkg-config" OFF)
81109
option(SYSTEM_XXD "Find system xxd binary" OFF)
82110

111+
# Hunter packages
112+
option(BUNDLED_BOOST "Use the bundled version of Boost" ${HUNTER_ENABLED})
113+
option(BUNDLED_CURL "Use the bundled version of cURL" ${HUNTER_ENABLED})
114+
option(BUNDLED_LIBZIP "Use the bundled version of libzip" ${HUNTER_ENABLED})
115+
option(BUNDLED_OPENSSL "Use the bundled version of OpenSSL" ${HUNTER_ENABLED})
116+
option(BUNDLED_QT "Use the bundled version of Qt" ${HUNTER_ENABLED})
83117

84-
# Find dependencies
85-
# =================
118+
119+
# Handle dependencies
120+
# ===================
121+
122+
set(QT5_MINIMUM_VERSION 5.9.5)
123+
set(QT5_COMPONENTS Concurrent Core Gui LinguistTools Network Widgets)
124+
set(QT5_HUNTER_COMPONENTS qtbase qttools)
125+
if(USE_DBUS)
126+
list(APPEND QT5_COMPONENTS DBus)
127+
endif()
128+
if(ENABLE_TESTS)
129+
list(APPEND QT5_COMPONENTS Test)
130+
endif()
86131

87132
set(BOOST_MINIMUM_VERSION 1.63.0)
88-
set(QT5_MINIMUM_VERSION 5.15.0)
133+
set(BOOST_COMPONENTS filesystem iostreams thread)
134+
set(BOOST_HUNTER_COMPONENTS ${BOOST_COMPONENTS})
135+
if(ENABLE_TESTS)
136+
list(APPEND BOOST_COMPONENTS unit_test_framework)
137+
list(APPEND BOOST_HUNTER_COMPONENTS test)
138+
endif()
89139

90140
find_package(Atomics REQUIRED)
91-
find_package(Boost ${BOOST_MINIMUM_VERSION} COMPONENTS filesystem iostreams thread REQUIRED)
92-
find_package(CURL COMPONENTS HTTP HTTPS SSL REQUIRED)
93-
find_package(OpenSSL REQUIRED)
94141
find_package(Threads REQUIRED)
95-
find_package(libzip REQUIRED)
96142

97143
if(SYSTEM_BDB)
98144
find_package(BerkeleyDB 5.3...<5.4 COMPONENTS CXX REQUIRED)
99145
else()
100-
find_program(MAKE_EXE NAMES gmake nmake make)
146+
find_program(SH_EXE NAMES sh bash REQUIRED)
147+
find_program(MAKE_EXE NAMES gmake nmake make REQUIRED)
101148
endif()
102149

103150
if(SYSTEM_LEVELDB)
@@ -114,35 +161,59 @@ if(SYSTEM_UNIVALUE)
114161
pkg_check_modules(UNIVALUE REQUIRED IMPORTED_TARGET libunivalue)
115162
endif()
116163

117-
if(ENABLE_GUI)
118-
find_package(Qt5 ${QT5_MINIMUM_VERSION} REQUIRED COMPONENTS
119-
Concurrent
120-
Core
121-
Gui
122-
LinguistTools
123-
Network
124-
Widgets
125-
)
126-
127-
if(USE_DBUS)
128-
find_package(Qt5 ${QT5_MINIMUM_VERSION} COMPONENTS DBus REQUIRED)
129-
endif()
164+
if(BUNDLED_BOOST)
165+
hunter_add_package(Boost COMPONENTS ${BOOST_HUNTER_COMPONENTS})
166+
endif()
167+
find_package(Boost ${BOOST_MINIMUM_VERSION} COMPONENTS ${BOOST_COMPONENTS} CONFIG REQUIRED)
168+
169+
if(BUNDLED_OPENSSL)
170+
hunter_add_package(OpenSSL)
171+
endif()
172+
find_package(OpenSSL REQUIRED)
173+
174+
if(BUNDLED_CURL)
175+
hunter_add_package(CURL)
176+
find_package(CURL CONFIG REQUIRED)
177+
else()
178+
find_package(CURL REQUIRED)
179+
endif()
180+
181+
if(BUNDLED_LIBZIP)
182+
hunter_add_package(libzip)
183+
endif()
184+
find_package(libzip CONFIG REQUIRED)
185+
186+
if(USE_ASM)
187+
enable_language(ASM)
188+
endif()
130189

131-
if(ENABLE_TESTS)
132-
find_package(Qt5 ${QT5_MINIMUM_VERSION} COMPONENTS Test REQUIRED)
190+
if(ENABLE_GUI)
191+
if(BUNDLED_QT)
192+
hunter_add_package(Qt COMPONENTS ${QT5_HUNTER_COMPONENTS})
133193
endif()
194+
find_package(Qt5 ${QT5_MINIMUM_VERSION} COMPONENTS ${QT5_COMPONENTS} REQUIRED)
134195

135196
if(ENABLE_QRENCODE)
136197
pkg_check_modules(QRENCODE REQUIRED IMPORTED_TARGET libqrencode)
137198
endif()
199+
200+
# Compatibility macros
201+
if(Qt5Core_VERSION VERSION_LESS 5.15.0)
202+
macro(qt_create_translation)
203+
qt5_create_translation(${ARGN})
204+
endmacro()
205+
206+
macro(qt_add_translation)
207+
qt5_add_translation(${ARGN})
208+
endmacro()
209+
endif()
138210
endif()
139211

140212
if(ENABLE_UPNP)
141213
pkg_check_modules(MINIUPNPC REQUIRED IMPORTED_TARGET miniupnpc>=1.9)
142214
endif()
143215

144216
if(ENABLE_TESTS)
145-
find_package(Boost ${BOOST_MINIMUM_VERSION} COMPONENTS unit_test_framework REQUIRED)
146217
enable_testing()
147218

148219
if(SYSTEM_XXD)
@@ -175,12 +246,25 @@ endif()
175246
set(CMAKE_POSITION_INDEPENDENT_CODE ${ENABLE_PIE})
176247

177248
# Set compiler flags
178-
if (APPLE)
249+
if(APPLE)
179250
add_compile_options(-Wno-error=deprecated-declarations)
180251
add_compile_options(-Wno-error=thread-safety-analysis)
181252
add_compile_options(-Wno-error=thread-safety-reference)
182253
endif()
183254

255+
if(STATIC_LIBS)
256+
set(CMAKE_LINK_SEARCH_START_STATIC ON)
257+
set(CMAKE_FIND_LIBRARY_SUFFIXES "${CMAKE_STATIC_LIBRARY_SUFFIX}")
258+
endif()
259+
260+
if(STATIC_RUNTIME)
261+
if(CMAKE_CXX_COMPILER_ID MATCHES "^(GNU|Clang)\$")
262+
list(APPEND RUNTIME_LIBS -static-libgcc -static-libstdc++)
263+
elseif(MSVC)
264+
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
265+
endif()
266+
endif()
267+
184268
# Set endianness
185269
if(CMAKE_CXX_BYTE_ORDER EQUAL BIG_ENDIAN)
186270
set(WORDS_BIGENDIAN 1)

build-aux/cmake/Hunter/config.cmake

Whitespace-only changes.

0 commit comments

Comments
 (0)