Skip to content

Fix CI build failures on macOS, Clang, and Windows#1

Merged
retretx merged 7 commits into
masterfrom
cursor/fix-ci-pipeline-errors-79e2
May 23, 2026
Merged

Fix CI build failures on macOS, Clang, and Windows#1
retretx merged 7 commits into
masterfrom
cursor/fix-ci-pipeline-errors-79e2

Conversation

@retretx

@retretx retretx commented May 22, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes failing GitHub Actions CI jobs on macOS and Windows (Linux Clang/GCC already green).

Root causes

  1. macOS: CMake passed -include=/path/to/header as one argument; Apple Clang treats it as #include "=/path/..." and fails to find the file.
  2. Windows: unix_echo_coro_tests.cpp and unix_server_coro_shutdown_tests.cpp included <unistd.h> outside the POSIX #if guard.

Changes

  • Split polyfill force-include into -include + path (MSVC: /FI…).
  • Include netlib/detail/move_only_function.hpp from scheduler.hpp and reactor_backend.hpp as a fallback.
  • Move <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

  • Local Linux build + unit tests (GCC/Clang)
  • macOS/Windows fixes validated against CI log signatures
Open in Web Open in Cursor 

- 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>
Comment thread cmake/netlib_target.cmake Outdated
Comment thread include/netlib/detail/move_only_function.hpp
cursoragent and others added 5 commits May 22, 2026 14:41
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>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ 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.

Comment thread include/netlib/execution/detail/task_promise.hpp
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>
@retretx retretx marked this pull request as ready for review May 23, 2026 20:39
@retretx retretx merged commit fa4751d into master May 23, 2026
4 of 5 checks passed
@retretx retretx deleted the cursor/fix-ci-pipeline-errors-79e2 branch May 23, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants