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

Fix Windows build break in Terminal. #205

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

Conversation

jeffdav
Copy link

@jeffdav jeffdav commented Oct 20, 2024

There are three things that cause Terminal to not build on Windows:

  1. isprint() returns an Int32 which requires an explicit comparison. Easy fix: just compare against 0.
  2. _getch() returns an Int32, but Unicode.Scalar() takes a UInt32. So we must cast.
  3. The entire implementation of size was Posix-specific. Add a Windows implementation.

@jeffdav
Copy link
Author

jeffdav commented Oct 20, 2024

Note: To build on Windows, first one must update swift-nio to this revision or later:
apple/swift-nio@8b66b22

@0xTim
Copy link
Member

0xTim commented Oct 20, 2024

@jeffdav Could you enable Windows CI so we can track this properly? See https://github.com/vapor/jwt-kit/blob/main/.github/workflows/test.yml#L35

@jeffdav
Copy link
Author

jeffdav commented Oct 21, 2024

Sure. But we may have to wait for swift-nio to ship a new minor revision.

@0xTim
Copy link
Member

0xTim commented Oct 21, 2024

Yeah I'm not expecting it to pass but we can at least track the errors across the modules and make sure we don't add regressions in new code. It will be a while until NIO ships a windows compatible version

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

Successfully merging this pull request may close these issues.

2 participants