Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .github/workflows/common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
permissions:
contents: read
packages: read
env:
CURRENT_SDK: y
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand Down Expand Up @@ -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
Expand Down
23 changes: 8 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand All @@ -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

Expand Down
3 changes: 0 additions & 3 deletions Sources/CLI/Application.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
6 changes: 1 addition & 5 deletions Sources/Helpers/NetworkVmnet/NetworkVmnetHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -47,4 +46,3 @@ struct NonisolatedInterfaceStrategy: InterfaceStrategy {
return NATNetworkInterface(address: attachment.address, gateway: attachment.gateway, reference: networkRef)
}
}
#endif
4 changes: 0 additions & 4 deletions Sources/Helpers/RuntimeLinux/RuntimeLinuxHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) })
}
}
Expand Down Expand Up @@ -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
3 changes: 0 additions & 3 deletions scripts/make-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down