Skip to content
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

error: stored property 'xcTestCompatibleSelector' of 'Sendable'-conforming struct 'Test' has non-sendable type '__XCTestCompatibleSelector?' (aka 'Optional<Selector>') #491

Closed
toffaletti opened this issue Jun 17, 2024 · 4 comments
Assignees
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@toffaletti
Copy link

Description

Using swift-6.0-DEVELOPMENT-SNAPSHOT-2024-06-12-a.xctoolchain on macOS, I'm unable to use swift testing because of this error.

Expected behavior

I expect swift test --disable-xctest would build and run my tests.

Actual behavior

.build/checkouts/swift-testing/Sources/Testing/Test.swift:69:14: error: stored property 'xcTestCompatibleSelector' of 'Sendable'-conforming struct 'Test' has non-sendable type '__XCTestCompatibleSelector?' (aka 'Optional<Selector>')
 67 |   /// property is always `nil`.
 68 |   @_spi(ForToolsIntegrationOnly)
 69 |   public var xcTestCompatibleSelector: __XCTestCompatibleSelector?
    |              `- error: stored property 'xcTestCompatibleSelector' of 'Sendable'-conforming struct 'Test' has non-sendable type '__XCTestCompatibleSelector?' (aka 'Optional<Selector>')
 70 |
 71 |   /// An enumeration describing the evaluation state of a test's cases.

ObjectiveC.Selector:1:23: note: struct 'Selector' does not conform to the 'Sendable' protocol
1 | @frozen public struct Selector : ExpressibleByStringLiteral {
  |                       `- note: struct 'Selector' does not conform to the 'Sendable' protocol
2 |     public init(_ str: String)
3 |     public init(stringLiteral value: String)

Steps to reproduce

  1. Install swift-6.0-DEVELOPMENT-SNAPSHOT-2024-06-12-a.xctoolchain from swift.org
  2. Run swift test --disable-xctest

swift-testing version/commit hash

da1d5ac

Swift & OS version (output of swift --version ; uname -a)

Apple Swift version 6.0-dev (LLVM 6e13b8be259f20f, Swift e7c2412597ed910)
Target: arm64-apple-macosx14.0
Darwin m14 23.6.0 Darwin Kernel Version 23.6.0: Thu Jun  6 16:11:38 PDT 2024; root:xnu-10063.140.26.0.1~13/DEVELOPMENT_ARM64_T6000 arm64
@toffaletti toffaletti added the bug Something isn't working label Jun 17, 2024
@stmontgomery stmontgomery self-assigned this Jun 17, 2024
@stmontgomery
Copy link
Contributor

I coincidentally just encountered this build failure also, but only when attempting to build using a newer Swift 6 development snapshot toolchain paired with an older Xcode 15.x. The newer Xcode 16 Beta contains SDKs whose ObjectiveC module has the Selector type marked Sendable, but earlier versions did not, so building using Xcode 16 Beta succeeds.

The other relevant factor which changed recently is that swift-testing's Package.swift changed to swift-tools-version: 6.0 in #467, and that in turn caused all of the package's targets to begin using the Swift 6 language mode.

I do not yet understand why this failure is not being hit by our CI system though, since it's using Xcode 15.1.

@toffaletti
Copy link
Author

That makes sense, I also have an older Xcode:

Xcode 15.4
Build version 15F31d

@stmontgomery
Copy link
Contributor

At this point, unless we identify some hard blocker which forces us to continue supporting versions of Xcode earlier than 16 Beta, we are inclined to close this and not make any workaround code changes. To anyone who encounters this problem, please ensure you are building using Xcode 16 Beta or later. This requirement has already been documented as part of the changes in #466

@stmontgomery stmontgomery closed this as not planned Won't fix, can't repro, duplicate, stale Jun 18, 2024
@grynspan grynspan added the wontfix This will not be worked on label Jun 19, 2024
@grynspan
Copy link
Contributor

grynspan commented Aug 3, 2024

Resolved by #582.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants