-
Notifications
You must be signed in to change notification settings - Fork 190
supporting AF_UNIX on Windows #549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
supporting AF_UNIX on Windows #549
Conversation
@Mistuke This enables
Any suggestions? |
Hi, Awesome!
It was enabled in Windows 10 build 1803, so the version of Windows released on 30 April 2018. Due to the current support cycle of Windows, this means any supported version of Windows has it. See https://learn.microsoft.com/en-us/windows/release-health/supported-versions-windows-client Typically for features we do runtime checks instead of compile time checks. But there doesn't seem to be a way to detect the availability of this at runtime since it exposes new functionality as only a struct. So I think it makes sense to just use it unconditionally. Anyone on a non-supported version of Windows would also not be supported by newer GHC and so can use older versions.
Distribution of headers on Windows happen by bundling the dev headers inside the compiler package itself. So on releases of GHC when the compiler version is increased, the headers and crt are also updated. So GHC 9.4 works because of the switch to clang and having the headers updated. Typically, we work around this by having a "compat" header file which bundles a copy of the header for older GHC, like this https://github.com/haskell/win32/blob/master/include/wincon_compat.h you can find the header definition here https://github.com/mingw-w64/mingw-w64/blob/master/mingw-w64-headers/include/afunix.h
because conceptually the operation doesn't line up with the expectations. On Unix it does
and if you look at the posibilities for As far as I can tell,
But this in itself is a problem. On Windows As a consequence, the behavior of
Which is because I don't think the Windows socket/security model allows it the same way as the Unix one. |
@Mistuke Thank you for explaining! P.S. |
Sure, I'll take a look in the weekend :) |
cd5fbb6
to
bafc223
Compare
Have not forgotten, just didn't get a change last weekend, got stuck in train delays. it's a long weekend this one so will do it tonight or tomorrow morning! |
Sending PR just for CI.