Repository navigation
Pick the WinIO test option in the cabal file, not in configure - #628
Conversation
|
@Mistuke Gentle ping. |
ah sorry was on a work trip, looking now. |
|
Yeah this is fine, The only way I can think of for doing it automatically is to put the ghc-options buildinfo chunk targetting the library. Since that gets propagated into the test. but that would enable it for users by default too when the compiler supports it. to avoid that we cold add a cabal flag What do you think? |
|
Thanks for looking, and no worries. I tried putting
Rather than adding a flag, I added On Windows 11 with GHC 9.12.4.20260713 the suite passes both ways, 82 examples, 0 failures. |
c0fd615 to
6f5e277
Compare
configure.ac probed for __IO_MANAGER_WINIO__ >= 2 and, when it found it,
appended a test-suite stanza to network.buildinfo. Neither half worked.
The probe sat behind `case "$host_os" in mingw*)`, but cabal runs
configure under an MSYS shell on Windows, where config.guess resolves the
host to *-pc-msys. The case never matched, so even on Windows config.log
said
checking whether to use native Windows I/O manager RTS option... no, not Windows
and under plain cabal the option was never added: the test suite has run
under MIO, in CI as much as locally. Where the host does resolve to
mingw32, as with Stack (haskell#633), the probe runs, compiling with the ghc on
PATH rather than the compiler cabal was given.
Once the probe succeeds, the second half shows. A .buildinfo carries
a HookedBuildInfo, which Cabal accepts for the library and for named
executables but not for a test-suite, so once the probe started
succeeding the Windows build failed with
network.buildinfo:3:1: invalid subsection "test-suite"
Drop the machinery and say it in the cabal file, where the test-suite can
be addressed directly. The compiler versions are spelled out rather than
probed: the overlapped I/O exception fix landed on the 9.12 and 9.14
branches in April 2026, after 9.12.4 and 9.14.1 had been released. The
lower bounds are exclusive so that release candidates and snapshots of
those branches are covered as well.
--with-compiler is still accepted, unused, so that cabal passing it does
not draw an unrecognized-option warning.
Verified on Windows 11 with 9.12.4.20260713: the option now reaches the
link line, is embedded in the test binary, and the suite passes five runs
out of five with WinIO as the default.
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
So that +RTS --io-manager=posix can bring MIO back at run time. Co-Authored-By: Claude Opus 5.5 <[email protected]>
6f5e277 to
4b9cb9c
Compare
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The
-with-rtsopts=--io-manager=nativethat #613 added for the test suite isnever applied under plain cabal, and where the probe does run it breaks the
build instead. There are two separate bugs, one behind the other.
1. The probe does not run under plain cabal
configure.acguards it with:but cabal runs
configureunder an MSYS shell on Windows, whereuname -sreports
MSYS_NT-10.0-26200andconfig.guessresolves the host tox86_64-pc-msys. From aconfig.logof a Windows build on master:So under plain cabal the option was never added, and the test suite has run
under MIO, in CI as much as locally.
Where the host does resolve to
mingw32, as with Stack (#633) or with--configure-option=--host=x86_64-w64-mingw32, the probe runs. It thencompiles with
$HC, which is theghconPATHrather than the compilercabal was given, and with a compiler defining
__IO_MANAGER_WINIO__ >= 2first on
PATHit succeeds and hits the next problem.2. The mechanism cannot work either
Once the probe runs and succeeds, the next problem appears.
configureappendsto
network.buildinfo, but a.buildinfocarries aHookedBuildInfo, whichCabal accepts for the library and for named executables — not for a test-suite.
With the probe succeeding, the Windows build fails:
The fix
Drop the machinery and say it in the cabal file, where the test-suite can be
addressed directly:
-rtsoptslets MIO be chosen at run time where WinIO is the default:cabal test --test-options='+RTS --io-manager=posix -RTS'.The compiler versions are spelled out rather than probed. The overlapped I/O
exception fix — the one that bumps
__IO_MANAGER_WINIO__to 2 — landed on theghc-9.12andghc-9.14branches in April 2026, after 9.12.4 and 9.14.1 hadbeen released. The lower bounds are exclusive so that release candidates and
snapshots of those branches, such as
9.12.4.20260713, are covered as well.--with-compileris still accepted, now unused, so that cabal passing it doesnot draw an unrecognized-option warning.
Testing
-with-rtsopts=--io-manager=nativenow reaches the link line (cabal -v2)and the string is embedded in the built
spec.exe;network.buildinfois back to its single valid line;+RTS --io-manager=posix -RTSas well.Trade-off
Spelled-out version bounds need maintaining: a later backport, to 9.10 say,
would have to be added by hand. The probe would have tracked that automatically,
but it had no way to deliver its answer to the test-suite, which is what broke.
This is what broke network-3.2.12.0 for #633, whose tarball shipped a stale
configurefrom master.Refs #602, #613, #633.
🤖 Generated with Claude Code