jcavar
(Josip Cavar)
1
I am trying to use new Synchronization module with Embedded Swift mode, but it seems to fail with:
"error: no such module 'Synchronization'"
I am compiling it with:
xcrun -toolchain "Swift Development Snapshot" swiftc basic.swift -Xfrontend -disable-availability-checking -enable-experimental-feature Embedded -wmo
Do I need to specify some other flag or there is some more fundamental reason why this is not working?
rauhul
(Rauhul Varma)
2
There's probably two issues here:
- we likely haven't added this module to the embedded standard library (yet)
- platform support for various synchronization primaries varies and we haven't figured out how to expose this complexity.
Cc @kubamracek
scanon
(Steve Canon)
3
We have figured out how to expose this complexity! Availability of atomic primitives can be checked on the target platform via _hasAtomicBitWidth. This should just be a question of configuring the build to build the module for that environment, and setting the conditionals appropriately. CC @Alejandro.
3 Likes
rauhul
(Rauhul Varma)
4
I stand corrected, adding the synchronization module should be pretty easy then!
1 Like
scanon
(Steve Canon)
5
Given that we're not currently building the code for these environments, we might encounter some bugs once we do, but I expect that they will be pretty straightforward to resolve.
2 Likes
Right, I don't see why the Synchronization module should be problematic to enable in Embedded Swift. Took a stab at it here: [embedded] Start building Synchronization in embedded Swift mode by kubamracek · Pull Request #72293 · apple/swift · GitHub
2 Likes