swift-atomics icon indicating copy to clipboard operation
swift-atomics copied to clipboard

Swift Atomics can't be used in Swift Playgrounds.app

Open wtholliday opened this issue 2 years ago • 2 comments

Swift Atomics can't be used in Swift Playgrounds.app because of a C target. We would like to use Swift Atomics in AudioKit (https://github.com/audiokit/audiokit) and we support Swift Playgrounds.

(Note that this bug is distinct from https://github.com/apple/swift-atomics/issues/55)

Information

  • Package version: 1.0.3
  • Platform version: 13.1 (22C65)
  • Swift version: swift-driver version: 1.62.15 Apple Swift version 5.7.2 (swiftlang-5.7.2.135.5 clang-1400.0.29.51) Target: x86_64-apple-macosx13.0

Checklist

  • [x] If possible, I've reproduced the issue using the main branch of this package.
  • [x] I've searched for existing reports of the same issue.

Steps to Reproduce

  1. Download Swift Playgrounds from App Store
  2. Create a new app
  3. File -> Add Package
  4. Enter https://github.com/apple/swift-atomics
  5. Click the play button

Expected behavior

Swift Atomics can be used in Swift Playgrounds.

Actual behavior

Compilation fails because Swift Atomics uses a C target.

image

wtholliday avatar Dec 22 '22 01:12 wtholliday

actually, i think addressing #55 would fix this as well, but that entails changes that are unlikely to happen.

rvsrvs avatar Mar 05 '23 04:03 rvsrvs

Getting rid of the C module with something along the lines of https://github.com/apple/swift-atomics/pull/74 would likely get rid of these issues. However, this will require some Swift compiler & stdlib work, so it will take time.

lorentey avatar Mar 20 '23 19:03 lorentey