apple / swift-system

Low-level system calls and types for Swift
Apache License 2.0
1.18k stars 102 forks source link

MachPort: fix build issues with Swift 5.7 #118

Closed MaxDesiatov closed 1 year ago

MaxDesiatov commented 1 year ago

It seems that #if $MoveOnly check has no effect in Swift 5.7, so we should check whether Swift 5.8 or later are available first.

Resolves #117.

MaxDesiatov commented 1 year ago

@swift-ci test

finagolfin commented 1 year ago

There was some talk in the pull that added this that they wanted it to work back to Swift 5.5, wouldn't this pull break that on Darwin?

MaxDesiatov commented 1 year ago

I'm glad that 5.5 support is planned, my only goal here is to fix the current breakage with 5.7 in the meantime.

finagolfin commented 1 year ago

Right, but won't this pull break building with 5.7 for macOS though? My presumption is that #if $MoveOnly is supposed to correctly return true with Swift 5.7 for macOS, based on what they wrote, which this will break. I don't know when $MoveOnly was added though, maybe it doesn't work for 5.7 too.

finagolfin commented 1 year ago

Looking at #116 closer, I guess it is not used anywhere else internally yet, only in the tests, so adding this same 5.8 check there should keep the tests building too, by disabling these new ones.

MaxDesiatov commented 1 year ago

@swift-ci test

weissi commented 1 year ago

@lorentey friendly ping. Without this (and a tag), swift-system doesn't compile with any released version of Swift anymore. This includes actually tagged versions of swift-system.