diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 6714369155f..8fbff2d23df 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -20,6 +20,8 @@ runs: ${{ inputs.generator && format('-G "{0}"', inputs.generator) || '' }} \ -DCMAKE_TOOLCHAIN_FILE:FILEPATH=build/generators/conan_toolchain.cmake \ -DCMAKE_BUILD_TYPE=${{ inputs.configuration }} \ + -Dassert=TRUE \ + -Dwerr=TRUE \ -Dtests=TRUE \ -Dxrpld=TRUE \ ${{ inputs.cmake-args }} \ diff --git a/.github/workflows/nix.yml b/.github/workflows/nix.yml index 95cb84264ea..4ea058d7dc3 100644 --- a/.github/workflows/nix.yml +++ b/.github/workflows/nix.yml @@ -68,6 +68,8 @@ jobs: - name: check environment run: | echo ${PATH} | tr ':' '\n' + lsb_release -a || true + ${{ matrix.profile.cc }} --version conan --version cmake --version env | sort diff --git a/cmake/RippledCore.cmake b/cmake/RippledCore.cmake index c37971befdb..fc0576872a5 100644 --- a/cmake/RippledCore.cmake +++ b/cmake/RippledCore.cmake @@ -9,6 +9,7 @@ include(target_protobuf_sources) # define a bunch of `static const` variables with the same names, # so we just build them as a separate library. add_library(xrpl.libpb) +set_target_properties(xrpl.libpb PROPERTIES UNITY_BUILD OFF) target_protobuf_sources(xrpl.libpb xrpl/proto LANGUAGE cpp IMPORT_DIRS include/xrpl/proto @@ -49,7 +50,9 @@ target_link_libraries(xrpl.libpb # TODO: Clean up the number of library targets later. add_library(xrpl.imports.main INTERFACE) -target_link_libraries(xrpl.imports.main INTERFACE + +target_link_libraries(xrpl.imports.main + INTERFACE LibArchive::LibArchive OpenSSL::Crypto Ripple::boost @@ -59,7 +62,9 @@ target_link_libraries(xrpl.imports.main INTERFACE date::date ed25519::ed25519 secp256k1::secp256k1 + xrpl.libpb xxHash::xxhash + $<$:antithesis-sdk-cpp> ) include(add_module) @@ -100,9 +105,6 @@ target_link_libraries(xrpl.libxrpl.server PUBLIC xrpl.libxrpl.protocol) add_library(xrpl.libxrpl) set_target_properties(xrpl.libxrpl PROPERTIES OUTPUT_NAME xrpl) -if(unity) - set_target_properties(xrpl.libxrpl PROPERTIES UNITY_BUILD ON) -endif() add_library(xrpl::libxrpl ALIAS xrpl.libxrpl) @@ -130,39 +132,8 @@ target_link_modules(xrpl PUBLIC # $ # $) -target_compile_definitions(xrpl.libxrpl - PUBLIC - BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT - BOOST_CONTAINER_FWD_BAD_DEQUE - HAS_UNCAUGHT_EXCEPTIONS=1) - -target_compile_options(xrpl.libxrpl - PUBLIC - $<$:-Wno-maybe-uninitialized> - $<$:-DENABLE_VOIDSTAR> -) - -target_link_libraries(xrpl.libxrpl - PUBLIC - LibArchive::LibArchive - OpenSSL::Crypto - Ripple::boost - Ripple::opts - Ripple::syslibs - absl::random_random - date::date - ed25519::ed25519 - secp256k1::secp256k1 - xrpl.libpb - xxHash::xxhash - $<$:antithesis-sdk-cpp> -) - if(xrpld) add_executable(rippled) - if(unity) - set_target_properties(rippled PROPERTIES UNITY_BUILD ON) - endif() if(tests) target_compile_definitions(rippled PUBLIC ENABLE_TESTS) endif() diff --git a/cmake/RippledInterface.cmake b/cmake/RippledInterface.cmake index 56d36a528ff..85e27172712 100644 --- a/cmake/RippledInterface.cmake +++ b/cmake/RippledInterface.cmake @@ -7,6 +7,9 @@ add_library (Ripple::opts ALIAS opts) target_compile_definitions (opts INTERFACE BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS + BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT + BOOST_CONTAINER_FWD_BAD_DEQUE + HAS_UNCAUGHT_EXCEPTIONS=1 $<$: BOOST_ASIO_NO_DEPRECATED BOOST_FILESYSTEM_NO_DEPRECATED @@ -18,10 +21,12 @@ target_compile_definitions (opts > $<$:BEAST_NO_UNIT_TEST_INLINE=1> $<$:BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES=1> - $<$:RIPPLE_SINGLE_IO_SERVICE_THREAD=1>) + $<$:RIPPLE_SINGLE_IO_SERVICE_THREAD=1> + $<$:ENABLE_VOIDSTAR>) target_compile_options (opts INTERFACE $<$,$>:-Wsuggest-override> + $<$:-Wno-maybe-uninitialized> $<$:-fno-omit-frame-pointer> $<$,$>:-g --coverage -fprofile-abs-path> $<$,$>:-g --coverage> diff --git a/cmake/RippledSettings.cmake b/cmake/RippledSettings.cmake index 3eeebed428c..58877e1885b 100644 --- a/cmake/RippledSettings.cmake +++ b/cmake/RippledSettings.cmake @@ -17,6 +17,7 @@ if(unity) if(NOT is_ci) set(CMAKE_UNITY_BUILD_BATCH_SIZE 15 CACHE STRING "") endif() + set(CMAKE_UNITY_BUILD ON CACHE BOOL "Do a unity build") endif() if(is_clang AND is_linux) option(voidstar "Enable Antithesis instrumentation." OFF) diff --git a/src/xrpld/app/paths/detail/DirectStep.cpp b/src/xrpld/app/paths/detail/DirectStep.cpp index 95e64b337bc..ffd500009e7 100644 --- a/src/xrpld/app/paths/detail/DirectStep.cpp +++ b/src/xrpld/app/paths/detail/DirectStep.cpp @@ -336,7 +336,7 @@ DirectIPaymentStep::quality(ReadView const& sb, QualityDirection qDir) const if (!sle) return QUALITY_ONE; - auto const& field = [this, qDir]() -> SF_UINT32 const& { + auto const& field = [&, this]() -> SF_UINT32 const& { if (qDir == QualityDirection::in) { // compute dst quality in