mirror of
https://github.com/apple/container.git
synced 2026-09-25 07:39:36 -05:00
Remove the support for CURRENT_SDK (#251)
This PR removes the no longer needed support for `CURRENT_SDK`.
This commit is contained in:
@@ -302,9 +302,6 @@ extension Application {
|
||||
#if DEBUG
|
||||
versionDetails["build"] = "debug"
|
||||
#endif
|
||||
#if CURRENT_SDK
|
||||
versionDetails["sdk"] = "macOS 15"
|
||||
#endif
|
||||
let gitCommit = {
|
||||
let sha = get_git_commit().map { String(cString: $0) }
|
||||
guard let sha else {
|
||||
|
||||
@@ -105,15 +105,11 @@ extension NetworkVmnetHelper {
|
||||
}
|
||||
|
||||
private static func createNetwork(configuration: NetworkConfiguration, log: Logger) throws -> Network {
|
||||
guard #available(macOS 16, *) else {
|
||||
guard #available(macOS 26, *) else {
|
||||
return try AllocationOnlyVmnetNetwork(configuration: configuration, log: log)
|
||||
}
|
||||
|
||||
#if !CURRENT_SDK
|
||||
return try ReservedVmnetNetwork(configuration: configuration, log: log)
|
||||
#else
|
||||
return try AllocationOnlyVmnetNetwork(configuration: configuration, log: log)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,6 @@ import Logging
|
||||
import Virtualization
|
||||
import vmnet
|
||||
|
||||
#if !CURRENT_SDK
|
||||
/// Interface strategy for containers that use macOS's custom network feature.
|
||||
@available(macOS 26, *)
|
||||
struct NonisolatedInterfaceStrategy: InterfaceStrategy {
|
||||
@@ -47,4 +46,3 @@ struct NonisolatedInterfaceStrategy: InterfaceStrategy {
|
||||
return NATNetworkInterface(address: attachment.address, gateway: attachment.gateway, reference: networkRef)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -63,15 +63,11 @@ struct RuntimeLinuxHelper: AsyncParsableCommand {
|
||||
|
||||
log.info("configuring XPC server")
|
||||
let interfaceStrategy: any InterfaceStrategy
|
||||
#if !CURRENT_SDK
|
||||
if #available(macOS 26, *) {
|
||||
interfaceStrategy = NonisolatedInterfaceStrategy(log: log)
|
||||
} else {
|
||||
interfaceStrategy = IsolatedInterfaceStrategy()
|
||||
}
|
||||
#else
|
||||
interfaceStrategy = IsolatedInterfaceStrategy()
|
||||
#endif
|
||||
let server = SandboxService(root: .init(fileURLWithPath: root), interfaceStrategy: interfaceStrategy, log: log)
|
||||
let xpc = XPCServer(
|
||||
identifier: machServiceLabel,
|
||||
|
||||
@@ -26,9 +26,8 @@ import SystemConfiguration
|
||||
import XPC
|
||||
import vmnet
|
||||
|
||||
#if !CURRENT_SDK
|
||||
/// Creates a vmnet network with reservation APIs.
|
||||
@available(macOS 16, *)
|
||||
@available(macOS 26, *)
|
||||
public final class ReservedVmnetNetwork: Network {
|
||||
@SendableProperty
|
||||
private var _state: NetworkState
|
||||
@@ -61,7 +60,7 @@ public final class ReservedVmnetNetwork: Network {
|
||||
}
|
||||
|
||||
public nonisolated func withAdditionalData(_ handler: (XPCMessage?) throws -> Void) throws {
|
||||
try networkLock.lock {
|
||||
try networkLock.withLock {
|
||||
try handler(network.map { try Self.serialize_network_ref(ref: $0) })
|
||||
}
|
||||
}
|
||||
@@ -149,14 +148,3 @@ public final class ReservedVmnetNetwork: Network {
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
extension NSLock {
|
||||
/// lock during the execution of the provided function
|
||||
fileprivate func lock<T>(_ fn: () throws -> T) rethrows -> T {
|
||||
self.lock()
|
||||
defer { self.unlock() }
|
||||
|
||||
return try fn()
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user