From 0e679fd348bf49e8943efdd166e6856d1aff3d42 Mon Sep 17 00:00:00 2001 From: JP Simard Date: Tue, 8 Mar 2022 11:44:42 -0500 Subject: [PATCH] Log hints about experimental unxip flag when unarchiving Co-authored-by: Matt Kiazyk --- Sources/XcodesKit/XcodeInstaller.swift | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/Sources/XcodesKit/XcodeInstaller.swift b/Sources/XcodesKit/XcodeInstaller.swift index fc3171d..81aba81 100644 --- a/Sources/XcodesKit/XcodeInstaller.swift +++ b/Sources/XcodesKit/XcodeInstaller.swift @@ -80,7 +80,7 @@ public final class XcodeInstaller { /// A numbered step enum InstallationStep: CustomStringConvertible { case downloading(version: String, progress: String?, willInstall: Bool) - case unarchiving + case unarchiving(experimentalUnxip: Bool) case moving(destination: String) case trashingArchive(archiveName: String) case checkingSecurity @@ -103,8 +103,15 @@ public final class XcodeInstaller { } else { return "Downloading Xcode \(version)" } - case .unarchiving: - return "Unarchiving Xcode (This can take a while)" + case .unarchiving(let experimentalUnxip): + let hint = experimentalUnxip ? + "Using experimental unxip. If you encounter any issues, remove the flag and try again" : + "Using regular unxip. Try passing `--experimental-unxip` for a faster unxip process" + return + """ + Unarchiving Xcode (This can take a while) + \(hint) + """ case .moving(let destination): return "Moving Xcode to \(destination)" case .trashingArchive(let archiveName): @@ -720,7 +727,7 @@ public final class XcodeInstaller { func unarchiveAndMoveXIP(at source: URL, to destination: URL, experimentalUnxip: Bool) -> Promise { return firstly { () -> Promise in - Current.logging.log(InstallationStep.unarchiving.description) + Current.logging.log(InstallationStep.unarchiving(experimentalUnxip: experimentalUnxip).description) if experimentalUnxip, #available(macOS 11, *) { return Promise { seal in