Quick / Nimble

A Matcher Framework for Swift and Objective-C
https://quick.github.io/Nimble/documentation/nimble/
Apache License 2.0
4.8k stars 596 forks source link

Add Windows Support #1088

Closed brianmichel closed 11 months ago

brianmichel commented 11 months ago

Adds support for compiling and using Nimble when using Swift on Windows.

This PR is a mostly mechanical change except the bits around the RunLoop that I had to work around since CoreFoundation does not exist on Windows. Unfortunately, the only way to get all of the polling stuff running was to use the SPI _stop() on the RunLoop implementation which specifically exists for XCTest it seems. I've filed an issue here https://github.com/apple/swift-corelibs-foundation/issues/4826 to better understand the trajectory for that function since there is no alternative to stopping a runloop otherwise.

All tests should pass except the throwAssertion tests since I was unsure if they could be adjusted to function correctly on Windows.

No function signatures have been modified as part of this PR as my goal is to use it in downstream libraries that we're trying to get running on Windows (LaunchDarkly).

I've also added a new CI job and pinned the Windows swift version to the 5.9 toolchain.

brianmichel commented 11 months ago

This looks good overall.

My concern with accepting this is I don't have a windows machine to be able to locally verify I don't break anything, forcing me to rely on CI to double-check things.

This work is valuable, so I don't want to throw it away, but I'm noting that the risk of bitrot with this is high.

Yeah, this is certainly a concern. There are ways around not having a machine (like sshing into a runner to debug) but I'm happy to help as needed to see what assistance I can provide.

I imagine this might be a common concern from maintainers so I totally understand.

younata commented 11 months ago

There are ways around not having a machine (like sshing into a runner to debug) but I'm happy to help as needed to see what assistance I can provide.

I'll be sure to keep that in mind! Thanks for this!