swift-nio icon indicating copy to clipboard operation
swift-nio copied to clipboard

Windows build failure

Open stackotter opened this issue 3 years ago • 30 comments

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

stackotter avatar Mar 13 '22 08:03 stackotter

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.

Lukasa avatar Mar 13 '22 20:03 Lukasa

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 :)

stackotter avatar Mar 13 '22 20:03 stackotter

Would be nice to have this :D

kennyevo avatar Oct 20 '22 11:10 kennyevo