-
-
Notifications
You must be signed in to change notification settings - Fork 7.5k
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
Linux and Windows Support #3446
Conversation
c0a2505
to
3aef01b
Compare
|
I’d like to get Windows support in here. Thoughts on renaming this “Linux/Windows support” and combining the efforts from #3462? |
|
@alex-taffe Sure. Once you're done with the PR we can merge it in here and work towards full testing support. |
|
Awesome, will let you know when it’s done, should probably just mark as a draft |
|
Actually @jshier, the local build just completed on my Windows box and I think we’re good to go. |
* Correct example (#3453) * Exclude NetworkReachabilityManager from Windows Fixes #3459. Windows does not have SystemConfiguration, so we have to exclude it * Initial windows support * Fix lock issues * Add Windows tests * Fix Windows mutex error * Remove enable test discovery * Combine Windows and Linux mutex lock with one common NSLock based class * Remove locked variable check * Simplify locking extension
.github/workflows/ci.yml
Outdated
| cd ${{ github.workspace}} | ||
| set SDKROOT=%SystemDrive%\Library\Developer\Platforms\Windows.platform\Developer\SDKs\Windows.sdk | ||
| %SystemDrive%\Library\Developer\Toolchains\unknown-Asserts-development.xctoolchain\usr\bin\swift-build.exe -c debug -Xlinker /INCREMENTAL:NO -v | ||
| if not exist .build\x86_64-unknown-windows-msvc\debug\alamofire.exe exit 1 |
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.
@jshier I don’t have write access so I can’t actually change this. TLDR is that for some reason if Swift fails to compile, it doesn’t kill the action. I got the path wrong. Need to change:
if not exist .build\x86_64-unknown-windows-msvc\debug\alamofire.exe exit 1
to:
if not exist .build\x86_64-unknown-windows-msvc\debug\Alamofire.swiftmodule exit 1
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.
Looks like that fixed it, nice!
|
@alex-taffe If you're interested, our next step would be to get our Firewalk test server building and running on Linux and Windows so we can start executing tests. This includes some sort of deployment mechanism for both platforms, whether as a raw binary or through a package manager (Homebrew on Linux?). It's a Vapor server so it should already be cross platform, so it's mainly a tooling issue. Would you be interested in helping with that? |
|
@alex-taffe Since SPM is supposed to work on Windows now, would it be possible to update the Windows build to use that instead of a direct executable? |
I would love to, but unfortunately Vapor doesn’t work on Windows yet. I had tried using it a few months ago for a project, but Vapor depends on SwiftNIO (see https://github.com/vapor/vapor/blob/9d154df6214a1d6027f04a495e8981bac49224da/Package.swift#L19). compnerd (not tagging just to avoid junking up his inbox) is working on SwiftNIO support on Windows, but it’s not done yet (apple/swift-nio#1673) |
I’m not entirely sure what you mean. Do you mean replacing |
I just meant that on Linux we can build (and eventually test) the framework with just
That's too bad, I was hoping to bring everything into parity. I suppose we need a way to say that Windows just isn't fully supported, which would also apply to Linux until I can get Firewalk ported. You wouldn't have any interest in that, would you? |
|
I might be able to take a look this weekend, otherwise it'll probably be in a few weeks. The Windows support was mainly for a project at work that needs to get done soon. Won't fully commit to it, but I'll try to get to it at some point |
|
@alex-taffe I've updated the PR so that the test suite builds on Linux and Windows. However, there are rather extensive issues with getting it to pass (authentication crashes, bizarre test failures) even once I got Firewalk running on Linux. So while I think we're okay shipping the changes required to build on the other platforms, Alamofire will be completely unsupported on Linux and Windows. |
|
I think I'm good with that |
Issue Link 🔗
#1935
Goals ⚽
This PR builds on #3098 and #3462 to add preliminary support for Alamofire on Linux and Windows now that Swift 5.4 greatly decreases the changes needed between the platforms.
Implementation Details 🚧
Functionally, this PR doesn't change implementation except where types are unavailable on non-Apple. This includes:
AFErrorsupport forServerTrustFailureReasonhas been checked.UTtypes from CoreServices were checked.Strings.TODO ✅
URLAuthenticationChallengefor everything that's notServerTrust.getBoundStreamsusage.MultipartFormData.Testing Details 🔍
Testing needs to be updated to run against Firewalk.