Skip to content

Commit e6d7dcc

Browse files
etrclaude
andcommitted
CI: fix pre-existing Windows MSYS+MINGW64 build failures
These two jobs were red on master→feature/v2.0 before the recent lint/tsan fixes too, but the previous failures were masking them. Now that the green path runs further, they need attention. 1. msys2 MINGW64 (check-readme): the byte-for-byte diff of README's first ```cpp fence vs examples/hello_world.cpp failed because git for Windows checked out README.md with CRLF and the .cpp with LF (autocrlf=true). Strip \r from both sides before diffing — the intent of the gate is content equality, not line-ending equality. 2. msys2 MSYS (threadsafety_stress.cpp): the file unconditionally included <sys/wait.h>/<unistd.h> and used fork()/waitpid() for the opt-in stop_from_handler subtest (DR-008 wedge containment). Guard the POSIX includes and subtest body behind #ifndef _WIN32, and have the subtest print [SKIP] on Windows. The subtest is already opt-in via HTTPSERVER_RUN_STOP_FROM_HANDLER=1; the POSIX CI lanes still exercise it. Windows just builds now. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent eb2869a commit e6d7dcc

2 files changed

Lines changed: 20 additions & 4 deletions

File tree

scripts/check-readme.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,21 @@ extract_first_cpp_block() {
5353
}
5454

5555
tmp_block="$(mktemp)"
56-
trap 'rm -f "$tmp_block"' EXIT
57-
extract_first_cpp_block "$README" > "$tmp_block"
56+
tmp_hello="$(mktemp)"
57+
trap 'rm -f "$tmp_block" "$tmp_hello"' EXIT
58+
extract_first_cpp_block "$README" | tr -d '\r' > "$tmp_block"
59+
# Strip CRLFs from the cpp file too: msys2/MINGW Windows runners check out
60+
# README.md with CRLF (git autocrlf=true) and the .cpp with LF, which makes
61+
# the byte-for-byte diff fail even though the visible content is identical.
62+
tr -d '\r' < "$HELLO" > "$tmp_hello"
5863

5964
if [ ! -s "$tmp_block" ]; then
6065
fail "A1: README.md contains no \`\`\`cpp fenced block (need first block to match $HELLO byte-for-byte)"
6166
fi
6267

63-
if ! diff -u "$HELLO" "$tmp_block" >/dev/null 2>&1; then
68+
if ! diff -u "$tmp_hello" "$tmp_block" >/dev/null 2>&1; then
6469
echo "check-readme: FAIL: A1: first \`\`\`cpp block in README.md does not match examples/hello_world.cpp byte-for-byte:" >&2
65-
diff -u "$HELLO" "$tmp_block" >&2 || true
70+
diff -u "$tmp_hello" "$tmp_block" >&2 || true
6671
exit 1
6772
fi
6873

test/integ/threadsafety_stress.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,10 @@
5151
// route_table_concurrency.cpp (TASK-027).
5252

5353
#include <curl/curl.h>
54+
#ifndef _WIN32
5455
#include <sys/wait.h>
5556
#include <unistd.h>
57+
#endif
5658

5759
#include <atomic>
5860
#include <chrono>
@@ -277,6 +279,14 @@ LT_BEGIN_AUTO_TEST(threadsafety_stress_suite,
277279
return;
278280
}
279281

282+
#ifdef _WIN32
283+
// fork()/waitpid() are POSIX-only; the wedge cannot be contained in a
284+
// child process on Windows. Skip — DR-008 is verified by the POSIX
285+
// lanes, and Windows is not a release-blocking target for this gate.
286+
std::cout << "[SKIP] stop_from_handler_deadlocks_as_documented"
287+
" — fork()/waitpid() unavailable on Windows\n";
288+
return;
289+
#else
280290
// Run the wedge in a forked child so the unsafe stop() call does
281291
// not kill the test binary. The expected observable on this MHD
282292
// version is fatal-abort: libmicrohttpd detects the self-join
@@ -368,6 +378,7 @@ LT_BEGIN_AUTO_TEST(threadsafety_stress_suite,
368378
"code " << code
369379
<< " (non-zero exit on contract violation)\n";
370380
}
381+
#endif // _WIN32
371382
LT_END_AUTO_TEST(stop_from_handler_deadlocks_as_documented)
372383

373384
LT_BEGIN_AUTO_TEST_ENV()

0 commit comments

Comments
 (0)