-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Windows Port #5030
base: main
Are you sure you want to change the base?
Windows Port #5030
Conversation
Here's an example of your CHANGELOG entry: * Windows Port.
[compnerd](https://github.com/compnerd)
[#issue_number](https://github.com/realm/SwiftLint/issues/issue_number) note: There are two invisible spaces after the entry's text. Generated by 🚫 Danger |
Add some Windows specific handling for the paths in SwiftLintCore. The one piece that this change does not cover is the handling of `glob` as that is not an ISO C standard function and as such there is no `glob` on Windows. This will be worked through separately.
This enables building the swiftlint command on Windows. There is no system ioctl for terminal access, instead, we can use the Win32 Console API surface to query the console size. In the case of a failure, assume the width to be 80-columns (as the standard VGA console is 80x25).
Windows does not support `glob` as a standard C library function as that is not part of the C standard. Attempt to emulate that through the use of `FindFirstFileW` and `FindNextFile` to iterate the matching files given a pattern. This should allow us to start enumerating the files as if we had `glob` available.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This basically looks fine to me. What about the open issues/PRs from other repositories you mentioned in the PR description? Is there anything more required to make SwiftLint work on Windows?
The only thing needed is to get the SourceKitten changes in (but haven't been able to get response from @jpsim to get those resolved and merged). |
Co-authored-by: Danny Mösch <danny.moesch@icloud.com>
Last I checked the windows PRs for some SwiftLint dependencies failed to build or failed tests for macOS or Linux. I’m happy to review again when those failures are addressed. |
This is currently not possible to build on Windows. It requires that SourceKitten changes are merged (jpsim/SourceKitten#769) and some changes to the toolchain that are still in the process of getting merged upstream (swiftlang/swift-package-manager#6573) which depends on a toolchain that is not yet tagged.
It is not possible to build the tests on Windows due to the use of the executable target as a dependency for the tests which results in multiple definitions of
main
.This will require a fix for libdispatch (swiftlang/swift-corelibs-libdispatch#791) as well. With that, it seems that I can now swiftlint on Windows as well!