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

Add basic windows support #344

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

fredr
Copy link
Contributor

@fredr fredr commented Aug 1, 2024

Fixes #342

I know I should wait for a discussion before opening a PR, but I had to implement this regardless due to having to support windows developers in our project. So I thought I could add the PR here as well until you have time to think about it, but ofc no pressure to merge, it is merely opened as a suggestion for how this could be implemented if you are open to the feature, I'm also happy to take feedback if you would like it to be implemented differently somehow.

This adds basic support for windows, it excludes all Unix socket features (e.g transfer_fd), it excludes daemonization (the library used in unix-only).

For all uses of std::os::unix::io::RawFd on unix systems, windows use std::os::windows::io::RawSocket.

For the libc calls getpeername and getsockname that on unix systems uses the implementation in the nix-crate, windows uses a implementation that is based on similar functionality in the std lib (but that unfortunately is private)

I've been testing this with the x86_64-pc-windows-gnu target, but I have not been able to cross compile pingora-boringssl to windows. Not sure if it important to test for windows, so didnt spend very much time on it as it is likely just a problem with my local developement environment.

fredr added a commit to encoredev/encore that referenced this pull request Aug 5, 2024
Updates to latest version of pingora (0.3.0) and patches it with windows
support from cloudflare/pingora#344

Tested on windows with the typescript hello world app
@eaufavor eaufavor self-assigned this Aug 23, 2024
@eaufavor eaufavor added WIP We are working on this feature internally enhancement New feature or request labels Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request WIP We are working on this feature internally
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows support
2 participants