swiftwasm/swift

Support swift-corelibs-libdispatch

kateinoigakukun opened this issue · 4 comments

We will be able to support it after #5548

Running into dispatch compiler issue recently. Looks like dispatch is currently not supported on WASM.

In file included from /home/runner/work/OpenGraph/OpenGraph/Sources/_OpenGraph/Graph/Graph.cpp:9:
In file included from /opt/hostedtoolcache/swiftwasm/wasm-5.9.1-RELEASE/x86_64/usr/lib/swift_static/dispatch/dispatch.h:64:
/opt/hostedtoolcache/swiftwasm/wasm-5.9.1-RELEASE/x86_64/usr/lib/swift_static/os/object.h:221:1: error: unknown type name '__BEGIN_DECLS'
__BEGIN_DECLS

Does it mean #if defined(__unix__) is not evaluated to true for WASI and we need to a PR to fix it here?

https://github.com/apple/swift-corelibs-libdispatch/blob/5529d351e304eb2312b7b3bfb073f7d8285473e0/os/object.h#L24-L33

libdispatch is not supported yet at all

libdispatch is not supported yet at all

Got it. I'll use macro to disable it for WASI platform.

https://github.com/OpenSwiftUIProject/OpenGraph/blob/d35513b213be037fe97995b1704020b837a4a9e8/Sources/_OpenGraph/Graph/Graph.cpp#L21-L29