From 3231950092d82ca57ae4523865362646234f8a8e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 23 Nov 2025 11:47:54 +0000 Subject: [PATCH 01/19] Initial plan From fd602b9b75fc61256aaab39d897ef8f088ee7e1e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 23 Nov 2025 11:54:53 +0000 Subject: [PATCH 02/19] Add GitHub Actions CI workflow with clang-format, clang-tidy, and build jobs Co-authored-by: jwinarske <12262875+jwinarske@users.noreply.github.com> --- .github/workflows/ci.yml | 150 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..39451c0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,150 @@ +--- +name: CI + +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + workflow_dispatch: + +jobs: + clang-format: + name: Code Formatting Check + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Install clang-format + run: | + sudo apt-get update + sudo apt-get install -y clang-format + + - name: Run clang-format check + run: | + # Find all C++ source files and check formatting + find src -type f \( -name "*.cpp" -o -name "*.h" \ + -o -name "*.hpp" \) -print0 | \ + xargs -0 clang-format --dry-run --Werror + shell: bash + + clang-tidy: + name: Static Analysis (clang-tidy) + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + clang-tidy \ + cmake \ + ninja-build \ + libudev-dev \ + libsystemd-dev \ + pkg-config + + - name: Cache clang-tidy results + uses: actions/cache@v4 + with: + path: .clang-tidy-cache + key: >- + clang-tidy-${{ runner.os }}-${{ + hashFiles('**/*.cpp', '**/*.h', '**/*.hpp', '.clang-tidy') }} + restore-keys: | + clang-tidy-${{ runner.os }}- + + - name: Configure CMake for clang-tidy + run: | + mkdir -p build + cd build + cmake .. -GNinja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + env: + CC: clang + CXX: clang++ + + - name: Run clang-tidy + run: | + # Create cache directory if it doesn't exist + mkdir -p .clang-tidy-cache + + # Find all C++ source files and run clang-tidy + find src -type f \( -name "*.cpp" \) | while read file; do + echo "Analyzing $file..." + clang-tidy "$file" \ + -p build \ + --warnings-as-errors='*' \ + --header-filter='.*' || exit 1 + done + shell: bash + + build: + name: Build and Publish Artifacts + runs-on: ubuntu-latest + strategy: + matrix: + compiler: + - {cc: gcc, cxx: g++, name: gcc} + - {cc: clang, cxx: clang++, name: clang} + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + cmake \ + ninja-build \ + libudev-dev \ + libsystemd-dev \ + pkg-config \ + ${{ matrix.compiler.cc }} \ + ${{ matrix.compiler.cxx }} + + - name: Configure CMake + run: | + mkdir -p build + cd build + cmake .. -GNinja \ + -DCMAKE_BUILD_TYPE=Release \ + -DENABLE_LTO=ON + env: + CC: ${{ matrix.compiler.cc }} + CXX: ${{ matrix.compiler.cxx }} + + - name: Build + run: | + cd build + ninja -v + + - name: Collect executables + run: | + mkdir -p artifacts + # Find all executables in src directories + # (exclude CMake test artifacts) + find build/src -type f -executable \ + -not -name "*.so*" \ + -not -name "*.a" \ + -exec cp {} artifacts/ \; + + # List what we collected + echo "Collected artifacts:" + ls -lh artifacts/ + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: binaries-${{ matrix.compiler.name }} + path: artifacts/* + if-no-files-found: error + retention-days: 30 From 650762a1ccc7a2dd6632473e2133b5785f6a3612 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 23 Nov 2025 11:56:43 +0000 Subject: [PATCH 03/19] Address code review feedback: include .cc files and improve dependency handling Co-authored-by: jwinarske <12262875+jwinarske@users.noreply.github.com> --- .github/workflows/ci.yml | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 39451c0..fa11918 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,8 +24,8 @@ jobs: - name: Run clang-format check run: | # Find all C++ source files and check formatting - find src -type f \( -name "*.cpp" -o -name "*.h" \ - -o -name "*.hpp" \) -print0 | \ + find src -type f \( -name "*.cpp" -o -name "*.cc" \ + -o -name "*.h" -o -name "*.hpp" \) -print0 | \ xargs -0 clang-format --dry-run --Werror shell: bash @@ -55,7 +55,8 @@ jobs: path: .clang-tidy-cache key: >- clang-tidy-${{ runner.os }}-${{ - hashFiles('**/*.cpp', '**/*.h', '**/*.hpp', '.clang-tidy') }} + hashFiles('**/*.cpp', '**/*.cc', '**/*.h', '**/*.hpp', + '.clang-tidy') }} restore-keys: | clang-tidy-${{ runner.os }}- @@ -76,7 +77,8 @@ jobs: mkdir -p .clang-tidy-cache # Find all C++ source files and run clang-tidy - find src -type f \( -name "*.cpp" \) | while read file; do + find src -type f \( -name "*.cpp" -o -name "*.cc" \) | \ + while read file; do echo "Analyzing $file..." clang-tidy "$file" \ -p build \ @@ -107,9 +109,11 @@ jobs: ninja-build \ libudev-dev \ libsystemd-dev \ - pkg-config \ - ${{ matrix.compiler.cc }} \ - ${{ matrix.compiler.cxx }} + pkg-config + # Install compilers (gcc and g++ are pre-installed on ubuntu-latest) + if [ "${{ matrix.compiler.name }}" = "clang" ]; then + sudo apt-get install -y clang + fi - name: Configure CMake run: | @@ -131,8 +135,9 @@ jobs: run: | mkdir -p artifacts # Find all executables in src directories - # (exclude CMake test artifacts) + # (exclude CMake test artifacts and temporary files) find build/src -type f -executable \ + -not -path "*/CMakeFiles/*" \ -not -name "*.so*" \ -not -name "*.a" \ -exec cp {} artifacts/ \; From 85ed61322338a66e3485627422a9fc7f80290f33 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 23 Nov 2025 11:58:10 +0000 Subject: [PATCH 04/19] Add explicit GITHUB_TOKEN permissions for security best practices Co-authored-by: jwinarske <12262875+jwinarske@users.noreply.github.com> --- .github/workflows/ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fa11918..2259d65 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,10 +8,15 @@ on: branches: [main, master] workflow_dispatch: +permissions: + contents: read + jobs: clang-format: name: Code Formatting Check runs-on: ubuntu-latest + permissions: + contents: read steps: - name: Checkout code uses: actions/checkout@v4 @@ -32,6 +37,8 @@ jobs: clang-tidy: name: Static Analysis (clang-tidy) runs-on: ubuntu-latest + permissions: + contents: read steps: - name: Checkout code uses: actions/checkout@v4 @@ -90,6 +97,8 @@ jobs: build: name: Build and Publish Artifacts runs-on: ubuntu-latest + permissions: + contents: read strategy: matrix: compiler: From 9e147bf9719de80477b3b26ff14c605c0fb30081 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 23 Nov 2025 12:04:06 +0000 Subject: [PATCH 05/19] Update build CI to use GCC-14 and LLVM-19 with C++23 support and libc++ Co-authored-by: jwinarske <12262875+jwinarske@users.noreply.github.com> --- .github/workflows/ci.yml | 42 ++++++++++++++++++++++++++++++++-------- 1 file changed, 34 insertions(+), 8 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2259d65..6a7771b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -102,8 +102,8 @@ jobs: strategy: matrix: compiler: - - {cc: gcc, cxx: g++, name: gcc} - - {cc: clang, cxx: clang++, name: clang} + - {cc: gcc-14, cxx: g++-14, name: gcc-14, stdlib: libstdc++} + - {cc: clang-19, cxx: clang++-19, name: llvm-19, stdlib: libc++} steps: - name: Checkout code uses: actions/checkout@v4 @@ -119,18 +119,44 @@ jobs: libudev-dev \ libsystemd-dev \ pkg-config - # Install compilers (gcc and g++ are pre-installed on ubuntu-latest) - if [ "${{ matrix.compiler.name }}" = "clang" ]; then - sudo apt-get install -y clang + + - name: Install compiler toolchain + run: | + if [ "${{ matrix.compiler.name }}" = "gcc-14" ]; then + sudo apt-get install -y gcc-14 g++-14 + elif [ "${{ matrix.compiler.name }}" = "llvm-19" ]; then + # Install LLVM 19 with libc++ + wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | \ + sudo apt-key add - + sudo add-apt-repository -y \ + 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main' + sudo apt-get update + sudo apt-get install -y \ + clang-19 \ + libc++-19-dev \ + libc++abi-19-dev fi - name: Configure CMake run: | mkdir -p build cd build - cmake .. -GNinja \ - -DCMAKE_BUILD_TYPE=Release \ - -DENABLE_LTO=ON + # Configure with C++23 support + if [ "${{ matrix.compiler.stdlib }}" = "libc++" ]; then + # For LLVM with libc++ + cmake .. -GNinja \ + -DCMAKE_BUILD_TYPE=Release \ + -DENABLE_LTO=ON \ + -DCMAKE_CXX_STANDARD=23 \ + -DCMAKE_CXX_FLAGS="-stdlib=libc++" \ + -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" + else + # For GCC with libstdc++ + cmake .. -GNinja \ + -DCMAKE_BUILD_TYPE=Release \ + -DENABLE_LTO=ON \ + -DCMAKE_CXX_STANDARD=23 + fi env: CC: ${{ matrix.compiler.cc }} CXX: ${{ matrix.compiler.cxx }} From d19bf14bd1becae8a1ed014d667106181e6f7b69 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 23 Nov 2025 12:05:37 +0000 Subject: [PATCH 06/19] Replace deprecated apt-key with modern gpg key management Co-authored-by: jwinarske <12262875+jwinarske@users.noreply.github.com> --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6a7771b..4b9a246 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -126,8 +126,8 @@ jobs: sudo apt-get install -y gcc-14 g++-14 elif [ "${{ matrix.compiler.name }}" = "llvm-19" ]; then # Install LLVM 19 with libc++ - wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | \ - sudo apt-key add - + wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | \ + sudo tee /etc/apt/trusted.gpg.d/llvm.asc sudo add-apt-repository -y \ 'deb http://apt.llvm.org/noble/ llvm-toolchain-noble-19 main' sudo apt-get update From a45ddd400329b03c004c35dc7acb1f7d023cd1be Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 23 Nov 2025 12:16:30 +0000 Subject: [PATCH 07/19] Fix clang-format errors and add llvm-config for LLVM-19 builds Co-authored-by: jwinarske <12262875+jwinarske@users.noreply.github.com> --- .github/workflows/ci.yml | 5 +- .../ModemManager1/ModemManager1_proxy.h | 103 +++++++++--------- 2 files changed, 55 insertions(+), 53 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4b9a246..8f9ac54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -133,6 +133,8 @@ jobs: sudo apt-get update sudo apt-get install -y \ clang-19 \ + llvm-19 \ + llvm-19-dev \ libc++-19-dev \ libc++abi-19-dev fi @@ -149,7 +151,8 @@ jobs: -DENABLE_LTO=ON \ -DCMAKE_CXX_STANDARD=23 \ -DCMAKE_CXX_FLAGS="-stdlib=libc++" \ - -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" + -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" \ + -DLLVM_CONFIG=/usr/bin/llvm-config-19 else # For GCC with libstdc++ cmake .. -GNinja \ diff --git a/src/proxy/org/freedesktop/ModemManager1/ModemManager1_proxy.h b/src/proxy/org/freedesktop/ModemManager1/ModemManager1_proxy.h index 96b4ca2..d0f2857 100644 --- a/src/proxy/org/freedesktop/ModemManager1/ModemManager1_proxy.h +++ b/src/proxy/org/freedesktop/ModemManager1/ModemManager1_proxy.h @@ -13,59 +13,58 @@ namespace org { namespace freedesktop { -class ModemManager1_proxy -{ -public: - static constexpr const char* INTERFACE_NAME = "org.freedesktop.ModemManager1"; - -protected: - ModemManager1_proxy(sdbus::IProxy& proxy) - : m_proxy(proxy) - { - } - - ModemManager1_proxy(const ModemManager1_proxy&) = delete; - ModemManager1_proxy& operator=(const ModemManager1_proxy&) = delete; - ModemManager1_proxy(ModemManager1_proxy&&) = delete; - ModemManager1_proxy& operator=(ModemManager1_proxy&&) = delete; - - ~ModemManager1_proxy() = default; - - void registerProxy() - { - } - -public: - void ScanDevices() - { - m_proxy.callMethod("ScanDevices").onInterface(INTERFACE_NAME); - } - - void SetLogging(const std::string& level) - { - m_proxy.callMethod("SetLogging").onInterface(INTERFACE_NAME).withArguments(level); - } - - void ReportKernelEvent(const std::map& properties) - { - m_proxy.callMethod("ReportKernelEvent").onInterface(INTERFACE_NAME).withArguments(properties); - } - - void InhibitDevice(const std::string& uid, const bool& inhibit) - { - m_proxy.callMethod("InhibitDevice").onInterface(INTERFACE_NAME).withArguments(uid, inhibit); - } - -public: - std::string Version() - { - return m_proxy.getProperty("Version").onInterface(INTERFACE_NAME).get(); - } - -private: - sdbus::IProxy& m_proxy; +class ModemManager1_proxy { + public: + static constexpr const char* INTERFACE_NAME = "org.freedesktop.ModemManager1"; + + protected: + ModemManager1_proxy(sdbus::IProxy& proxy) : m_proxy(proxy) {} + + ModemManager1_proxy(const ModemManager1_proxy&) = delete; + ModemManager1_proxy& operator=(const ModemManager1_proxy&) = delete; + ModemManager1_proxy(ModemManager1_proxy&&) = delete; + ModemManager1_proxy& operator=(ModemManager1_proxy&&) = delete; + + ~ModemManager1_proxy() = default; + + void registerProxy() {} + + public: + void ScanDevices() { + m_proxy.callMethod("ScanDevices").onInterface(INTERFACE_NAME); + } + + void SetLogging(const std::string& level) { + m_proxy.callMethod("SetLogging") + .onInterface(INTERFACE_NAME) + .withArguments(level); + } + + void ReportKernelEvent( + const std::map& properties) { + m_proxy.callMethod("ReportKernelEvent") + .onInterface(INTERFACE_NAME) + .withArguments(properties); + } + + void InhibitDevice(const std::string& uid, const bool& inhibit) { + m_proxy.callMethod("InhibitDevice") + .onInterface(INTERFACE_NAME) + .withArguments(uid, inhibit); + } + + public: + std::string Version() { + return m_proxy.getProperty("Version") + .onInterface(INTERFACE_NAME) + .get(); + } + + private: + sdbus::IProxy& m_proxy; }; -}} // namespaces +} // namespace freedesktop +} // namespace org #endif From 5725665dd192479394106a3901c7f95a4fd9899a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 23 Nov 2025 12:20:57 +0000 Subject: [PATCH 08/19] Add CodeQL security analysis job to CI workflow Co-authored-by: jwinarske <12262875+jwinarske@users.noreply.github.com> --- .github/workflows/ci.yml | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f9ac54..9c13438 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,6 +12,54 @@ permissions: contents: read jobs: + codeql: + name: CodeQL Security Analysis + runs-on: ubuntu-latest + permissions: + security-events: write + contents: read + actions: read + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: cpp + queries: security-and-quality + + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y \ + cmake \ + ninja-build \ + libudev-dev \ + libsystemd-dev \ + pkg-config \ + gcc-14 \ + g++-14 + + - name: Build for CodeQL + run: | + mkdir -p build + cd build + cmake .. -GNinja \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_CXX_STANDARD=23 + ninja + env: + CC: gcc-14 + CXX: g++-14 + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:cpp" + clang-format: name: Code Formatting Check runs-on: ubuntu-latest From f85ac0f7f8cc81f59ed320ede7ba43c7d9d2142f Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 23 Nov 2025 12:27:47 +0000 Subject: [PATCH 09/19] Merge main branch and fix clang-format errors in utils files Co-authored-by: jwinarske <12262875+jwinarske@users.noreply.github.com> --- src/utils/utils.cc | 14 ++++++-------- src/utils/utils.h | 3 +-- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/utils/utils.cc b/src/utils/utils.cc index 04cf3da..c523e8e 100644 --- a/src/utils/utils.cc +++ b/src/utils/utils.cc @@ -476,10 +476,9 @@ std::string Utils::scalarToString(const glz::generic& val) { double d = val.get(); // Check if the number is an integer to preserve precision // Only convert to int64 if it's within a safe range - constexpr double kMaxSafeInt64 = 9007199254740992.0; // 2^53 - constexpr double kMinSafeInt64 = -9007199254740992.0; // -2^53 - if (d >= kMinSafeInt64 && d <= kMaxSafeInt64 && - d == std::floor(d)) { + constexpr double kMaxSafeInt64 = 9007199254740992.0; // 2^53 + constexpr double kMinSafeInt64 = -9007199254740992.0; // -2^53 + if (d >= kMinSafeInt64 && d <= kMaxSafeInt64 && d == std::floor(d)) { return std::to_string(static_cast(d)); } return std::to_string(d); @@ -490,8 +489,7 @@ std::string Utils::scalarToString(const glz::generic& val) { } // NOLINTNEXTLINE(clang-tidy) -std::string Utils::elementToLines(const glz::generic& el, - const int indent) { +std::string Utils::elementToLines(const glz::generic& el, const int indent) { std::string out; const std::string pad(indent * 2, ' '); @@ -532,12 +530,12 @@ std::string Utils::parseDescriptionJson(const std::string& json) { if (json.empty()) { return ""; } - + glz::generic doc; auto ec = glz::read_json(doc, json); if (ec) { return std::string("json_error: ") + glz::format_error(ec, json); } - + return elementToLines(doc, 0); } diff --git a/src/utils/utils.h b/src/utils/utils.h index 36049f2..32cb831 100644 --- a/src/utils/utils.h +++ b/src/utils/utils.h @@ -48,8 +48,7 @@ class Utils { static std::string scalarToString(const glz::generic& val); - static std::string elementToLines(const glz::generic& el, - int indent = 0); + static std::string elementToLines(const glz::generic& el, int indent = 0); static std::string parseDescriptionJson(const std::string& json); From dac414c1d56f05080850316807c393916adbd7d8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 23 Nov 2025 12:36:12 +0000 Subject: [PATCH 10/19] Fix clang-tidy CI job by adding LLVM package for llvm-config Co-authored-by: jwinarske <12262875+jwinarske@users.noreply.github.com> --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9c13438..22ab6c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,6 +98,8 @@ jobs: sudo apt-get update sudo apt-get install -y \ clang-tidy \ + clang \ + llvm \ cmake \ ninja-build \ libudev-dev \ From a3934dbaff6c1ff4566b82a0e7fc9d0aebe2af83 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 23 Nov 2025 12:40:11 +0000 Subject: [PATCH 11/19] Fix LLVM-19 build by adding lld-19 linker package Co-authored-by: jwinarske <12262875+jwinarske@users.noreply.github.com> --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 22ab6c0..595267b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -185,6 +185,7 @@ jobs: clang-19 \ llvm-19 \ llvm-19-dev \ + lld-19 \ libc++-19-dev \ libc++abi-19-dev fi From 11877f0aa5379ec45215592f03c6b30f146d1925 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 23 Nov 2025 12:44:26 +0000 Subject: [PATCH 12/19] Change spdlog to INTERFACE library with custom configuration Co-authored-by: jwinarske <12262875+jwinarske@users.noreply.github.com> --- third_party/CMakeLists.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index 86ec9de..3a3c889 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -15,12 +15,12 @@ install(TARGETS toolchain EXPORT sdbus-c++-targets) # # spdlog # -add_subdirectory(spdlog) -set(SPDLOG_INSTALL OFF CACHE BOOL "Do not install spdlog" FORCE) -if (ENABLE_LTO AND IPO_SUPPORT_RESULT) - set_property(TARGET spdlog PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) -endif () -target_link_libraries(spdlog PUBLIC toolchain::toolchain) +set(SPDLOG_NO_EXCEPTIONS ON) +set(SPDLOG_NO_THREAD_ID ON) +set(SPDLOG_BUILD_PIC ON) +set(SPDLOG_SANITIZE_ADDRESS ${SANITIZE_ADDRESS}) +add_library(spdlog INTERFACE) +target_compile_options(spdlog INTERFACE -isystem${CMAKE_CURRENT_SOURCE_DIR}/spdlog/include) # # glaze From b941c077e14673eab214350d2c673d72142b6a5d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 23 Nov 2025 12:49:25 +0000 Subject: [PATCH 13/19] Add spdlog::spdlog alias to fix target linking errors Co-authored-by: jwinarske <12262875+jwinarske@users.noreply.github.com> --- third_party/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/third_party/CMakeLists.txt b/third_party/CMakeLists.txt index 3a3c889..a5e357d 100644 --- a/third_party/CMakeLists.txt +++ b/third_party/CMakeLists.txt @@ -20,6 +20,7 @@ set(SPDLOG_NO_THREAD_ID ON) set(SPDLOG_BUILD_PIC ON) set(SPDLOG_SANITIZE_ADDRESS ${SANITIZE_ADDRESS}) add_library(spdlog INTERFACE) +add_library(spdlog::spdlog ALIAS spdlog) target_compile_options(spdlog INTERFACE -isystem${CMAKE_CURRENT_SOURCE_DIR}/spdlog/include) # From 806503bd2282cf407e0557ddcaf9d273354ead69 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 23 Nov 2025 13:02:21 +0000 Subject: [PATCH 14/19] Exclude third_party headers from clang-tidy analysis Co-authored-by: jwinarske <12262875+jwinarske@users.noreply.github.com> --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 595267b..a839e7a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -134,13 +134,14 @@ jobs: mkdir -p .clang-tidy-cache # Find all C++ source files and run clang-tidy + # Exclude third_party directory from analysis find src -type f \( -name "*.cpp" -o -name "*.cc" \) | \ while read file; do echo "Analyzing $file..." clang-tidy "$file" \ -p build \ --warnings-as-errors='*' \ - --header-filter='.*' || exit 1 + --header-filter='^(?!.*third_party).*$' || exit 1 done shell: bash From a5ef8af357a5595cccd1838ef5b85dcae09135ea Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 23 Nov 2025 13:07:33 +0000 Subject: [PATCH 15/19] Disable C++ modules in clang-tidy to fix analysis errors Co-authored-by: jwinarske <12262875+jwinarske@users.noreply.github.com> --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a839e7a..d625138 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -123,7 +123,8 @@ jobs: cd build cmake .. -GNinja \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ + -DCMAKE_CXX_FLAGS="-fno-modules" env: CC: clang CXX: clang++ From acd9f690f53e466a245176a3d50a2d6dc2440f72 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 23 Nov 2025 13:13:09 +0000 Subject: [PATCH 16/19] Use C++20 standard for clang-tidy to avoid C++23 module issues Co-authored-by: jwinarske <12262875+jwinarske@users.noreply.github.com> --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d625138..9fb1445 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,7 +124,7 @@ jobs: cmake .. -GNinja \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ - -DCMAKE_CXX_FLAGS="-fno-modules" + -DCMAKE_CXX_STANDARD=20 env: CC: clang CXX: clang++ From a3ea6606215237ec9568baaec9c420f223e294c7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 23 Nov 2025 13:21:14 +0000 Subject: [PATCH 17/19] Use GCC-14 for clang-tidy to fix include path issues Co-authored-by: jwinarske <12262875+jwinarske@users.noreply.github.com> --- .github/workflows/ci.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9fb1445..b394bec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -98,8 +98,8 @@ jobs: sudo apt-get update sudo apt-get install -y \ clang-tidy \ - clang \ - llvm \ + gcc-14 \ + g++-14 \ cmake \ ninja-build \ libudev-dev \ @@ -126,8 +126,8 @@ jobs: -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ -DCMAKE_CXX_STANDARD=20 env: - CC: clang - CXX: clang++ + CC: gcc-14 + CXX: g++-14 - name: Run clang-tidy run: | From 258ffeb2e2b77d12f3142a24375878d8f7244571 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 23 Nov 2025 13:29:40 +0000 Subject: [PATCH 18/19] Add --system-headers=false to completely exclude third_party from clang-tidy Co-authored-by: jwinarske <12262875+jwinarske@users.noreply.github.com> --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b394bec..f6adb6c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -142,7 +142,8 @@ jobs: clang-tidy "$file" \ -p build \ --warnings-as-errors='*' \ - --header-filter='^(?!.*third_party).*$' || exit 1 + --header-filter='^(?!.*third_party).*$' \ + --system-headers=false || exit 1 done shell: bash From 64aae629e3d36af5b3e3bd3b09d71df9ea7faeba Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 23 Nov 2025 13:39:29 +0000 Subject: [PATCH 19/19] Remove CMAKE_CXX_STANDARD overrides from CI jobs Co-authored-by: jwinarske <12262875+jwinarske@users.noreply.github.com> --- .github/workflows/ci.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f6adb6c..1424127 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -48,8 +48,7 @@ jobs: mkdir -p build cd build cmake .. -GNinja \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_CXX_STANDARD=23 + -DCMAKE_BUILD_TYPE=Release ninja env: CC: gcc-14 @@ -123,8 +122,7 @@ jobs: cd build cmake .. -GNinja \ -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_EXPORT_COMPILE_COMMANDS=ON \ - -DCMAKE_CXX_STANDARD=20 + -DCMAKE_EXPORT_COMPILE_COMMANDS=ON env: CC: gcc-14 CXX: g++-14 @@ -203,7 +201,6 @@ jobs: cmake .. -GNinja \ -DCMAKE_BUILD_TYPE=Release \ -DENABLE_LTO=ON \ - -DCMAKE_CXX_STANDARD=23 \ -DCMAKE_CXX_FLAGS="-stdlib=libc++" \ -DCMAKE_EXE_LINKER_FLAGS="-stdlib=libc++ -lc++abi" \ -DLLVM_CONFIG=/usr/bin/llvm-config-19 @@ -211,8 +208,7 @@ jobs: # For GCC with libstdc++ cmake .. -GNinja \ -DCMAKE_BUILD_TYPE=Release \ - -DENABLE_LTO=ON \ - -DCMAKE_CXX_STANDARD=23 + -DENABLE_LTO=ON fi env: CC: ${{ matrix.compiler.cc }}