thebrowsercompany / swift-webdriver

A Swift library for communicating with WebDriver (Appium/WinAppDriver) endpoints
BSD 3-Clause "New" or "Revised" License
100 stars 3 forks source link

build: prevent building on non-Windows targets #139

Closed compnerd closed 7 months ago

compnerd commented 7 months ago

We currently rely on Windows specific behaviour and while in theory it is possible to port this to Linux, it is unlikely to be ported to Apple platforms. This simply properly indicates the error.

jeffdav commented 7 months ago

What's motivating this? Is it blocking something for you? I can spend the time to make it properly xplat if so.

It is meant to be xplat, in that webdriver target should be. The winappdriver target is obviously windows specific.

compnerd commented 7 months ago

It was motivated by #138. Given the other items currently pending, I'm not sure if cross-platform support is the highest priority for us (but patches to enable that likely should be welcomed).

tristanlabelle commented 7 months ago

+1 on the library being meant to be xplat. Isn't the fix simply to use some variant of this?

#if canImport(FoundationNetworking)
import FoundationNetworking
#else
import Foundation
#endif
compnerd commented 7 months ago

I would rather use the unsupported features that I mentioned on the issue itself:

#if !_runtime(_ObjC)
import FoundationNetworking
#endif

The problem is that we also have other flags (e.g. -Xlinker -ignore:4217). If we drop that as well - yeah, I suppose we can avoid some of this.

tristanlabelle commented 7 months ago

@compnerd We have a fix from Jeff that still allows building on non-Windows platforms. Can we close this PR? https://github.com/thebrowsercompany/swift-webdriver/pull/140