Open robbertvanginkel opened 1 year ago
Thank you for creating a ticket for this :)
This is an issue of the toolchain directory layout. The libdispatch's mdoulemap is placed at usr/lib/swift_static/dispatch/module.modulemap
but the directory is shared between all platforms. This is apparently wrong place considering crosscompiling. Ideally, that should be moved to platform-specific directory like usr/lib/swift_static/wasi/
to avoid this kind of issue.
But I haven't tried this yet and I think it's better to discuss the toolchain layout in the forum at first to fix it in upstream also.
Description While trying to compile the same swift to wasm from both linux and macos, I noticed that some builds would fail depending on the host OS for the same toolchain release.
Steps to reproduce For the following swift file:
On macos:
But on linux (tested under
docker run -it ubuntu:20.04
):Expected behavior I expected some difference in behavior for swift on macos vs linux, but given that I'm targetting wasm here I expected a statement like
#if canImport(Dispatch)
would be consistently pass/failing depending on the target toolchain irrespective of the host.