Skip to content

Conversation

@scottmarchant
Copy link
Contributor

@scottmarchant scottmarchant commented Oct 22, 2025

Fix Swift for WebAssembly compilation in NIOCore and NIOFoundationCompat.

Motivation:

NIO is a common dependency, and it is important to enable compiling NIO using Swift for WebAssembly. This PR fixes compilation for NIOCore and NIOFoundationCompat.

Modifications:

  • Fix NIOCore compilation
  • Fix NIOFoundationCompat compilation

Result:

With these changes, the following build commands succeed: ✅

swift build --swift-sdk wasm32-unknown-wasip1-threads --target NIOCore
swift build --swift-sdk wasm32-unknown-wasip1-threads --target NIOFoundationCompat

Context:

This PR is part of a larger effort by PassiveLogic to improve Swift for WebAssembly support

@scottmarchant
Copy link
Contributor Author

@MaxDesiatov @kateinoigakukun in case you're interested, I'm fixing Swift for WebAssembly compilation for NIOCore and NIOFoundationCompat in this PR.

"Bad interface address family"
case let .illegalMulticastAddress(address):
"Illegal multicast address \(address)"
#if !os(WASI)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oddly enough, a previous fix for this compiler error no longer seems to be in main. Not sure why.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's pretty likely it got lost in a merge conflict. The perils of not having a running CI job.

Copy link
Member

@MaxDesiatov MaxDesiatov Oct 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the holdup with the Wasm job? I though we had one enabled here already...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did this get reverted somehow or how did it not catch the issue? #3332

Copy link
Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one, thanks!

"Bad interface address family"
case let .illegalMulticastAddress(address):
"Illegal multicast address \(address)"
#if !os(WASI)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's pretty likely it got lost in a merge conflict. The perils of not having a running CI job.

@Lukasa Lukasa added the 🔨 semver/patch No public API change. label Oct 23, 2025
@Lukasa
Copy link
Contributor

Lukasa commented Oct 23, 2025

This needs to be updated to the latest main. It may be helpful to get maintainers write access to your PR branches, as that allows me to make catch-up merges to main when a prior PR is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🔨 semver/patch No public API change.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants