swift-nio
swift-nio copied to clipboard
Windows build failure
Expected behavior
Successfully builds on Windows
Actual behavior
Doesn't successfully build on Windows
Steps to reproduce
Run the following commands in command prompt and observe that it fails to build.
git clone https://github.com/apple/swift-nio
cd swift-nio
swift build
The error happens in Heap.swift because of log2 being an undefined function. From a quick skim over the file, it is probably just because nothing is imported when the platform is Windows (there are conditional imports that only trigger for Linux, Android, FreeBSD and Apple platforms.
Full error output:
Heap.swift:197:28: error: cannot find 'log2' in scope
return Int(log2(Double(index + 1)))
^~~~
SwiftNIO version/commit hash
d5f4a5e6
System & version information
Swift version: 5.5 OS: Windows 10 version 1909 build 18363.1500
P.S: Does swift-nio have any sort of mechanism for ensuring that PRs don't break Windows support? Cause I can't find one
We do not currently support Windows. Adding Windows support is something we’d like to see, but it’s not currently something we have the resources to tackle.
Oh ok, I though @compnerd added Windows support a while ago. And I saw the windows related target.
But I guess that that was made quite a while ago. I might look into fixing Windows support sometime.
Thanks for the quick response :)
Would be nice to have this :D