mirror of
https://github.com/apple/container.git
synced 2026-07-16 22:47:09 +00:00
Remove the support for CURRENT_SDK (#251)
This PR removes the no longer needed support for `CURRENT_SDK`.
This commit is contained in:
@@ -17,8 +17,6 @@ jobs:
|
||||
permissions:
|
||||
contents: read
|
||||
packages: read
|
||||
env:
|
||||
CURRENT_SDK: y
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
@@ -73,7 +71,6 @@ jobs:
|
||||
make test cleancontent install-kernel integration
|
||||
env:
|
||||
DEVELOPER_DIR: "/Applications/Xcode_26.b1.app/Contents/Developer"
|
||||
CURRENT_SDK: y # explicitly repeated due to local env block
|
||||
|
||||
- name: Save documentation artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
|
||||
@@ -28,12 +28,6 @@ DSYM_DIR := bin/$(BUILD_CONFIGURATION)/bundle/container-dSYM
|
||||
DSYM_PATH := bin/$(BUILD_CONFIGURATION)/bundle/container-dSYM.zip
|
||||
CODESIGN_OPTS ?= --force --sign - --timestamp=none
|
||||
|
||||
ifeq (,$(CURRENT_SDK))
|
||||
CURRENT_SDK_ARGS :=
|
||||
else
|
||||
CURRENT_SDK_ARGS := -Xswiftc -DCURRENT_SDK
|
||||
endif
|
||||
|
||||
MACOS_VERSION := $(shell sw_vers -productVersion)
|
||||
MACOS_MAJOR := $(shell echo $(MACOS_VERSION) | cut -d. -f1)
|
||||
|
||||
@@ -49,8 +43,7 @@ all: init-block
|
||||
.PHONY: build
|
||||
build:
|
||||
@echo Building container binaries...
|
||||
@#Remove this when the updated macOS SDK is available publicly
|
||||
$(SWIFT) build -c $(BUILD_CONFIGURATION) $(CURRENT_SDK_ARGS) ; \
|
||||
@$(SWIFT) build -c $(BUILD_CONFIGURATION)
|
||||
|
||||
.PHONY: container
|
||||
container: build
|
||||
@@ -126,7 +119,7 @@ dsym:
|
||||
|
||||
.PHONY: test
|
||||
test:
|
||||
@$(SWIFT) test -c $(BUILD_CONFIGURATION) $(CURRENT_SDK_ARGS) --skip TestCLI
|
||||
@$(SWIFT) test -c $(BUILD_CONFIGURATION) --skip TestCLI
|
||||
|
||||
.PHONY: install-kernel
|
||||
install-kernel:
|
||||
@@ -143,12 +136,12 @@ integration: init-block
|
||||
@echo "Removing any existing containers"
|
||||
@bin/container rm --all
|
||||
@echo "Starting CLI integration tests"
|
||||
@$(SWIFT) test -c $(BUILD_CONFIGURATION) $(CURRENT_SDK_ARGS) --filter TestCLIRunLifecycle
|
||||
@$(SWIFT) test -c $(BUILD_CONFIGURATION) $(CURRENT_SDK_ARGS) --filter TestCLIExecCommand
|
||||
@$(SWIFT) test -c $(BUILD_CONFIGURATION) $(CURRENT_SDK_ARGS) --filter TestCLIRunCommand
|
||||
@$(SWIFT) test -c $(BUILD_CONFIGURATION) $(CURRENT_SDK_ARGS) --filter TestCLIImagesCommand
|
||||
@$(SWIFT) test -c $(BUILD_CONFIGURATION) $(CURRENT_SDK_ARGS) --filter TestCLIRunBase
|
||||
@$(SWIFT) test -c $(BUILD_CONFIGURATION) $(CURRENT_SDK_ARGS) --filter TestCLIBuildBase
|
||||
@$(SWIFT) test -c $(BUILD_CONFIGURATION) --filter TestCLIRunLifecycle
|
||||
@$(SWIFT) test -c $(BUILD_CONFIGURATION) --filter TestCLIExecCommand
|
||||
@$(SWIFT) test -c $(BUILD_CONFIGURATION) --filter TestCLIRunCommand
|
||||
@$(SWIFT) test -c $(BUILD_CONFIGURATION) --filter TestCLIImagesCommand
|
||||
@$(SWIFT) test -c $(BUILD_CONFIGURATION) --filter TestCLIRunBase
|
||||
@$(SWIFT) test -c $(BUILD_CONFIGURATION) --filter TestCLIBuildBase
|
||||
@echo Ensuring apiserver stopped after the CLI integration tests...
|
||||
@scripts/ensure-container-stopped.sh
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -14,9 +14,6 @@
|
||||
# limitations under the License.
|
||||
|
||||
opts=()
|
||||
if [ ! -z "${CURRENT_SDK}" ] ; then
|
||||
opts+=("-Xswiftc" "-DCURRENT_SDK")
|
||||
fi
|
||||
opts+=("--allow-writing-to-directory" "$1")
|
||||
opts+=("generate-documentation")
|
||||
opts+=("--target" "ContainerSandboxService")
|
||||
|
||||
Reference in New Issue
Block a user