Closed MaxDesiatov closed 9 months ago
@swift-ci test
Can we make HTTPTypesFoundation module completely unavailable on WASI?
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 https://github.com/apple/swift-package-manager/pull/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 would it be possible to tag a new patch release with this change? Thank you!
Sure, just waiting for one more change
Thank you, much appreciated!
This package currently doesn't build for WASI, as it refers to platform-specific types like
URLSession
,URLRequest
, andURLResponse
types not guarded by OS checks. With these new checks the package builds forwasm32-unknown-wasi
triple successfully.