-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SwiftWasm modules depending on JavaScriptKit fail to load when compiled with Swift 6.x compiler #262
Comments
For now, I went with the workaround here, but I do wonder what has changed since Swift 5.7 that means that Foundation is linked even if we're not using it at all. This appears to be a regression to me but I'm not sure it's related to SwiftWasm directly |
I totally understand your needs. I made an escape hatch for you #264 |
This is interesting, thank you! I will have to check but I think we actually need the I just wonder what has changed compared to the older Swift toolchains: Our current workaround for this is to package our own module called |
If I remember correctly, the issue that Foundation is always linked when using
|
Hi @kateinoigakukun, thank you for your reply. Maybe I'm being imprecise with my language. My experience with this issue is that the SwiftPM generated code to But: previous to Swift 6, unless we actually did something else that directly used I'm not sure what was happening "under the hood" previously that is different now, but there indeed seems to be a regression IMO. |
Interesting. The new swift-foundation might have introduced some changes to make it difficult to GC at link time. |
We updated to macOS Sequoia and are trying to get SwiftWasm working again in this environment.
After installing a Swift release toolchain (6.0.1) and a matching SwiftWasm SDK, we are able to build our Swift package, with some changes.
After the above changes, almost everything works as expected.
Now here is the issue: previously we had issues with JavaScriptKit using
resources
in its target definition (in Package.swift) under certain circumstances – I think because we were using an API that "might" be provided by Foundation if it's imported (note that theresources
flag depends onFoundation
, see here).This happens due to this line:
Now it seems we can't escape it. I can remove the
resources
line and the package will build fine, but doing so would require a fork of JavaScriptKit to get reproducible builds. Do you have any idea what could be going on here? Have you seen this issue yourself at all?To be clear: we don't want or need Foundation at all in our project. It is being automatically imported due to the
resources
line in JavaScriptKit's Package.swift. I can't see how to workaround this any more in Swift 6.x: it seems like something has changed such that wheneverresources
is there, Foundation is required. Any ideas?The text was updated successfully, but these errors were encountered: