From 50680fe559c8ae2888287c485686e2b494cb67c7 Mon Sep 17 00:00:00 2001 From: Kabir Oberai Date: Thu, 15 May 2025 23:50:53 +0530 Subject: [PATCH] comment --- Sources/XToolSupport/SDKCommand.swift | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Sources/XToolSupport/SDKCommand.swift b/Sources/XToolSupport/SDKCommand.swift index c0b5fea0..3508e037 100644 --- a/Sources/XToolSupport/SDKCommand.swift +++ b/Sources/XToolSupport/SDKCommand.swift @@ -139,6 +139,11 @@ struct DarwinSDK { } static func install(from path: String) async throws { + // we can't just move into ~/.swiftpm/swift-sdks because the swiftpm directory + // location depends on factors like $XDG_CONFIG_HOME. Rather than replicating + // SwiftPM's logic, which may change, it's more reliable to directly invoke + // `swift sdk install`. See: https://github.com/xtool-org/xtool/pull/40 + let url = URL(fileURLWithPath: path) guard DarwinSDK(bundle: url) != nil else { throw Console.Error("Invalid Darwin SDK at '\(path)'")}