diff --git a/.github/scripts/conan/generate_matrix.py b/.github/scripts/conan/generate_matrix.py index ec0ce4fe..8ac9170d 100755 --- a/.github/scripts/conan/generate_matrix.py +++ b/.github/scripts/conan/generate_matrix.py @@ -4,7 +4,7 @@ import json LINUX_OS = ["heavy", "heavy-arm64"] LINUX_CONTAINERS = [ - '{ "image": "ghcr.io/xrplf/clio-ci:62369411404eb32b0140603a785ff05e1dc36ce8" }' + '{ "image": "ghcr.io/xrplf/clio-ci:77387d8f9f13aea8f23831d221ac3e7683bb69b7" }' ] LINUX_COMPILERS = ["gcc", "clang"] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f18f3bfa..b08f7976 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -49,7 +49,7 @@ jobs: build_type: [Release, Debug] container: [ - '{ "image": "ghcr.io/xrplf/clio-ci:62369411404eb32b0140603a785ff05e1dc36ce8" }', + '{ "image": "ghcr.io/xrplf/clio-ci:77387d8f9f13aea8f23831d221ac3e7683bb69b7" }', ] static: [true] @@ -79,7 +79,7 @@ jobs: uses: ./.github/workflows/reusable-build.yml with: runs_on: heavy - container: '{ "image": "ghcr.io/xrplf/clio-ci:62369411404eb32b0140603a785ff05e1dc36ce8" }' + container: '{ "image": "ghcr.io/xrplf/clio-ci:77387d8f9f13aea8f23831d221ac3e7683bb69b7" }' conan_profile: gcc build_type: Debug download_ccache: true @@ -98,7 +98,7 @@ jobs: uses: ./.github/workflows/reusable-build.yml with: runs_on: heavy - container: '{ "image": "ghcr.io/xrplf/clio-ci:62369411404eb32b0140603a785ff05e1dc36ce8" }' + container: '{ "image": "ghcr.io/xrplf/clio-ci:77387d8f9f13aea8f23831d221ac3e7683bb69b7" }' conan_profile: gcc build_type: Release download_ccache: true @@ -115,7 +115,7 @@ jobs: needs: build-and-test runs-on: heavy container: - image: ghcr.io/xrplf/clio-ci:62369411404eb32b0140603a785ff05e1dc36ce8 + image: ghcr.io/xrplf/clio-ci:77387d8f9f13aea8f23831d221ac3e7683bb69b7 steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 diff --git a/.github/workflows/check-libxrpl.yml b/.github/workflows/check-libxrpl.yml index 90c1c689..866aad1d 100644 --- a/.github/workflows/check-libxrpl.yml +++ b/.github/workflows/check-libxrpl.yml @@ -21,7 +21,7 @@ jobs: name: Build Clio / `libXRPL ${{ github.event.client_payload.version }}` runs-on: heavy container: - image: ghcr.io/xrplf/clio-ci:62369411404eb32b0140603a785ff05e1dc36ce8 + image: ghcr.io/xrplf/clio-ci:77387d8f9f13aea8f23831d221ac3e7683bb69b7 steps: - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 @@ -69,7 +69,7 @@ jobs: needs: build runs-on: heavy container: - image: ghcr.io/xrplf/clio-ci:62369411404eb32b0140603a785ff05e1dc36ce8 + image: ghcr.io/xrplf/clio-ci:77387d8f9f13aea8f23831d221ac3e7683bb69b7 steps: - uses: actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53 # v6.0.0 diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml index aa4f806c..f1e2bb65 100644 --- a/.github/workflows/clang-tidy.yml +++ b/.github/workflows/clang-tidy.yml @@ -31,7 +31,7 @@ jobs: if: github.event_name != 'push' || contains(github.event.head_commit.message, 'clang-tidy auto fixes') runs-on: heavy container: - image: ghcr.io/xrplf/clio-ci:62369411404eb32b0140603a785ff05e1dc36ce8 + image: ghcr.io/xrplf/clio-ci:77387d8f9f13aea8f23831d221ac3e7683bb69b7 permissions: contents: write diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a466c5ba..6aae320b 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -18,7 +18,7 @@ jobs: build: runs-on: ubuntu-latest container: - image: ghcr.io/xrplf/clio-ci:62369411404eb32b0140603a785ff05e1dc36ce8 + image: ghcr.io/xrplf/clio-ci:77387d8f9f13aea8f23831d221ac3e7683bb69b7 steps: - name: Checkout diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 8653aa5f..eb2af860 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -43,17 +43,17 @@ jobs: conan_profile: gcc build_type: Release static: true - container: '{ "image": "ghcr.io/xrplf/clio-ci:62369411404eb32b0140603a785ff05e1dc36ce8" }' + container: '{ "image": "ghcr.io/xrplf/clio-ci:77387d8f9f13aea8f23831d221ac3e7683bb69b7" }' - os: heavy conan_profile: gcc build_type: Debug static: true - container: '{ "image": "ghcr.io/xrplf/clio-ci:62369411404eb32b0140603a785ff05e1dc36ce8" }' + container: '{ "image": "ghcr.io/xrplf/clio-ci:77387d8f9f13aea8f23831d221ac3e7683bb69b7" }' - os: heavy conan_profile: gcc.ubsan build_type: Release static: false - container: '{ "image": "ghcr.io/xrplf/clio-ci:62369411404eb32b0140603a785ff05e1dc36ce8" }' + container: '{ "image": "ghcr.io/xrplf/clio-ci:77387d8f9f13aea8f23831d221ac3e7683bb69b7" }' uses: ./.github/workflows/reusable-build-test.yml with: @@ -77,7 +77,7 @@ jobs: include: - os: heavy conan_profile: clang - container: '{ "image": "ghcr.io/xrplf/clio-ci:62369411404eb32b0140603a785ff05e1dc36ce8" }' + container: '{ "image": "ghcr.io/xrplf/clio-ci:77387d8f9f13aea8f23831d221ac3e7683bb69b7" }' static: true - os: macos15 conan_profile: apple-clang diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 8d2365c5..509387f0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,7 @@ jobs: conan_profile: gcc build_type: Release static: true - container: '{ "image": "ghcr.io/xrplf/clio-ci:62369411404eb32b0140603a785ff05e1dc36ce8" }' + container: '{ "image": "ghcr.io/xrplf/clio-ci:77387d8f9f13aea8f23831d221ac3e7683bb69b7" }' uses: ./.github/workflows/reusable-build-test.yml with: diff --git a/.github/workflows/reusable-build.yml b/.github/workflows/reusable-build.yml index 88af4a4a..964cee4e 100644 --- a/.github/workflows/reusable-build.yml +++ b/.github/workflows/reusable-build.yml @@ -116,9 +116,8 @@ jobs: code_coverage: ${{ inputs.code_coverage }} - name: Restore ccache cache - if: ${{ inputs.download_ccache }} + if: ${{ inputs.download_ccache && github.ref != 'refs/heads/develop' }} uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 - id: restore_cache with: path: ${{ env.CCACHE_DIR }} key: ${{ steps.cache_key.outputs.key }} @@ -160,17 +159,14 @@ jobs: name: build_time_report_${{ runner.os }}_${{ inputs.build_type }}_${{ inputs.conan_profile }} path: build_time_report.txt - - name: Show ccache's statistics + - name: Show ccache's statistics and zero it if: ${{ inputs.download_ccache }} - id: ccache_stats run: | - ccache -s > /tmp/ccache.stats - miss_rate=$(cat /tmp/ccache.stats | grep 'Misses' | head -n1 | sed 's/.*(\(.*\)%).*/\1/') - echo "miss_rate=${miss_rate}" >> $GITHUB_OUTPUT - cat /tmp/ccache.stats + ccache --show-stats + ccache --zero-stats - name: Save ccache cache - if: ${{ inputs.upload_ccache && github.ref == 'refs/heads/develop' && (steps.restore_cache.outputs.cache-hit != 'true' || steps.ccache_stats.outputs.miss_rate == '100.0') }} + if: ${{ inputs.upload_ccache && github.ref == 'refs/heads/develop' }} uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 with: path: ${{ env.CCACHE_DIR }} diff --git a/.github/workflows/reusable-release.yml b/.github/workflows/reusable-release.yml index b9041e31..be0d0041 100644 --- a/.github/workflows/reusable-release.yml +++ b/.github/workflows/reusable-release.yml @@ -46,7 +46,7 @@ jobs: release: runs-on: heavy container: - image: ghcr.io/xrplf/clio-ci:62369411404eb32b0140603a785ff05e1dc36ce8 + image: ghcr.io/xrplf/clio-ci:77387d8f9f13aea8f23831d221ac3e7683bb69b7 env: GH_REPO: ${{ github.repository }} GH_TOKEN: ${{ github.token }} diff --git a/.github/workflows/sanitizers.yml b/.github/workflows/sanitizers.yml index 6878245a..48858385 100644 --- a/.github/workflows/sanitizers.yml +++ b/.github/workflows/sanitizers.yml @@ -44,14 +44,13 @@ jobs: uses: ./.github/workflows/reusable-build-test.yml with: runs_on: heavy - container: '{ "image": "ghcr.io/xrplf/clio-ci:62369411404eb32b0140603a785ff05e1dc36ce8" }' + container: '{ "image": "ghcr.io/xrplf/clio-ci:77387d8f9f13aea8f23831d221ac3e7683bb69b7" }' download_ccache: false upload_ccache: false conan_profile: ${{ matrix.compiler }}${{ matrix.sanitizer_ext }} build_type: ${{ matrix.build_type }} static: false - # Currently, both gcc.tsan and clang.tsan unit tests hang - run_unit_tests: ${{ matrix.sanitizer_ext != '.tsan' }} + run_unit_tests: true run_integration_tests: false upload_clio_server: false targets: clio_tests clio_integration_tests diff --git a/CMakeLists.txt b/CMakeLists.txt index 49047e90..eabf070b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,11 +75,6 @@ if (san) endif () target_compile_options(clio_options INTERFACE ${SAN_OPTIMIZATION_FLAG} ${SAN_FLAG} -fno-omit-frame-pointer) - if (san STREQUAL "address") - # ASAN needs these definitions as well as correct b2 flags in conan profile for sanitizers - target_compile_definitions(clio_options INTERFACE BOOST_USE_ASAN=1 BOOST_USE_UCONTEXT=1) - endif () - target_link_libraries(clio_options INTERFACE ${SAN_FLAG} ${SAN_LIB}) endif () diff --git a/docker/ci/conan/sanitizer_template.profile b/docker/ci/conan/sanitizer_template.profile index 726d8d82..0df3aa04 100644 --- a/docker/ci/conan/sanitizer_template.profile +++ b/docker/ci/conan/sanitizer_template.profile @@ -3,7 +3,11 @@ {% set sanitizer_opt_map = {"asan": "address", "tsan": "thread", "ubsan": "undefined"} %} {% set sanitizer = sanitizer_opt_map[sani] %} -{% set sanitizer_b2_flags_map = {"address": "define=BOOST_USE_ASAN=1 context-impl=ucontext address-sanitizer=on", "thread": "thread-sanitizer=on", "undefined": "undefined-sanitizer=on"} %} +{% set sanitizer_b2_flags_map = { + "address": "context-impl=ucontext address-sanitizer=norecover", + "thread": "context-impl=ucontext thread-sanitizer=norecover", + "undefined": "undefined-sanitizer=norecover" +} %} {% set sanitizer_b2_flags_str = sanitizer_b2_flags_map[sanitizer] %} {% set sanitizer_build_flags_str = "-fsanitize=" ~ sanitizer ~ " -g -O1 -fno-omit-frame-pointer" %} @@ -24,4 +28,10 @@ tools.build:cxxflags+={{ sanitizer_build_flags }} tools.build:exelinkflags+={{ sanitizer_link_flags }} tools.build:sharedlinkflags+={{ sanitizer_link_flags }} -tools.info.package_id:confs+=["tools.build:cflags", "tools.build:cxxflags", "tools.build:exelinkflags", "tools.build:sharedlinkflags"] +{% if sanitizer == "address" %} + tools.build:defines+=["BOOST_USE_ASAN", "BOOST_USE_UCONTEXT"] +{% elif sanitizer == "thread" %} + tools.build:defines+=["BOOST_USE_TSAN", "BOOST_USE_UCONTEXT"] +{% endif %} + +tools.info.package_id:confs+=["tools.build:cflags", "tools.build:cxxflags", "tools.build:exelinkflags", "tools.build:sharedlinkflags", "tools.build:defines"] diff --git a/docker/develop/compose.yaml b/docker/develop/compose.yaml index f542d9a9..3c5368b9 100644 --- a/docker/develop/compose.yaml +++ b/docker/develop/compose.yaml @@ -1,6 +1,6 @@ services: clio_develop: - image: ghcr.io/xrplf/clio-ci:62369411404eb32b0140603a785ff05e1dc36ce8 + image: ghcr.io/xrplf/clio-ci:77387d8f9f13aea8f23831d221ac3e7683bb69b7 volumes: - clio_develop_conan_data:/root/.conan2/p - clio_develop_ccache:/root/.ccache diff --git a/docs/build-clio.md b/docs/build-clio.md index 044f447f..69c0179a 100644 --- a/docs/build-clio.md +++ b/docs/build-clio.md @@ -191,7 +191,7 @@ Open the `index.html` file in your browser to see the documentation pages. It is also possible to build Clio using [Docker](https://www.docker.com/) if you don't want to install all the dependencies on your machine. ```sh -docker run -it ghcr.io/xrplf/clio-ci:62369411404eb32b0140603a785ff05e1dc36ce8 +docker run -it ghcr.io/xrplf/clio-ci:77387d8f9f13aea8f23831d221ac3e7683bb69b7 git clone https://github.com/XRPLF/clio cd clio ``` diff --git a/docs/config-description.md b/docs/config-description.md index 2828a78a..e4a3f57f 100644 --- a/docs/config-description.md +++ b/docs/config-description.md @@ -391,7 +391,7 @@ This document provides a list of all available Clio configuration properties in - **Type**: double - **Default value**: `10` - **Constraints**: The value must be a positive double number. -- **Description**: The number of milliseconds the server waits to shutdown gracefully. If Clio does not shutdown gracefully after the specified value, it will be killed instead. +- **Description**: The number of seconds the server waits to shutdown gracefully. If Clio does not shutdown gracefully after the specified value, it will be killed instead. ### cache.num_diffs diff --git a/src/data/LedgerCacheSaver.cpp b/src/data/LedgerCacheSaver.cpp index fef2f5cb..0ff23905 100644 --- a/src/data/LedgerCacheSaver.cpp +++ b/src/data/LedgerCacheSaver.cpp @@ -53,7 +53,7 @@ LedgerCacheSaver::save() success.has_value()) { LOG(util::LogService::info()) << "Successfully saved ledger cache in " << durationMs << " ms"; } else { - LOG(util::LogService::error()) << "Error saving LedgerCache to file"; + LOG(util::LogService::error()) << "Error saving LedgerCache to file: " << success.error(); } }); } diff --git a/src/util/config/ConfigDescription.hpp b/src/util/config/ConfigDescription.hpp index 3afbb821..9a9ef619 100644 --- a/src/util/config/ConfigDescription.hpp +++ b/src/util/config/ConfigDescription.hpp @@ -255,7 +255,7 @@ This document provides a list of all available Clio configuration properties in .value = "The number of worker threads or processes that are responsible for managing and processing " "subscription-based tasks from `rippled`."}, KV{.key = "graceful_period", - .value = "The number of milliseconds the server waits to shutdown gracefully. If Clio does not shutdown " + .value = "The number of seconds the server waits to shutdown gracefully. If Clio does not shutdown " "gracefully after the specified value, it will be killed instead."}, KV{.key = "cache.num_diffs", .value = "The number of cursors generated is the number of changed (without counting deleted) objects in "