[Solved] GHCi 9.2.7 to 9.4.5 on Windows: was there a change?

I’m trying to move the Stack project from GHC 9.2.7 (LTS 20.23) to GHC 9.4.5 (nightly-2023-06-18 LTS 21.0) and, on Windows only, the CI integration testing stack repl (Stack’s wrapper around GHCi) has stopped working. I am trying to figure out why. My question is: does any GHCi guru happen to know if there were any changes in how GHCi processes input on Windows between 9.2.7 and 9.4.5?

A key file in Stack’s repository is test/integration/lib/StackTest.hs, which depends on process-1.6.16.0 (which is unchanged between LTS 20.23 and LTS 21.0). Function replCommand :: String -> ReaderT ReplConnection IO () feeds commands to GHCi down an input pipe and function replGetLine :: ReaderT ReplConnection IO String captures GHCi’s output from a standard output pipe. What seems to now be happening is that GHCi is behaving as if it has received EOF before receiving any commands and quitting, gracefully, with its usual Leaving GHCi.. (Running stack repl locally with the test files suggests that nothing untoward is happening with the actual tests.) That is, it is like GHCi on Windows used to wait for command input in these tests, and now it quits before the input turns up.

Details of my attempts are at: Fix #6160 Move Stack on to GHC 9.4.5 by mpilgrem · Pull Request #6161 · commercialhaskell/stack · GitHub

2 Likes

The above now appears to be a red herring. I now think the change of behaviour was also co-incident with the Stack-supplied MSYS2 being bumped from msys2-20221216 to msys2-20230526. EDIT: Yes, it is definitely MSYS2-related.

1 Like