Skip to content

Conversation

@MaxDesiatov
Copy link
Member

@MaxDesiatov MaxDesiatov commented Jan 11, 2024

This package currently doesn't build for WASI, as it refers to platform-specific types like URLSession, URLRequest, and URLResponse types not guarded by OS checks. With these new checks the package builds for wasm32-unknown-wasi triple successfully.

@MaxDesiatov MaxDesiatov changed the title Fix building for WASI Fix package not building for WASI Jan 11, 2024
@guoye-zhang
Copy link
Contributor

@swift-ci test

@guoye-zhang
Copy link
Contributor

Can we make HTTPTypesFoundation module completely unavailable on WASI?

@MaxDesiatov
Copy link
Member Author

Even though URLSession is not available on WASI, HTTPRequest is. One would be able to pass that type to some other HTTP client that's not URLSession. Hence there's still value in keeping that extension on HTTPRequest available.

Additionally, there's no clean way to exclude a single platform from a given package graph in SwiftPM. Until something like swiftlang/swift-package-manager#7084 is merged, we can't reliably enumerate all platforms and exclude WASI from that list. You'd have to update Package.swift every time a new supported platform is added to SwiftPM.

@guoye-zhang guoye-zhang merged commit 782b1bf into apple:main Jan 12, 2024
@MaxDesiatov MaxDesiatov deleted the maxd/fix-wasi-builds branch January 12, 2024 12:45
@MaxDesiatov
Copy link
Member Author

@guoye-zhang would it be possible to tag a new patch release with this change? Thank you!

@guoye-zhang
Copy link
Contributor

Sure, just waiting for one more change

@MaxDesiatov
Copy link
Member Author

Thank you, much appreciated!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants