Closed RyanGlScott closed 1 year ago
If I had to pick, I'd pick (2). By your question it sounds like you might be offering to make the change. Is that the case? (If so, thank you!)
(Also, incidentally, anything we can do to move further away from using unix
is a good move in my book since support for Windows is getting some attention and any unix-isms in the codebase are going to make that harder, so this is on my mind.)
Sounds good—I will submit a patch implementing (2) shortly. Note that this doesn't really get us away from Unix conventions because we will still be using /dev/null
, which doesn't exist on Windows. That being said, it's fairly simple to paper over it should you want to support Windows later, as demonstrated here.
Ah, never mind, option (2) isn't as straightforward as I thought it would be. This is because vty
's API directly uses unix
's Fd
, as in here:
We could try to remove those uses of Fd
, but that would turn this into a much larger patch than what I originally had in mind. As such, I'll go with (1) instead.
Okay, thanks. (Yeah, the Fd
usage is a problem for Windows as I'm discussing with others elsewhere.)
test:verify-terminal
fails to build withunix-2.8.1.0
(bundled with GHC 9.6.1):This is because the type of
unix
'sopenFd
function changed inunix-2.8.0.0
to remove theMaye FileMode
argument, instead making it a part of theOpenFileFlags
argument. (See the changelog.)I can see two different ways to fix this issue:
Nothing
with!MIN_VERSION_unix(2,8,0)
.unix
'sopenFd
withbase
'openFile
. As far as I can tell, nothing about this code requires anything thatopenFile
couldn't give you.Which would you prefer?