From 44097ddb19139d07a905d1238fe67e53f8343d54 Mon Sep 17 00:00:00 2001 From: fanquake Date: Fri, 4 Jul 2025 14:13:04 +0100 Subject: [PATCH 1/3] cmake: enable -Werror=dev in dev-mode preset --- CMakePresets.json | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakePresets.json b/CMakePresets.json index 05b055d40bc..01d65b1e094 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -62,6 +62,7 @@ "name": "dev-mode", "displayName": "Developer mode, with all features/dependencies enabled", "binaryDir": "${sourceDir}/build_dev_mode", + "errors": {"dev": true}, "cacheVariables": { "BUILD_BENCH": "ON", "BUILD_CLI": "ON", From 7b420ca8341a68e196a4f6fbd03104dc27b166ee Mon Sep 17 00:00:00 2001 From: fanquake Date: Thu, 3 Jul 2025 13:51:42 +0100 Subject: [PATCH 2/3] guix: configure with -Werror=dev --- contrib/guix/libexec/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/guix/libexec/build.sh b/contrib/guix/libexec/build.sh index ae98eba7444..2b47e1645da 100755 --- a/contrib/guix/libexec/build.sh +++ b/contrib/guix/libexec/build.sh @@ -242,6 +242,7 @@ mkdir -p "$DISTSRC" cmake -S . -B build \ --toolchain "${BASEPREFIX}/${HOST}/toolchain.cmake" \ -DWITH_CCACHE=OFF \ + -Werror=dev \ ${CONFIGFLAGS} # Build Bitcoin Core From 8f766f39df3e312f79f461b2accc2f9c90fa6338 Mon Sep 17 00:00:00 2001 From: fanquake Date: Thu, 3 Jul 2025 11:46:19 +0100 Subject: [PATCH 3/3] ci: enable -Werror=dev Turn developer & deprecation warnings into errors. --- .github/ci-test-each-commit-exec.py | 1 + .github/workflows/ci.yml | 2 +- ci/test/03_test_script.sh | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/ci-test-each-commit-exec.py b/.github/ci-test-each-commit-exec.py index 14b84cf1f22..966841d6501 100755 --- a/.github/ci-test-each-commit-exec.py +++ b/.github/ci-test-each-commit-exec.py @@ -27,6 +27,7 @@ def main(): "cmake", "-B", "build", + "-Werror=dev", "-DCMAKE_C_COMPILER=clang", "-DCMAKE_CXX_COMPILER=clang++", "-DWERROR=ON", diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 168c5793409..5e2ed480989 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -223,7 +223,7 @@ jobs: - name: Generate build system run: | - cmake -B build --preset vs2022 -DCMAKE_TOOLCHAIN_FILE="${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" ${{ matrix.generate-options }} + cmake -B build -Werror=dev --preset vs2022 -DCMAKE_TOOLCHAIN_FILE="${VCPKG_INSTALLATION_ROOT}/scripts/buildsystems/vcpkg.cmake" ${{ matrix.generate-options }} - name: Save vcpkg binary cache uses: actions/cache/save@v4 diff --git a/ci/test/03_test_script.sh b/ci/test/03_test_script.sh index 1884b9525dd..e2e7f2f56c9 100755 --- a/ci/test/03_test_script.sh +++ b/ci/test/03_test_script.sh @@ -118,7 +118,7 @@ BASE_BUILD_DIR=${BASE_BUILD_DIR:-$BASE_SCRATCH_DIR/build-$HOST} mkdir -p "${BASE_BUILD_DIR}" cd "${BASE_BUILD_DIR}" -BITCOIN_CONFIG_ALL="$BITCOIN_CONFIG_ALL -DCMAKE_INSTALL_PREFIX=$BASE_OUTDIR" +BITCOIN_CONFIG_ALL="$BITCOIN_CONFIG_ALL -DCMAKE_INSTALL_PREFIX=$BASE_OUTDIR -Werror=dev" if [[ "${RUN_TIDY}" == "true" ]]; then BITCOIN_CONFIG_ALL="$BITCOIN_CONFIG_ALL -DCMAKE_EXPORT_COMPILE_COMMANDS=ON"