Skip to content
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

Fix package not building for WASI #41

Merged
merged 1 commit into from Jan 12, 2024
Merged

Fix package not building for WASI #41

merged 1 commit into from Jan 12, 2024

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
Collaborator

@swift-ci test

@guoye-zhang
Copy link
Collaborator

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 apple/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
3 checks passed
@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
Collaborator

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.

None yet

2 participants