THRIFT-5111: Upgrade rust to 1.36.0
Client: Rust
Patch: Jano Svitok
This closes #2050
Also contains portions of THRIFT-4547: Upgrade Swift in docker to 5.1.4
Client: Swift
Patch: Jano Svitok
Linux version 4.2.0 does not have FileHandle.acceptConnectionInBackgroundAndNotify()
implemented. We need at least 5.1 for TSocketServer to run in docker.
In the meantime, URLRequest was moved to FoundationNetworking.
To keep compatibility with previous versions, conditional import is
used.
diff --git a/lib/swift/Sources/THTTPSessionTransport.swift b/lib/swift/Sources/THTTPSessionTransport.swift
index 3c0af8e..f66da92 100644
--- a/lib/swift/Sources/THTTPSessionTransport.swift
+++ b/lib/swift/Sources/THTTPSessionTransport.swift
@@ -18,8 +18,15 @@
*/
import Foundation
-import Dispatch
+// Conditional import for URLRequest
+// It was moved from Foundation to FoundationNetworking in 5.1, but
+// not on Darwin. See https://stackoverflow.com/a/58606520
+#if canImport(FoundationNetworking)
+import FoundationNetworking
+#endif
+
+import Dispatch
public class THTTPSessionTransport: TAsyncTransport {
public class Factory : TAsyncTransportFactory {