Support clang 16 in docker CI (#1348)

Fixes #1175
This commit is contained in:
Alex Kremer
2024-04-15 12:09:34 +01:00
committed by GitHub
parent 1fe42c88c3
commit e931f27d3b
19 changed files with 217 additions and 79 deletions

View File

@@ -203,8 +203,8 @@ public:
size_t numWrites = 0;
backend_->cache().setFull();
auto seconds = ::util::timed<std::chrono::seconds>([this, edgeKeys = &edgeKeys, sequence, &numWrites] {
for (auto& key : *edgeKeys) {
auto seconds = ::util::timed<std::chrono::seconds>([this, keys = &edgeKeys, sequence, &numWrites] {
for (auto& key : *keys) {
LOG(log_.debug()) << "Writing edge key = " << ripple::strHex(key);
auto succ = backend_->cache().getSuccessor(*ripple::uint256::fromVoidChecked(key), sequence);
if (succ)

View File

@@ -234,9 +234,9 @@ SubscriptionSource::handleError(util::requests::RequestError const& error, boost
}
if (wsConnection_ != nullptr) {
auto const error = wsConnection_->close(yield);
if (error) {
LOG(log_.error()) << "Error closing websocket connection: " << error->message();
auto const err = wsConnection_->close(yield);
if (err) {
LOG(log_.error()) << "Error closing websocket connection: " << err->message();
}
wsConnection_.reset();
}

View File

@@ -171,7 +171,7 @@ TransactionFeed::pub(
}
}
auto const genJsonByVersion = [&, tx = tx, meta = meta](std::uint32_t version) {
auto const genJsonByVersion = [&, tx, meta](std::uint32_t version) {
boost::json::object pubObj;
auto const txKey = version < 2u ? JS(transaction) : JS(tx_json);
pubObj[txKey] = rpc::toJson(*tx);

View File

@@ -3,13 +3,16 @@ target_sources(clio PRIVATE impl/Build.cpp)
target_link_libraries(clio PUBLIC clio_etl clio_feed clio_web clio_rpc)
target_compile_features(clio PUBLIC cxx_std_20)
target_compile_features(clio PUBLIC cxx_std_23)
# Clio server
add_executable(clio_server)
target_sources(clio_server PRIVATE Main.cpp)
target_link_libraries(clio_server PRIVATE clio)
target_link_options(
clio_server PRIVATE $<$<AND:$<NOT:$<BOOL:${APPLE}>>,$<NOT:$<BOOL:${san}>>>:-static-libstdc++ -static-libgcc>
# For now let's assume that we only using libstdc++ under gcc.
#
# TODO: libc++ static linkage in https://github.com/XRPLF/clio/issues/1300
clio_server PRIVATE $<$<AND:$<BOOL:${is_gcc}>,$<NOT:$<BOOL:${san}>>>:-static-libstdc++ -static-libgcc>
)
set_target_properties(clio_server PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})

View File

@@ -36,9 +36,7 @@ target_link_libraries(
clio_options
)
if (is_gcc)
# FIXME: needed on gcc for now
#
# For some reason cmake doesn't propagate the compile definitions from clio_options so we need to add them here
target_compile_definitions(clio_util PUBLIC BOOST_ASIO_DISABLE_CONCEPTS)
endif ()
# FIXME: needed on gcc-12, clang-16 and AppleClang for now (known boost 1.82 issue for some compilers)
#
# For some reason cmake doesn't propagate the compile definitions from clio_options so we need to add them here
target_compile_definitions(clio_util PUBLIC BOOST_ASIO_DISABLE_CONCEPTS)

View File

@@ -26,6 +26,11 @@
#include <string>
#include <utility>
// for the static_assert at the bottom which fixes clang compilation:
// see: https://godbolt.org/z/fzTjMd7G1 vs https://godbolt.org/z/jhKG7deen
#include <any>
#include <expected>
namespace util::async {
/**
@@ -63,4 +68,7 @@ struct ExecutionError {
std::string message;
};
// these are not the robots you are looking for...
static_assert(std::is_copy_constructible_v<std::expected<std::any, ExecutionError>>);
} // namespace util::async