Fix CI build failures on macOS, Clang, and Windows#1
Merged
Conversation
- Add std::move_only_function polyfill for libc++ without C++23 support - Add value_type to task<void> for Clang when_all overload resolution - Fix SOCKET/int casts on MSVC using static_cast - Avoid Windows min/max macro collision in fake_socket_backend Co-authored-by: Nikita <retretx@gmail.com>
CMake enables -include for the polyfill only when the compile probe fails, but the header skipped the polyfill whenever __cpp_lib_move_only_function was defined. On toolchains that advertise the feature macro without a working std::move_only_function (e.g. libc++ on Apple Clang), consumers got an empty force-included header. Define NETLIB_POLYFILL_MOVE_ONLY_FUNCTION on the netlib target when the probe fails and honor it in the polyfill guard so -include always injects the implementation. Co-authored-by: Nikita <retretx@gmail.com>
When the move_only_function probe fails, export separate BUILD_INTERFACE and INSTALL_INTERFACE compile options so installed netlibTargets.cmake does not embed the builder source tree path. INSTALL_INTERFACE uses SHELL:-include with a path relative to the installed include directory. Co-authored-by: Nikita <retretx@gmail.com>
- Pass -include and header path as separate compiler arguments (macOS Clang treated -include=/path as a filename starting with '='). - Use /FI on MSVC for the move_only_function polyfill. - Include polyfill header from scheduler and reactor_backend as fallback. - Guard unistd.h in unix integration tests with POSIX platform checks. Co-authored-by: Nikita <retretx@gmail.com>
macOS: Remove generator-expression -include flags (Makefiles passed literal '$<1:-include' to clang). Polyfill is included via headers. Windows: Close anonymous namespace before #else in udp_loopback_tests (MSVC saw orphan '}' when POSIX block was disabled). Wire move_only_function.hpp into all public socket/medium/simple headers. Co-authored-by: Nikita <retretx@gmail.com>
macOS runners exceed tight parallel timing bounds (~100ms vs 80ms limit). Increase upper bounds for when_all/delay tests and drain when_any losers before pool.shutdown(). Ignore execution_error when scheduling continuation after thread_pool shutdown (detached when_any losers). Add thread_pool::is_stopped(). Co-authored-by: Nikita <retretx@gmail.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 7dcebc7. Configure here.
When schedule throws execution_error on a stopped executor, synchronously resume the parent continuation so co_await chains do not hang during shutdown. Add a regression test with a stopped executor stub. Co-authored-by: Nikita <retretx@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Fixes failing GitHub Actions CI jobs on macOS and Windows (Linux Clang/GCC already green).
Root causes
-include=/path/to/headeras one argument; Apple Clang treats it as#include "=/path/..."and fails to find the file.unix_echo_coro_tests.cppandunix_server_coro_shutdown_tests.cppincluded<unistd.h>outside the POSIX#ifguard.Changes
-include+ path (MSVC:/FI…).netlib/detail/move_only_function.hppfromscheduler.hppandreactor_backend.hppas a fallback.<unistd.h>inside__linux__ || __APPLE__guards in unix integration tests.Prior fixes (same PR)
task<void>::value_type, Windows SOCKET casts,(std::min)macro workaround, move_only_function polyfill.Testing