Skip to content

Conversation

budde
Copy link
Contributor

@budde budde commented May 20, 2021

Fix some issues in Package.swift for the final Swift 5.4 Linux/Darwin releases

Motivation:

There are a couple Package.swift issues that are breaking builds under Swift 5.4 for both Linux and Darwin:

  • The -enable-experimental-concurrency flag only appears to be present in Swift 5.4 for Linux
  • The swift-syntax snapshot selected for 5.4 doesn't appear to be compatible with the final 5.4 release

Modifications:

  • Only enable the -enable-experimental-concurrency flag for Linux platforms
  • Migrate to the 0.50400.0 release of swift-syntax
  • Use swift-syntax development snapshot for Swift versions beyond 5.4

Result:


var globalConcurrencyFlags: [String] = []
#if swift(>=5.4)
#if swift(>=5.4) && os(Linux)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why only on linux? 🤔

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah I see, it's removed from the release now. Thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like unavailable on Darwin 😕

$ swift -version
Apple Swift version 5.4 (swiftlang-1205.0.26.9 clang-1205.0.19.55)
Target: x86_64-apple-darwin20.2.0

$ swift build
[1/1] Planning build

<unknown>:0: error: no such module '_Concurrency'
<unknown>:0: error: no such module '_Concurrency'

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it should be imported automatically on darwin... I'll dig into it hm

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need the flag at all tbh

#elseif swift(>=5.4)
dependencies.append(
.package(name: "SwiftSyntax", url: "https://github.com/apple/swift-syntax.git", .exact("0.50400.0"))
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's right, thank you!

@ktoso
Copy link
Member

ktoso commented May 20, 2021

A flaky test and failure in Prometheus in samples since it changed API it seems...

I'll fix those, thanks!

@ktoso ktoso merged commit d0e0fa4 into apple:main May 20, 2021
@ktoso ktoso deleted the swift-5.4-fix branch May 20, 2021 23:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Swift 5.4 builds are broken

2 participants