apple / swift-atomics

Low-level atomic operations for Swift
Apache License 2.0
1.06k stars 50 forks source link

`@_implementationOnly import _AtomicsShims` triggers compiler assertions on 5.9 #107

Closed lorentey closed 9 months ago

lorentey commented 11 months ago

Under certain unknown circumstances, using Swift Atomics as a dependency triggers a compiler assertion due to the way it imports _AtomicsShims in 5.9.

error: fatal error encountered while reading from module '[...]'; please submit a bug report (https://swift.org/contributing/#reporting-bugs)
<binary format>
^
Please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the crash backtrace.
Stack dump:
[...]
6.      *** DESERIALIZATION FAILURE ***
[...]
module '_AtomicsShims' was not loaded
lorentey commented 11 months ago

I added the @_implementationOnly import to prevent issues when library evolution is enabled:

https://github.com/apple/swift-atomics/issues/104#issuecomment-1736482927

Not sure what we can do here, other than getting rid of this C module as soon as possible.