Skip to content

WinIO work#612

Open
thomasjm wants to merge 6 commits intohaskell:masterfrom
thomasjm:win-io-squashed
Open

WinIO work#612
thomasjm wants to merge 6 commits intohaskell:masterfrom
thomasjm:win-io-squashed

Conversation

@thomasjm
Copy link
Copy Markdown

@thomasjm thomasjm commented Apr 6, 2026

This contains all the work we've been doing in #602.

CC @kazu-yamamoto

@Mistuke
Copy link
Copy Markdown
Collaborator

Mistuke commented Apr 7, 2026

Right, had a quick look and so far looks good. I'll have a deeper review thursday morning.

I do like this approach because it also fixes the type error on the POSIX path on Windows that's been long standing.

@Mistuke
Copy link
Copy Markdown
Collaborator

Mistuke commented Apr 12, 2026

This looks really good! I have some nits and the build errors need to be fixed.

Copy link
Copy Markdown
Collaborator

@Mistuke Mistuke left a comment

Choose a reason for hiding this comment

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

Oops forgot to publish the review comments

Comment thread Network/Socket/Buffer.hsc Outdated
Comment thread Network/Socket/Buffer.hsc Outdated
Comment thread Network/Socket/Buffer.hsc Outdated
Comment thread Network/Socket/Syscall.hs Outdated
Comment thread Network/Socket/Handle.hs Outdated
Comment thread Network/Socket/Fcntl.hs
-- Since 2.7.0.0.
getNonBlock :: CInt -> IO Bool
getNonBlock :: CSocket -> IO Bool
#if defined(mingw32_HOST_OS)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

think this can be dropped.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

You mean remove the #if defined(mingw32_HOST_OS) ?

I don't think we can, since there are separate code paths here for Windows with WinIO, Windows without WinIO, and non-Windows. The first two are different because we always conditionally import <!> gated on HAS_WINIO. But maybe I'm misunderstanding you?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hmm I see. I asked because this macro is being defined in the cabal file just based on windows. If the macro is intended to check if the compiler supports WINIO then GHC already sets __IO_MANAGER_WINIO__ so perhaps that's better to use rather than a custom macro?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Other than that the rest look good

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Oh, do you want to get rid of HAS_WINIO throughout and replace with __IO_MANAGER_WINIO__? That sounds like a good idea.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Yeah, that's the recommended macro, because it let's the compiler stay in control!

We might be able to leverage this macro to tell which compilers have a "fixed" winio for network, if we eg make the macro a version. So like with your ghc patch (I gave some comments btw) we can change the macro to be, say version 2 and check for that instead?

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