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

[Source compatibility suite] PennyBot failing to build with Swift 6 mode #8292

Open
1 task done
justice-adams-apple opened this issue Feb 12, 2025 · 2 comments
Open
1 task done
Labels

Comments

@justice-adams-apple
Copy link

Is it reproducible with SwiftPM command-line tools: swift build, swift test, swift package etc?

  • Confirmed reproduction steps with SwiftPM CLI. The description text must include reproduction steps with either of command-line SwiftPM commands, swift build, swift test, swift package etc.

Description

PennyBot is failing to build to with swift 6 mode with the nightly main toolchain. The error seen in the log is:

bot/.build/checkouts/swift-collections/Sources/DequeModule/_DequeBuffer.swift:44:14: error: let '_emptyDequeStorage' is not concurrency-safe because non-'Sendable' type 'ManagedBuffer<_DequeBufferHeader, Void>' may have shared mutable state
42 | /// The type-punned empty singleton storage instance.
43 | @usableFromInline
44 | internal let _emptyDequeStorage = _DequeBuffer<Void>.create(
   |              |- error: let '_emptyDequeStorage' is not concurrency-safe because non-'Sendable' type 'ManagedBuffer<_DequeBufferHeader, Void>' may have shared mutable state
   |              |- note: add '@MainActor' to make let '_emptyDequeStorage' part of global actor 'MainActor'
   |              `- note: disable concurrency-safety checks if accesses are protected by an external synchronization mechanism
45 |   minimumCapacity: 0,
46 |   makingHeaderWith: { _ in

https://ci.swift.org/job/swift-PR-source-compat-suite-test-macOS/321/artifact/swift-source-compat-suite/FAIL_penny-bot_6.0_BuildSwiftPackage.log

It looks like this is because swift-collections is not Swift 6 ready yet but I thought Swift PM would handle that?

I'm not sure if this is expected for swift-pm

Expected behavior

Expected the project to build correctly

Actual behavior

No response

Steps to reproduce

swift build --disable-sandbox --package-path penny-bot --verbose --configuration release --build-tests -Xswiftc -swift-version -Xswiftc 6 -Xswiftc -enable-testing

Swift Package Manager version/commit hash

2215d09

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

Apple Swift version 6.2-dev (LLVM 2bef1d1fbdd6b87, Swift 27386786a0cc850)
Target: x86_64-apple-macosx10.13

@justice-adams-apple
Copy link
Author

cc @lorentey

@dschaefer2
Copy link
Member

No, SwiftPM doesn't take the language mode into account when resolving packages.

justice-adams-apple added a commit to swiftlang/swift-source-compat-suite that referenced this issue Feb 14, 2025
justice-adams-apple added a commit to swiftlang/swift-source-compat-suite that referenced this issue Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants