kohlschutter / junixsocket

Unix Domain Sockets in Java 7 and newer (AF_UNIX), AF_TIPC, AF_VSOCK, and more
Apache License 2.0
433 stars 114 forks source link

Windows 10 support for junixsocket #40

Closed vbachurin closed 4 years ago

vbachurin commented 7 years ago

Duplicate of this.

Hi,

I have started using Docker for Windows Beta and trying to build a Docker image on my Windows machine using gradle. It used to be fine on Linux, but on Windows 10 I get the following exception:

Operating System not officially supported by junixsocket: Windows 10
java.lang.UnsatisfiedLinkError: Could not find library in classpath, tried: [libjunixsocket-windows10-1.8-amd64.so, libjunixsocket-windows10-1.5-amd64.so]

Is there a chance to have junitsocket support Windows? Because with Docker for Windows more and more developers will switch to Windows.

Thanks in advance.

gesellix commented 7 years ago

As far as I know there won't be a chance to make Unix sockets work on Windows. Windows knows a concept of named pipes, similar, but not interoperable to Unix sockets. Consequently, junixsocket wouldn't be the correct library on Windows.

gesellix commented 7 years ago

How do you connect from Gradle to Docker?

vbachurin commented 7 years ago

Thanks for your response! Answering your question, com.bmuschko:gradle-docker-plugin https://github.com/bmuschko/gradle-docker-plugin

gesellix commented 7 years ago

Since the bmuschko/gradle-docker-plugin uses docker-java internally, I suggest you to follow the existing issue at https://github.com/docker-java/docker-java/issues/765 - maybe you could leave a note there to increase awareness.

kohlschuetter commented 5 years ago

Time flies!

AF_UNIX is now available on Windows 10. https://blogs.msdn.microsoft.com/commandline/2017/12/19/af_unix-comes-to-windows/

However, I do not have the resources to actively work on supporting this platform. Feel free to provide a pull request.

kohlschuetter commented 5 years ago

Look what happened. With cross-compilation support introduced in junixsocket 2.2, we can now support junixsocket on Windows 10! (It required some effort, but not as much as anticipated)

Please download junixsocket 2.2.0 and verify :)

gesellix commented 5 years ago

Regarding AF_UNIX on Windows for Docker clients there's now https://github.com/moby/moby/issues/36442 the next step to be resolved (and a whole rabbit hole with Golang support, etc.) ;) ... nevertheless thanks for adding Windows support to junixsocket!

Poddster commented 5 years ago

Hi @kohlschuetter

Thanks for adding Windows 10 support. I was having some issues using it with another C program, and so was inspecting the C code for org_newsclub_net_unix_NativeUnixSocket.c and noticed something unusual:

The #ifdef referenced here has an else here and an endif here at the bottom of the function.

Is that intentional?

The reason I ask is that there's multiple #ifdef _WIN32 inside that else block, which makes it seem like you expect those parts of the code to be compiled on windows (e.g. avoiding the stat and chmod)