mirror of
https://github.com/ZmnSCPxj/clboss.git
synced 2026-08-13 12:33:20 +02:00
feat: add clang C++20 build job to CI
Add clang build configuration to catch C++20 compatibility issues early. Changes: - Add build-clang job to .github/workflows/build.yml - Add missing #include<cstdint> for std::uint* types (clang strict mode) - Add -lexecinfo for FreeBSD in configure.ac (backtrace_symbols) - Fix pessimizing-move warning in test_earningsrebalancer.cpp - Fix CHANGELOG.md formatting 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
d90ca280ef
commit
4057154967
17 changed files with 47 additions and 10 deletions
30
.github/workflows/build.yml
vendored
30
.github/workflows/build.yml
vendored
|
|
@ -71,3 +71,33 @@ jobs:
|
|||
with:
|
||||
name: coverage-lcov
|
||||
path: coverage.info
|
||||
|
||||
build-clang:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
- name: Install clang and build dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y \
|
||||
autoconf \
|
||||
autoconf-archive \
|
||||
automake \
|
||||
build-essential \
|
||||
clang \
|
||||
curl \
|
||||
git \
|
||||
libcurl4-openssl-dev \
|
||||
libev-dev \
|
||||
libsqlite3-dev \
|
||||
libtool \
|
||||
libunwind-dev \
|
||||
pkg-config
|
||||
- name: Configure (clang)
|
||||
run: |
|
||||
autoreconf -fi
|
||||
./configure CC=clang CXX=clang++
|
||||
- name: Build
|
||||
run: make -j2
|
||||
- name: Run unit tests
|
||||
run: make -j2 check-TESTS
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef BITCOIN_TX_HPP
|
||||
#define BITCOIN_TX_HPP
|
||||
|
||||
#include<cstdint>
|
||||
#include"Bitcoin/TxIn.hpp"
|
||||
#include"Bitcoin/TxOut.hpp"
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
#include"Boltz/Service.hpp"
|
||||
#include"Secp256k1/Random.hpp"
|
||||
#include"Sqlite3/Db.hpp"
|
||||
#include<cstdint>
|
||||
#include<functional>
|
||||
#include<memory>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef BOSS_MOD_BOLTZSWAPPER_ENV_HPP
|
||||
#define BOSS_MOD_BOLTZSWAPPER_ENV_HPP
|
||||
|
||||
#include<cstdint>
|
||||
#include"Boltz/EnvIF.hpp"
|
||||
|
||||
namespace Boss { namespace Mod { class Rpc; }}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef BOSS_MSG_PROVIDECHANNELFEEMODIFIER_HPP
|
||||
#define BOSS_MSG_PROVIDECHANNELFEEMODIFIER_HPP
|
||||
|
||||
#include<cstdint>
|
||||
#include<functional>
|
||||
|
||||
namespace Ev { template<typename a> class Io; }
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef BOSS_MSG_SENDPAYRESULT_HPP
|
||||
#define BOSS_MSG_SENDPAYRESULT_HPP
|
||||
|
||||
#include<cstdint>
|
||||
#include"Ln/NodeId.hpp"
|
||||
#include"Sha256/Hash.hpp"
|
||||
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@
|
|||
#include"Jsmn/ParserExposedBuffer.hpp"
|
||||
#include<algorithm>
|
||||
|
||||
namespace Jsmn { class Object; }
|
||||
|
||||
namespace Jsmn {
|
||||
|
||||
/* A stateful jsmn-based parser.
|
||||
|
|
|
|||
|
|
@ -8,10 +8,9 @@
|
|||
#include<string>
|
||||
#include<utility>
|
||||
#include<vector>
|
||||
#include"Jsmn/Object.hpp"
|
||||
#include"Jsmn/ParseError.hpp"
|
||||
|
||||
namespace Jsmn { class Object; }
|
||||
|
||||
namespace Jsmn {
|
||||
|
||||
/** class Jsmn::ParserExposedBuffer
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
|
||||
#include "Util/Compiler.hpp"
|
||||
#include<cstddef>
|
||||
#include<cstdint>
|
||||
#include<string>
|
||||
#include<iostream>
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#define NET_SOCKETFD_HPP
|
||||
|
||||
#include<cstddef>
|
||||
#include<cstdint>
|
||||
#include<utility>
|
||||
#include<vector>
|
||||
#include"Net/Fd.hpp"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef SHA256_FUN_HPP
|
||||
#define SHA256_FUN_HPP
|
||||
|
||||
#include<cstdint>
|
||||
#include"Sha256/Hash.hpp"
|
||||
#include"Sha256/Hasher.hpp"
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#define UTIL_BECH32_HPP
|
||||
|
||||
#include "Compiler.hpp"
|
||||
#include<cstdint>
|
||||
#include<stdexcept>
|
||||
#include<string>
|
||||
#include<vector>
|
||||
|
|
|
|||
|
|
@ -78,8 +78,9 @@ PKG_CHECK_MODULES([LIBUNWIND], [libunwind], [
|
|||
])
|
||||
|
||||
# https://github.com/ZmnSCPxj/clboss/issues/245
|
||||
# Alpine and FreeBSD need explicit -lexecinfo for backtrace_symbols
|
||||
case "$host_os" in
|
||||
*alpine*)
|
||||
*alpine*|*freebsd*)
|
||||
LDFLAGS="$LDFLAGS -lexecinfo"
|
||||
;;
|
||||
esac
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ public:
|
|||
auto js = Jsmn::Object();
|
||||
is >> js;
|
||||
return bus.raise(Boss::Msg::ListpeersResult{
|
||||
std::move(Boss::Mod::convert_legacy_listpeers(js)), false
|
||||
Boss::Mod::convert_legacy_listpeers(js), false
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,8 +96,8 @@ Ev::Io<void> listpeers_result(S::Bus& bus, std::string const& json) {
|
|||
auto js = Jsmn::Object();
|
||||
is >> js;
|
||||
|
||||
return bus.raise(ListpeersResult{std::move(
|
||||
Boss::Mod::convert_legacy_listpeers(js)), false});
|
||||
return bus.raise(ListpeersResult{
|
||||
Boss::Mod::convert_legacy_listpeers(js), false});
|
||||
}
|
||||
|
||||
Ev::Io<void> multiyield() {
|
||||
|
|
|
|||
|
|
@ -337,7 +337,7 @@ int main() {
|
|||
auto res = Jsmn::Object::parse_json(listpeers_result);
|
||||
auto peers = res["peers"];
|
||||
return bus.raise(Boss::Msg::ListpeersResult{
|
||||
std::move(Boss::Mod::convert_legacy_listpeers(peers)), true
|
||||
Boss::Mod::convert_legacy_listpeers(peers), true
|
||||
});
|
||||
}).then([&]() {
|
||||
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ int main() {
|
|||
a.swap(b);
|
||||
assert(b < a);
|
||||
a = b;
|
||||
a = a;
|
||||
{ auto& ref = a; a = ref; } // Intentional self-assignment test
|
||||
assert(a == b);
|
||||
|
||||
a = Example::left(0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue