Skip to content

fix: add Sendable conformance to DispatchQueueExecutor on Linux#1814

Merged
groue merged 1 commit intogroue:developmentfrom
alephao:fix/dispatch-queue-actor-linux
Sep 18, 2025
Merged

fix: add Sendable conformance to DispatchQueueExecutor on Linux#1814
groue merged 1 commit intogroue:developmentfrom
alephao:fix/dispatch-queue-actor-linux

Conversation

@alephao
Copy link
Copy Markdown
Contributor

@alephao alephao commented Sep 17, 2025

I've been using GRDB for a while on Linux, but recently I started getting build failures due to DispatchQueueExecutor not conforming to Sendable. This change fixes it by conditionally setting @unchecked Sendable when on Linux.

https://github.com/swiftlang/swift-corelibs-libdispatch/blob/0bb6c10fa556722654917b4a18ba2dc39b18392a/src/swift/Block.swift#L16

  • CONTRIBUTING: You have read https://github.com/groue/GRDB.swift/blob/master/CONTRIBUTING.md
  • BRANCH: This pull request is submitted against the development branch.
  • DOCUMENTATION: Inline documentation has been updated.
  • DOCUMENTATION: README.md or another dedicated guide has been updated.
  • TESTS: Changes are tested.
  • TESTS: The make smokeTest terminal command runs without failure.

@groue
Copy link
Copy Markdown
Owner

groue commented Sep 17, 2025

Hello @alephao,

Thank you for restoring the Linux build!

However, I do not feel comfortable in the long term. Adding an @unchecked Sendable conformance is a quick fix, but it is unsafe, and might hide a deeper issue. We need more information:

Since I suppose one or several related issues have been opened in the Swift repository. I'd appreciate if you'd link to them here in a comment.

I'll feel more comfortable merging the PR after that.

(Please tell me if my question is not clear)

@alephao
Copy link
Copy Markdown
Contributor Author

alephao commented Sep 17, 2025

Hi @groue thanks for the quick response.

Found a few related issues, they are not related to DispatchWorkItemsFlags and DispatchQueue, but close enough: conditional Sendable conformance in the Dispatch lib.

Related issues:

@groue
Copy link
Copy Markdown
Owner

groue commented Sep 18, 2025

Wow, that's perfect. Thank you very much for this investigation and for opening swiftlang/swift-corelibs-libdispatch#910 👍 I can now see that the feedback is almost inexistent, but the rationale for this PR is strong.

@groue groue merged commit aab2664 into groue:development Sep 18, 2025
@groue
Copy link
Copy Markdown
Owner

groue commented Sep 18, 2025

Merged! 👍

@groue
Copy link
Copy Markdown
Owner

groue commented Sep 18, 2025

Oh, and thank you very much for restoring the Linux build 🙏

@groue
Copy link
Copy Markdown
Owner

groue commented Sep 23, 2025

⛵ Shipped in v7.7.0!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants