From 17a1a3e2c7549517ebc69ec3763bf10d875b148a Mon Sep 17 00:00:00 2001 From: Kathryn Baldauf Date: Fri, 5 Sep 2025 11:55:36 -0700 Subject: [PATCH] Allow kernel set with tar to use relative paths to tar file (#582) ## Type of Change - [x] Bug fix ## Description Allow kernel set with tar to use relative paths to tar file. Fixes https://github.com/apple/container/issues/573. ## Motivation and Context `absoluteString` will prefix a scheme to the file path that looks like "file://". This will cause file manager to fail to find the file at the file path even if it exists. Change to instead just get the `path` of the file, which does not add a scheme prefix. ## Testing - [x] Tested locally Signed-off-by: Kathryn Baldauf --- Sources/CLI/System/Kernel/KernelSet.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/CLI/System/Kernel/KernelSet.swift b/Sources/CLI/System/Kernel/KernelSet.swift index a63a4c4d..2fe18561 100644 --- a/Sources/CLI/System/Kernel/KernelSet.swift +++ b/Sources/CLI/System/Kernel/KernelSet.swift @@ -77,7 +77,7 @@ extension Application { throw ArgumentParser.ValidationError("Missing argument '--tar") } let platform = try getSystemPlatform() - let localTarPath = URL(fileURLWithPath: tarPath, relativeTo: .currentDirectory()).absoluteString + let localTarPath = URL(fileURLWithPath: tarPath, relativeTo: .currentDirectory()).path let fm = FileManager.default if fm.fileExists(atPath: localTarPath) { try await ClientKernel.installKernelFromTar(tarFile: localTarPath, kernelFilePath: binaryPath, platform: platform, force: force)