Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix runtimes download after iOS18/cryptexDiskImage introduction #371

Closed
wants to merge 1 commit into from
Closed
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: 2 additions & 1 deletion Sources/XcodesKit/Models+Runtimes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ struct DownloadableRuntimesResponse: Decodable {
public struct DownloadableRuntime: Decodable {
let category: Category
let simulatorVersion: SimulatorVersion
let source: String
let source: String?
let dictionaryVersion: Int
let contentType: ContentType
let platform: Platform
Expand Down Expand Up @@ -79,6 +79,7 @@ extension DownloadableRuntime {
enum ContentType: String, Decodable {
case diskImage = "diskImage"
case package = "package"
case cryptexDiskImage = "cryptexDiskImage"
}

enum Platform: String, Decodable {
Expand Down
4 changes: 3 additions & 1 deletion Sources/XcodesKit/RuntimeInstaller.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ public class RuntimeInstaller {
try await installFromPackage(dmgUrl: dmgUrl, runtime: matchedRuntime)
case .diskImage:
try await installFromImage(dmgUrl: dmgUrl)
default:
break
}
if shouldDelete {
Current.logging.log("Deleting Archive")
Expand Down Expand Up @@ -183,7 +185,7 @@ public class RuntimeInstaller {

@MainActor
public func downloadOrUseExistingArchive(runtime: DownloadableRuntime, to destinationDirectory: Path, downloader: Downloader) async throws -> URL {
let url = URL(string: runtime.source)!
let url = URL(string: runtime.source!)!
let destination = destinationDirectory/url.lastPathComponent
let aria2DownloadMetadataPath = destination.parent/(destination.basename() + ".aria2")
var aria2DownloadIsIncomplete = false
Expand Down