For a class I teach, I want to illustrate the use of atomics. I'm trying to use swift-atomics in a playground under Xcode 13.4.1 and Swift 5.6. This is in a repo here.
The code in the playground is as follows:
@preconcurrency import Atomics var managed: ManagedAtomic<Bool> = .init(true)
This fails to compile with the error:
Undefined symbols for architecture arm64: "_swift_release_n", referenced from: __sa_release_n in _AtomicsShims.o "_swift_retain_n", referenced from: __sa_retain_n in _AtomicsShims.o ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation)
The playground is macOS but I get the same problem with iOS. It compiles fine when used in a regular SPM package. I can't figure out what the magic incantation would be to get this working correctly with a playground though and it prevents me illustrating my larger SPM package that relies on Atomics in a playground too.