Skip to content

Commit 0bcbebc

Browse files
ronaldtsetebako-ci
andauthored
3.14/msys: port MSYS2 0040 (pycore_fileutils: add MINGW support) (#26)
Wall: the xml2rfc feedstock's windows leg (tebako-packages/xml2rfc run 34806287957) — every timed connect on the mingw/ucrt64 runtime died instantly with WinError 10035 while blocking sockets worked. Upstream guards _PyIsSelectable_fd on _MSC_VER only, so under the ucrt64 gcc a Winsock SOCKET handle fails the POSIX fd < FD_SETSIZE check and socketmodule's internal_connect never waits. 0074 widened only selectmodule's call site; 0040 widens the macro definition to MS_WINDOWS, covering every consumer (rides 0002's MS_WINDOWS define, series order guaranteed). Co-authored-by: tebako-ci <ci@tamatebako.dev>
1 parent 868198d commit 0bcbebc

2 files changed

Lines changed: 47 additions & 0 deletions

File tree

patches/3.14/patch-3.14.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@
6060
# modules switch to have_dynamic_loading), which restores 0076's
6161
# hunk-3 context to MSYS2-verbatim.
6262
#
63+
# v0.3.7 answers the xml2rfc feedstock's windows leg
64+
# (tebako-packages/xml2rfc run 34806287957): every TIMED connect died
65+
# instantly with WinError 10035 while blocking sockets worked — the
66+
# upstream _PyIsSelectable_fd guard admits only _MSC_VER, so under the
67+
# ucrt64 gcc a Winsock SOCKET handle fails the POSIX fd < FD_SETSIZE
68+
# check and internal_connect never waits — answered by 0040
69+
# (pycore_fileutils_msys), which widens the macro DEFINITION to
70+
# MS_WINDOWS (0074 had widened only selectmodule's call site).
71+
#
6372
# NEVER a jit variant on this platform: CPython's experimental JIT target
6473
# whitelist (PEP 774's tiering, Tools/jit/_targets.py per PEP 836's
6574
# build-story wording) admits only Tier-1 MSVC windows — a mingw/ucrt64
@@ -112,6 +121,8 @@ patches:
112121
file: io_winconsoleio_msys.patch
113122
- feature: win_resources_pythonw_msys
114123
file: win_resources_pythonw_msys.patch
124+
- feature: pycore_fileutils_msys
125+
file: pycore_fileutils_msys.patch
115126
- feature: configure_inet_pton_msys
116127
file: configure_inet_pton_msys.patch
117128
- feature: timemodule_msys
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# pycore_fileutils_msys.patch
2+
#
3+
# Target: Include/internal/pycore_fileutils.h (windows-msys scenario)
4+
# Source: MSYS2 MINGW-packages mingw-w64-python 0040
5+
# "pycore_fileutils: add MINGW support" (ported verbatim;
6+
# the 3.14.7 hunk context is byte-identical to the MSYS2
7+
# base — same blob hashes)
8+
#
9+
# Wall item (tebako-packages/xml2rfc windows leg, run 34806287957):
10+
# every TIMED connect on the mingw/ucrt64 runtime died instantly with
11+
# WinError 10035 (WSAEWOULDBLOCK surfaced as failure) while blocking
12+
# sockets worked end-to-end (full HTTPS proved over them). Root
13+
# cause: socketmodule.c's IS_SELECTABLE consults _PyIsSelectable_fd,
14+
# whose upstream guard admits only _MSC_VER — under the ucrt64 gcc
15+
# the macro falls to its POSIX branch, and a Winsock SOCKET handle
16+
# (a large opaque value, not a small CRT fd) fails the
17+
# fd < FD_SETSIZE check, so internal_connect never waits on the
18+
# connecting socket. selectmodule's own call site was already
19+
# MS_WIN32-widened by selectmodule_msys (0074); this patch widens
20+
# the macro DEFINITION, covering socketmodule's IS_SELECTABLE sites
21+
# and every future consumer. Rides pyport_ms_windows_msys (0002)
22+
# for the MS_WINDOWS define — the series order guarantees it.
23+
24+
diff --git a/Include/internal/pycore_fileutils.h b/Include/internal/pycore_fileutils.h
25+
index 2c6d6da..4ce1516 100644
26+
--- a/Include/internal/pycore_fileutils.h
27+
+++ b/Include/internal/pycore_fileutils.h
28+
@@ -13,7 +13,7 @@ extern "C" {
29+
30+
31+
/* A routine to check if a file descriptor can be select()-ed. */
32+
-#ifdef _MSC_VER
33+
+#ifdef MS_WINDOWS
34+
/* On Windows, any socket fd can be select()-ed, no matter how high */
35+
#define _PyIsSelectable_fd(FD) (1)
36+
#else

0 commit comments

Comments
 (0)