Skip to content

Conversation

jeltsch
Copy link

@jeltsch jeltsch commented Sep 12, 2025

There is an effort to move some GHC-specific modules out of base. Candidates for such moving are GHC.IO.Handle.Types and GHC.IO.Handle.Internals. These modules are often used for obtaining operating-system handles (file descriptors, Windows handles) from Haskell handles. Such uses are also present in the process package.

There is a proposal to add dedicated operations for operating-system handle acquisition to base. A corresponding draft implementation can be found in GHC merge request !14732. The present pull request for process changes the package to use those new operations.

Note that this pull request changes the behavior of System.Process.Common.mbFd in two ways:

  1. The given handle is released between setting it to “blocking” and acquiring its file descriptor. It should be checked whether this may cause problems when another thread concurrently accesses the handle.
  2. In the case that the given handle is a duplex handle, both ends are set to “blocking” instead of just the reading end, as it was before. This was easier to implement based on the withHandle family of operations from GHC.IO.Handle.Internals but may not be what is desired.

@jeltsch
Copy link
Author

jeltsch commented Sep 27, 2025

Note that the tests necessarily fail with currently released GHC versions, as they require the new module System.IO.OS, which is added by GHC ticket !14732. This is also the reason why I gave this pull request draft status.

@jeltsch jeltsch marked this pull request as ready for review October 3, 2025 21:03
@jeltsch
Copy link
Author

jeltsch commented Oct 3, 2025

I removed the draft status of this pull request for it not to get lost.

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.

1 participant