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

recvBufFromMIO s ptr nbytes
# endif
#else
withNewSocketAddress $ \ptr_sa sz -> alloca $ \ptr_len ->
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.

Is this not the same as the recvBufFromMIO below? so couldn't we just reuse one of them?

Comment on lines +428 to +432
-- If the control buffer was truncated (MSG_CTRUNC), the
-- control data may be invalid and parsing could segfault.
cmsgs <- if msgCtrl hdr == nullPtr || (rawFlags .&. #{const MSG_CTRUNC}) /= 0
then return []
else parseCmsgs msgHdrPtr
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.

This looks like a separate bugfix. Perhaps move it to a separate commit and new changelog entry?

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.

I'm not sure why, but the Windows tests weren't passing without this. Maybe using WinIO exposed a new behavior here, so it's connected to WinIO. But I can split it out if you like.

-- 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?

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