Skip to content
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

Support for Unix Sockets in Windows #396

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

MikuAuahDark
Copy link

@MikuAuahDark MikuAuahDark commented Dec 28, 2022

This PR enables compilation of socket.unix module in Windows. Fixes #328.

Note that the Makefile change is untested, only the Visual Studio solutions. One thing I noticed that in Windows, inet.c must be compiled in Unix sockets. Rockspec changes is also untested.

Resulting binary from Visual Studio solutions is tested and works as expected by connecting to Unix socket that's created from PHP. Note that while unix.dgram/unix.udp function is exposed, Unix datagram socket doesn't work in Windows. This is currently Windows limitation.

Feel free to cherry-pick as appropriate if this PR as a whole lacked the quality and standards of the repository.

@alerque
Copy link
Member

alerque commented Oct 23, 2023

@leso-kn Any chance you can review this PR?

@leso-kn
Copy link
Contributor

leso-kn commented Oct 23, 2023

The changes look fine to me, but I do not own a windows machine either.

Out of curiosity I brought up some effort to add a Github Actions definition for windows, but it's running into some – what I believe are – runtime dll open issues (see the pipeline log).

I'll be calling it a day for today, feel free to have a look at the log and comment.

@MikuAuahDark
Copy link
Author

Is it possible to have the build result as artifacts? Runtime DLL errors require further inspection into the DLL directly either by using Dependency Walker or improved version of it.

@alerque
Copy link
Member

alerque commented Oct 24, 2023

@MikuAuahDark It's possible to get, but you have to setup the pipeline ahead of time to post the artifacts you want back to the job, you can't inspect and get files out of an old job if it didn't mark them for posting ahead of time. Also since this is a case of a failed job the asset posting needs to be configured such that the failing step of the job does not block the rest of the job steps from running.

Copy link
Member

@alerque alerque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a merge from master to get new CI workflows with Windows tests running in this PR. That turns up build failures for the Windows jobs. That will need to be resolved...

@MikuAuahDark
Copy link
Author

I'll see what I can do this weekend.

@MikuAuahDark MikuAuahDark force-pushed the windows-afunix branch 2 times, most recently from b07152b to c44d18b Compare November 11, 2023 04:07
@MikuAuahDark
Copy link
Author

Alright, I rebased my changes based on the master branch and modified the rockspec file. Hopefully it solves the issue.

Copy link
Member

@alerque alerque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for responding to feedback on this. It passes CI now so that's something.

The commit list is a bit chaotic, but I'm happy to fix that up into something more conventional, so don't sweat it. I can split up and combine the existing commits to get something cleaner.

Before I do that though can you explain why there are now two Visual Studio projects here? Is there a reason they can't be combined into a single project? I don't understand how VS tooling works obviously but it doesn't make sense to me why there are two different project files for it.

@MikuAuahDark
Copy link
Author

MikuAuahDark commented Nov 11, 2023

I found out separating it is the best way to go. The socket.core (socket.vcxproj) and socket.mime (mime.vcxproj) is already in their separate VS projects so it makes sense to have socket.unix (unix.vcxproj) as separate Visual Studio project too. It's also not possible for single Visual Studio projects to emit multiple DLLs.

Do note that Visual Studio Solutions (luasocket.sln) is different than the Visual Studio Projects (*.vcxproj). A single Visual Sudio Solution can contain one or more Visual Studio Projects, which is the case ofr LuaSocket.

@alerque
Copy link
Member

alerque commented Nov 11, 2023

It's also not possible for single Visual Studio projects to emit multiple DLLs.

Okay then, I guess that settles that. Thanks for the info.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Enabling Unix Socket for Windows
3 participants