What changed, and why it matters
This commit is a work-in-progress patch to the project's continuous-integration (CI) build scripts and one CMake build file. It swaps some shell equality tests from '==' to '=', changes a conditional to a case statement, switches the CI build from autotools to CMake for certain configurations, adds macOS-only compiler warning suppressions, and changes how wallet-tool binaries are linked. None of these changes are security fixes for shipped product code; they are build-system and CI maintenance changes.
No security action required. Treat as ordinary build/CI maintenance. If adopting this commit, verify that the CMake build path and the elements-wallet link change do not break release binaries or tests on supported platforms.
Security signals we found
No security-relevant code paths modified
Build-system/CI maintenance only
Compiler warning suppressions added for vendored code on macOS
Linker group expression removed for wallet tool
Evidence from the diff
The diff modifies ci/test/03_test_script.sh and src/CMakeLists.txt. In the shell script it makes POSIX-compliant test syntax changes (‘==’ to ‘=’), refactors an if/else chain into a case statement for CentOS/Rocky detection, removes the previous-release download step, removes the Android APK build path, and restructures the build to use CMake when NO_DEPENDS is set and autotools otherwise. In CMakeLists.txt it adds Apple-only compile options to suppress -Wconditional-uninitialized and -Wimplicit-fallthrough for the elementssimplicity target, and replaces a LINK_GROUP generator expression with direct target_link_libraries entries for elements-wallet. There is no change to consensus, networking, wallet cryptography, or RPC handling.
Changed components
ci/test/03_test_script.shsrc/CMakeLists.txtInspect captured patch +46 / −33
diff --git a/ci/test/03_test_script.sh b/ci/test/03_test_script.sh
index a9b8f73..8b5dc31 100755
--- a/ci/test/03_test_script.sh
+++ b/ci/test/03_test_script.sh
@@ -14,7 +14,7 @@ export TSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/t
export UBSAN_OPTIONS="suppressions=${BASE_ROOT_DIR}/test/sanitizer_suppressions/ubsan:print_stacktrace=1:halt_on_error=1:report_error_type=1"
echo "Number of available processing units: $(nproc)"
-if [ "$CI_OS_NAME" == "macos" ]; then
+if [ "$CI_OS_NAME" = "macos" ]; then
top -l 1 -s 0 | awk ' /PhysMem/ {print}'
else
free -m -h
@@ -84,23 +84,23 @@ if [ "$USE_BUSY_BOX" = "true" ]; then
fi
# Make sure default datadir does not exist and is never read by creating a dummy file
-if [ "$CI_OS_NAME" == "macos" ]; then
+if [ "$CI_OS_NAME" = "macos" ]; then
echo > "${HOME}/Library/Application Support/Elements"
else
echo > "${HOME}/.elements"
fi
if [ -z "$NO_DEPENDS" ]; then
- if [[ $CI_IMAGE_NAME_TAG == *centos* ] || [[ $CI_IMAGE_NAME_TAG == *rocky* ]]; then
- SHELL_OPTS="CONFIG_SHELL=/bin/ksh" # Temporarily use ksh instead of dash, until https://bugzilla.redhat.com/show_bug.cgi?id=2335416 is fixed.
- else
- SHELL_OPTS="CONFIG_SHELL="
- fi
+ case "${CI_IMAGE_NAME_TAG}" in
+ *centos*|*rocky*)
+ SHELL_OPTS="CONFIG_SHELL=/bin/ksh" # Temporarily use ksh instead of dash, until https://bugzilla.redhat.com/show_bug.cgi?id=2335416 is fixed.
+ ;;
+ *)
+ SHELL_OPTS="CONFIG_SHELL="
+ ;;
+ esac
bash -c "$SHELL_OPTS make $MAKEJOBS -C depends HOST=$HOST $DEP_OPTS LOG=1"
fi
-if [ "$DOWNLOAD_PREVIOUS_RELEASES" = "true" ]; then
- test/get_previous_releases.py -b -t "$PREVIOUS_RELEASES_DIR"
-fi
BITCOIN_CONFIG_ALL="-DBUILD_BENCH=ON -DBUILD_FUZZ_BINARY=ON"
if [ -z "$NO_DEPENDS" ]; then
@@ -113,23 +113,26 @@ fi
ccache --zero-stats
PRINT_CCACHE_STATISTICS="ccache --version | head -n 1 && ccache --show-stats"
-if [ -n "$ANDROID_TOOLS_URL" ]; then
- make distclean || true
- ./autogen.sh
- bash -c "./configure $BITCOIN_CONFIG_ALL $BITCOIN_CONFIG" || ( (cat config.log) && false)
- make "${MAKEJOBS}" && cd src/qt && ANDROID_HOME=${ANDROID_HOME} ANDROID_NDK_HOME=${ANDROID_NDK_HOME} make apk
- bash -c "${PRINT_CCACHE_STATISTICS}"
- exit 0
+if [ -z "$NO_DEPENDS" ]; then
+ # legacy autotools path (depends builds)
+ BITCOIN_CONFIG_ALL="${BITCOIN_CONFIG_ALL} --enable-external-signer --prefix=$BASE_OUTDIR"
+else
+ # modern CMake path (native macOS + NO_DEPENDS=1)
+ BITCOIN_CONFIG_ALL="${BITCOIN_CONFIG_ALL} -DENABLE_EXTERNAL_SIGNER=ON"
fi
-BITCOIN_CONFIG_ALL="${BITCOIN_CONFIG_ALL} --enable-external-signer --prefix=$BASE_OUTDIR"
-
-if [ -n "$CONFIG_SHELL" ]; then
- "$CONFIG_SHELL" -c "./autogen.sh"
+# === CMake build (modern path used by the fork) ===
+if [ -n "$NO_DEPENDS" ]; then
+ echo "Building with CMake (NO_DEPENDS=1)..."
+ cmake -B build -S . -G "$CMAKE_GENERATOR" $BITCOIN_CONFIG_ALL
else
+ # depends path (still uses configure in some jobs)
./autogen.sh
+ ./configure $BITCOIN_CONFIG_ALL
fi
+cmake --build build --config Release --parallel "$MAKEJOBS"
+
mkdir -p "${BASE_BUILD_DIR}"
cd "${BASE_BUILD_DIR}"
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index fb3d3ae..7e67b45 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -106,6 +106,14 @@ target_link_libraries(elementssimplicity
core_interface
)
+# macOS Apple Clang is stricter than Linux GCC on this vendored code
+if(APPLE)
+ target_compile_options(elementssimplicity PRIVATE
+ -Wno-conditional-uninitialized
+ -Wno-implicit-fallthrough
+ )
+endif()
+
# Set top-level target output locations.
if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/bin)
@@ -247,18 +255,20 @@ if(ENABLE_WALLET)
add_subdirectory(wallet)
if(BUILD_WALLET_TOOL)
- add_executable(elements-wallet
- bitcoin-wallet.cpp
- init/bitcoin-wallet.cpp
- wallet/wallettool.cpp
- )
- add_windows_resources(elements-wallet bitcoin-wallet-res.rc)
- target_link_libraries(elements-wallet
- core_interface
- "$<LINK_GROUP:RESCAN,bitcoin_node,bitcoin_wallet,bitcoin_common>"
- )
- install_binary_component(elements-wallet HAS_MANPAGE)
- endif()
+ add_executable(elements-wallet
+ bitcoin-wallet.cpp
+ init/bitcoin-wallet.cpp
+ wallet/wallettool.cpp
+ )
+ add_windows_resources(elements-wallet bitcoin-wallet-res.rc)
+ target_link_libraries(elements-wallet
+ core_interface
+ bitcoin_node
+ bitcoin_wallet
+ bitcoin_common
+ )
+ install_binary_component(elements-wallet HAS_MANPAGE)
+endif()
endif()
Why this scored 18/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.