Skip to content

TSCBasic: fix compatibility with Swift 5.5 #415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 4, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Sources/TSCBasic/FileSystem.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1021,7 +1021,11 @@ public final class InMemoryFileSystem: FileSystem {
}

// Internal state of `InMemoryFileSystem` is protected with a lock in all of its `public` methods.
#if compiler(>=5.7)
extension InMemoryFileSystem: @unchecked Sendable {}
#else
extension InMemoryFileSystem: UnsafeSendable {}
#endif

/// A rerooted view on an existing FileSystem.
///
Expand Down Expand Up @@ -1176,7 +1180,11 @@ public final class RerootedFileSystemView: FileSystem {

// `RerootedFileSystemView` doesn't hold any internal state and can be considered `Sendable` since
// `underlyingFileSystem` is required to be `Sendable`.
#if compiler(>=5.7)
extension RerootedFileSystemView: @unchecked Sendable {}
#else
extension RerootedFileSystemView: UnsafeSendable {}
#endif

private var _localFileSystem: FileSystem = LocalFileSystem()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"repositoryURL": "https://github.com/apple/swift-syntax.git",
"state": {
"branch": "main",
"revision": "2d5575b8771c5ccd5673428d959085ddb74dbbf7",
"revision": "a6486790b46a4469bfb2b09d7ff6463aaecc40e5",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@neonichu this is what made the macOS build fail, maybe we should try to remove this Package.resolved to avoid similar issues in the future?

Copy link
Contributor

Choose a reason for hiding this comment

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

IIRC, without it we can't build at all, right? We can try to use an empty one.

Copy link
Contributor

Choose a reason for hiding this comment

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

Trying over here #417

"version": null
}
},
Expand Down