swiftlang / swiftlang/swift-corelibs-libdispatch

`DispatchQoS` and `DispatchSpecificKey` should have consistent `Sendable` conformances between macOS and linux

Open
#847 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
2.6k
Forks
496
Avg merge
2d 6h
Merged PRs (30d)
3

Description

this issue originally filed at https://github.com/swiftlang/swift/issues/76773

Description

the DispatchQoS and DispatchSpecificKey are conditionally Sendable on macOS, but not on linux for some reason, which creates a needless portability barrier for developers that aim to support both platforms.

Reproduction
import Dispatch
func f()
{
    let x:DispatchQoS = { fatalError() }()
    Task.init
    {
        let y:DispatchQoS = x
        let _ = y
    }
    Task.init
    {
        let y:DispatchQoS = x
        let _ = y
    }
}
Expected behavior

the types should have consistent conformances across platforms

Environment

$ swiftc --version
Swift version 6.0.1 (swift-6.0.1-RELEASE)
Target: x86_64-unknown-linux-gnu

Additional information

the original context was attempting to build GRDB.swift on linux

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the DispatchQoS and DispatchSpecificKey declarations exposed by the Dispatch module and compare their Sendable conformances on macOS and Linux. Reproduce the issue with the provided swiftc example targeting x86_64-unknown-linux-gnu; done means both types have matching cross-platform conformances and the example compiles consistently.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.