Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
d0219e4
Update GitHub Actions to latest versions
claude Dec 21, 2025
73db718
Add curl dependency for HTTP client
claude Dec 21, 2025
9b91f7c
Remove NuGet binary caching in favor of run-vcpkg default caching
claude Dec 21, 2025
67e2568
Use official vcpkg instead of outdated fork
claude Dec 21, 2025
2a363f4
Specify vcpkg commit ID for run-vcpkg to fetch
claude Dec 21, 2025
12526f4
Use ubuntu-20.04 for Linux builds
claude Dec 21, 2025
1fb0b8d
Add default registry baseline to vcpkg-configuration.json
claude Dec 21, 2025
1a44edb
Use ubuntu-latest with modern compilers
claude Dec 21, 2025
b5fe88b
Fix compilation errors for cross-platform compatibility
claude Dec 21, 2025
25eddb5
Fix cross-platform build issues
claude Dec 21, 2025
710fb9f
Fix Windows build issues
claude Dec 21, 2025
f293b37
Fix Unix-specific I/O headers and template keyword
claude Dec 21, 2025
73f9373
Fix missing includes and template keyword
claude Dec 21, 2025
9a6a3f0
Fix missing standard library includes
claude Dec 21, 2025
04a0d24
Add missing cstdint include to codecvt.inl
claude Dec 21, 2025
aef560d
Fix cross-platform compilation issues
claude Dec 21, 2025
581be25
Fix missing semicolon after class definition in getopt.hpp
claude Dec 21, 2025
9f09e91
Add missing <utility> includes for std::move/std::forward
claude Dec 21, 2025
ba21005
Fix switch fallthrough warning in generator.hpp
claude Dec 21, 2025
c3381ea
Add missing <cstddef> includes for size_t
claude Dec 21, 2025
bc830c8
Fix Catch2 ABI mismatch and add std::byte StringMaker
claude Dec 21, 2025
51071d7
Remove redundant std::byte StringMaker
claude Dec 21, 2025
d57099d
Fix std::byte CAPTURE by converting to unsigned
claude Dec 21, 2025
1a452c9
Fix StringMaker<std::string_view> linker error in text_memstream_test
claude Dec 21, 2025
9e12a8a
Disable Windows CI and add all-checks-passed job (#17)
PazerOP Jan 11, 2026
e2883d9
Merge branch 'vibe' into claude/fix-pr-checks-7sDk2
PazerOP Jan 11, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
156 changes: 66 additions & 90 deletions .github/workflows/ccpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,75 +7,41 @@ defaults:
shell: bash

env:
VCPKG_GIT_COMMIT_ID: 3a3a222be369b556e4635714c8d6acc990e1f13b
VCPKG_GIT_URL: https://github.com/PazerOP/vcpkg.git
VCPKG_BINARY_SOURCES: 'clear;nuget,GitHub,readwrite'
X_VCPKG_NUGET_ID_PREFIX: mh-stuff
# Use a recent stable vcpkg baseline from official Microsoft repo
VCPKG_COMMIT: de46587b4beaa638743916fe5674825cecfb48b3

jobs:
build-linux:
# name: ${{ matrix.compiler }}
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
MH_STUFF_COMPILE_LIBRARY: [true, false]
# compiler: [clang++-11, clang++-10, g++-10, clang++-9, g++-9, clang++-8, g++-8, clang++-7]
compiler:
- exe: clang++-11
deps: clang-11 libc++-11-dev libc++abi-11-dev
- exe: clang++-10
deps: clang-10 libc++-10-dev libc++abi-10-dev
- exe: clang++-9
deps: clang-9 libc++-9-dev libc++abi-9-dev
- exe: clang++-8
deps: clang-8 libc++-8-dev libc++abi-8-dev
- exe: clang++-7
deps: clang-7 libc++-7-dev libc++abi-7-dev
- exe: g++-10
deps: g++-10
- exe: g++-9
deps: g++-9
- exe: g++-8
deps: g++-8
# Modern compilers available on ubuntu-latest (Ubuntu 22.04/24.04)
- exe: g++-12
deps: g++-12
- exe: g++-13
deps: g++-13
- exe: clang++-14
deps: clang-14 libc++-14-dev libc++abi-14-dev
- exe: clang++-15
deps: clang-15 libc++-15-dev libc++abi-15-dev

steps:
- uses: actions/[email protected]
- uses: PazerOP/gha-setup-nuget@HEAD
- uses: actions/checkout@v4

- uses: lukka/run-vcpkg@v7
id: runvcpkg
- uses: lukka/run-vcpkg@v11
with:
setupOnly: true
vcpkgGitCommitId: ${{ env.VCPKG_GIT_COMMIT_ID }}
vcpkgGitURL: ${{ env.VCPKG_GIT_URL }}

- name: Add repos
run: |
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 15CF4D18AF4F7421
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal main" | sudo tee /etc/apt/sources.list.d/llvm.list

- name: Add repos - llvm-11
if: matrix.compiler.exe == 'clang++-11'
run: echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-11 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list

- name: Add repos - llvm-12
if: matrix.compiler.exe == 'clang++-12'
run: echo "deb http://apt.llvm.org/focal/ llvm-toolchain-focal-12 main" | sudo tee -a /etc/apt/sources.list.d/llvm.list

- name: Update repos
run: sudo apt update
vcpkgGitCommitId: ${{ env.VCPKG_COMMIT }}

- name: Install compilers and tools
run: |
# sudo rm -rf /var/lib/apt/lists/*
# sudo apt clean
sudo apt install ${{ matrix.compiler.deps }} ninja-build -y
sudo pip3 install gcovr
sudo apt-get update
sudo apt-get install -y ${{ matrix.compiler.deps }} ninja-build
pip3 install gcovr

echo Ensuring programs work...
echo "Ensuring programs work..."
${{ matrix.compiler.exe }} --version
ninja --version
gcovr --version
Expand Down Expand Up @@ -115,57 +81,67 @@ jobs:

- name: Save test results
if: ${{ matrix.MH_STUFF_COMPILE_LIBRARY }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: gcovr_results_${{ matrix.compiler.exe }}
path: build/results*.html



build-windows:
runs-on: windows-latest
strategy:
fail-fast: false
matrix:
MH_STUFF_COMPILE_LIBRARY: [true, false]
# build-windows:
# runs-on: windows-latest
# strategy:
# fail-fast: false
# matrix:
# MH_STUFF_COMPILE_LIBRARY: [true, false]

steps:
- uses: actions/[email protected]
- uses: PazerOP/gha-setup-nuget@HEAD
# steps:
# - uses: actions/checkout@v4

- uses: lukka/run-vcpkg@v7
with:
setupOnly: true
vcpkgGitCommitId: ${{ env.VCPKG_GIT_COMMIT_ID }}
vcpkgGitURL: ${{ env.VCPKG_GIT_URL }}
# - uses: lukka/run-vcpkg@v11
# with:
# vcpkgGitCommitId: ${{ env.VCPKG_COMMIT }}

- uses: seanmiddleditch/gha-setup-ninja@v3
- name: Setup compiler paths
uses: ilammy/msvc-dev-cmd@v1.5.0
# - uses: seanmiddleditch/gha-setup-ninja@v5
# - name: Setup compiler paths
# uses: ilammy/msvc-dev-cmd@v1

- name: Build
run: |
mkdir build
cd build
# - name: Build
# run: |
# mkdir build
# cd build

cmake -G Ninja \
-DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" \
-DMH_STUFF_COMPILE_LIBRARY=${{ matrix.MH_STUFF_COMPILE_LIBRARY }} \
../
# cmake -G Ninja \
# -DCMAKE_TOOLCHAIN_FILE="$VCPKG_ROOT/scripts/buildsystems/vcpkg.cmake" \
# -DMH_STUFF_COMPILE_LIBRARY=${{ matrix.MH_STUFF_COMPILE_LIBRARY }} \
# ../

cmake --build .
# cmake --build .

- name: Run tests
run: |
cd build
ctest --output-on-failure
# - name: Run tests
# run: |
# cd build
# ctest --output-on-failure


registry-update:
needs: [build-linux, build-windows]
# registry-update:
# needs: [build-linux]
# runs-on: ubuntu-latest
# steps:
# - uses: PazerOP/vcpkg-registry-update@HEAD
# with:
# port-name: mh-stuff
# workflow-pat: ${{ secrets.WORKFLOW_PAT }}

all-checks-passed:
if: always()
needs: [build-linux]
runs-on: ubuntu-latest
steps:
- uses: PazerOP/vcpkg-registry-update@HEAD
with:
port-name: mh-stuff
workflow-pat: ${{ secrets.WORKFLOW_PAT }}
- name: Verify all checks passed
run: |
if [[ "${{ needs.build-linux.result }}" != "success" ]]; then
echo "build-linux failed: ${{ needs.build-linux.result }}"
exit 1
fi
echo "All checks passed!"
7 changes: 6 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,17 @@ include(mh-BasicInstall)
include(mh-CheckCoroutineSupport)

if (MH_STUFF_COMPILE_LIBRARY)
find_package(CURL REQUIRED)

file(GLOB_RECURSE MH_SOURCE_FILES CONFIGURE_DEPENDS
"cpp/src/*.cpp"
)
target_sources(${PROJECT_NAME} PRIVATE
${MH_SOURCE_FILES}
)

target_link_libraries(${PROJECT_NAME} PRIVATE CURL::libcurl)

target_compile_definitions(${PROJECT_NAME} ${MH_PUBLIC_OR_INTERFACE}
"MH_COMPILE_LIBRARY"
"MH_COMPILE_LIBRARY_INLINE="
Expand All @@ -64,7 +68,7 @@ if (MH_STUFF_COMPILE_LIBRARY)
target_sources(${PROJECT_NAME} PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/library.cpp")

if (MSVC)
target_compile_options(${PROJECT_NAME} PRIVATE /W3 /permissive-)
target_compile_options(${PROJECT_NAME} PRIVATE /W3 /permissive- /utf-8)
endif()

include(GenerateExportHeader)
Expand Down Expand Up @@ -117,6 +121,7 @@ if (UNIX)
endif()

if (NOT MSVC)
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-fconcepts FCONCEPTS_FLAG)
if (FCONCEPTS_FLAG)
target_compile_options(${PROJECT_NAME} ${MH_PUBLIC_OR_INTERFACE} -fconcepts)
Expand Down
1 change: 1 addition & 0 deletions cpp/include/mh/algorithm/algorithm.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <algorithm>
#include <utility>

namespace mh
{
Expand Down
1 change: 1 addition & 0 deletions cpp/include/mh/concurrency/async.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ namespace mh::detail::async_hpp

#include <thread>
#include <type_traits>
#include <utility>

namespace mh
{
Expand Down
1 change: 1 addition & 0 deletions cpp/include/mh/concurrency/dispatcher.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#ifdef MH_COROUTINES_SUPPORTED

#include <chrono>
#include <cstddef>
#include <memory>

#ifndef MH_STUFF_API
Expand Down
10 changes: 4 additions & 6 deletions cpp/include/mh/concurrency/dispatcher.inl
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
#include <mutex>
#include <queue>
#include <thread>
#include <utility>

// Platform-specific I/O monitoring
#ifdef _WIN32
#include <winsock2.h>
#include <ws2tcpip.h>
#else
// Platform-specific I/O monitoring (Unix only for now)
#ifndef _WIN32
#include <sys/select.h>
#include <unistd.h>
#include <fcntl.h>
Expand Down Expand Up @@ -161,7 +159,7 @@ namespace mh

#ifdef _WIN32
// Windows: stub implementation for now
throw mh::not_implemented_error("Implement with select() or WSAPoll()");
throw mh::not_implemented_error(MH_SOURCE_LOCATION_CURRENT());
#else
// Unix: use select()
if (!m_ReadTasks.empty() || !m_WriteTasks.empty())
Expand Down
1 change: 1 addition & 0 deletions cpp/include/mh/concurrency/locked_value.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <cassert>
#include <mutex>
#include <utility>

namespace mh
{
Expand Down
4 changes: 3 additions & 1 deletion cpp/include/mh/concurrency/mutex_debug.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ namespace mh
m_Mutex.unlock();
}

// TODO: this is optional
// native_handle is not available on MSVC's std::mutex
#if !defined(_MSC_VER)
using native_handle_type = typename TMutex::native_handle_type;
native_handle_type native_handle() { return m_Mutex.native_handle(); }
#endif

private:
void lock_acquired()
Expand Down
2 changes: 2 additions & 0 deletions cpp/include/mh/concurrency/thread_pool.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@

#include "dispatcher.hpp"

#include <cstddef>
#include <memory>
#include <optional>
#include <utility>

namespace mh
{
Expand Down
2 changes: 2 additions & 0 deletions cpp/include/mh/concurrency/thread_pool.inl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

#ifdef MH_COROUTINES_SUPPORTED

#include <utility>

namespace mh
{
namespace detail::thread_pool_hpp
Expand Down
1 change: 1 addition & 0 deletions cpp/include/mh/containers/heap.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <algorithm>
#include <utility>
#include <vector>

namespace mh
Expand Down
6 changes: 4 additions & 2 deletions cpp/include/mh/coroutine/future.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

#ifdef MH_COROUTINES_SUPPORTED

#include <utility>

namespace mh
{
template<typename T> class shared_future;
Expand Down Expand Up @@ -58,11 +60,11 @@ namespace mh

void set_value(T value)
{
this->get_promise().set_state<detail::promise<T>::IDX_VALUE>(std::move(value));
this->get_promise().template set_state<detail::promise<T>::IDX_VALUE>(std::move(value));
}
void set_exception(std::exception_ptr p)
{
this->get_promise().set_state<detail::promise<T>::IDX_EXCEPTION>(p);
this->get_promise().template set_state<detail::promise<T>::IDX_EXCEPTION>(p);
}
};

Expand Down
4 changes: 3 additions & 1 deletion cpp/include/mh/coroutine/generator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <exception>
#include <iterator>
#include <stdexcept>
#include <utility>
#include <variant>

namespace mh
Expand Down Expand Up @@ -52,7 +53,7 @@ namespace mh
// Nothing to do
}

const_reference& value() const
[[nodiscard]] const_reference& value() const
{
switch (m_State.index())
{
Expand All @@ -62,6 +63,7 @@ namespace mh
return *std::get<1>(m_State);
case 2:
std::rethrow_exception(std::get<2>(m_State));
[[fallthrough]];
default:
throw std::logic_error("invalid promise state");
}
Expand Down
3 changes: 2 additions & 1 deletion cpp/include/mh/coroutine/task.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <cassert>
#include <condition_variable>
#include <future>
#include <utility>
#include <variant>
#include <vector>

Expand Down Expand Up @@ -596,7 +597,7 @@ namespace mh
detail::promise<T>* promise = new detail::promise<T>();
task<T> retVal(promise);

promise->set_state<detail::promise<T>::IDX_VALUE>(T(std::forward<TArgs>(args)...));
promise->template set_state<detail::promise<T>::IDX_VALUE>(T(std::forward<TArgs>(args)...));

return retVal;
}
Expand Down
Loading
Loading