Run Windows games on Apple Silicon — free, open source, with an open compatibility database that tells you what actually works.
Swift apple-silicond3dmetaldxmtdxvkfexgame-porting-toolkitgamingmac-gamingmacosmetalmoltenvksteamswiftuivkd3d-protonwhisky-alternativewindows-gameswinewine-wrapper
An Epic install legendary refuses says why. legendary prints its reason as a CRITICAL or ERROR line, most often "Not enough available disk space! <free> MiB < <needed> MiB", and exits 1, which reached the player as only "epic install exited with 1, see the log above" (highball#409, Red Dead Redemption 2, well over 100 GB). EpicStore.installFailure turns the first such line into a sentence, with the sizes in GB for the disk space check, and the install's error shows it.
Gauthier Piarrette69b9ed76d593
diff --git a/Sources/HighballApp/AppState.swift b/Sources/HighballApp/AppState.swiftindex 848c5ac..1b76526 100644--- a/Sources/HighballApp/AppState.swift+++ b/Sources/HighballApp/AppState.swift@@ -2901,12 +2901,14 @@ final class AppState {let store = epicStoreepicDownloadTotal = nillet refused = OSAllocatedUnfairLock(initialState: false)+ let failure = OSAllocatedUnfairLock<String?>(initialState: nil)// Stop cancels this task, and the cancellation reaches legendary as a Ctrl-C, which// keeps the download's progress for the next Install.let status = try await withTaskCancellationHandler {try await Task.detached {try store.install(game.app_name, into: bottle, control: control) { line inif EpicStore.refusedForLock(line) { refused.withLock { $0 = true } }+ if let why = EpicStore.installFailure(line) { failure.withLock { if $0 == nil { $0 = why } } }Task { @MainActor in self.appendLog(line); self.reportEpicDownload(line) }}}.value@@ -2916,6 +2918,7 @@ final class AppState {throw HighballError.failed(L("Another Epic download is still running, and legendary installs one game at a time. If Highball shows none, one started before Highball last quit is still going, so quit legendary in Activity Monitor and press Install again."))}guard status == 0 else {+ if let why = failure.withLock({ $0 }) { throw HighballError.failed(why) }throw HighballError.processFailed(command: "epic install", status: status, output: "see the log above")}await MainActor.run { self.epicRefresh() }diff --git a/Sources/HighballKit/EpicStore.swift b/Sources/HighballKit/EpicStore.swiftindex b1b316a..f61f15d 100644--- a/Sources/HighballKit/EpicStore.swift+++ b/Sources/HighballKit/EpicStore.swift@@ -205,6 +205,24 @@ public struct EpicStore: Sendable {line.contains("Failed to acquire installed data lock")}+ /// legendary's reason for refusing an install, as a sentence for the player, from one line of its+ /// output, or nil. Its checks print "[cli] CRITICAL: Not enough available disk space! 51200.00 MiB <+ /// 123456.00 MiB" and exit 1, which reached the player as only "epic install exited with 1, see the+ /// log above" (highball#409, Red Dead Redemption 2, well over 100 GB).+ public static func installFailure(_ line: String) -> String? {+ guard let r = line.range(of: "CRITICAL: ") ?? line.range(of: "ERROR: ") else { return nil }+ let message = line[r.upperBound...].trimmingCharacters(in: .whitespaces)+ guard !message.isEmpty, !message.hasPrefix("Installation cannot proceed") else { return nil }+ if message.hasPrefix("Not enough available disk space") {+ let gb = { (bytes: Int64) in String(format: "%.0f GB", Double(bytes) / 1_073_741_824) }+ if let free = mebibytes(after: "disk space!", in: message), let needed = mebibytes(after: "< ", in: message) {+ return "This Mac doesn't have enough free space for the game. It needs \(gb(needed)) and \(gb(free)) are free. Free some space, then press Install again."+ }+ return "This Mac doesn't have enough free space for the game. Free some space, then press Install again."+ }+ return "Epic's installer stopped with this message. \(message)"+ }+/// legendary's install log names the download's size before it starts ("Download size:/// 95232.19 MiB (Compression savings: 2.1%)") and then, about once a second, how much has/// arrived (" - Downloaded: 9075.51 MiB, Written: 9415.55 MiB"). The activity strip showsdiff --git a/Tests/HighballKitTests/EpicStoreTests.swift b/Tests/HighballKitTests/EpicStoreTests.swiftindex cd4047b..25597ff 100644--- a/Tests/HighballKitTests/EpicStoreTests.swift+++ b/Tests/HighballKitTests/EpicStoreTests.swift@@ -2,6 +2,16 @@ import XCTest@testable import HighballKitfinal class EpicStoreTests: XCTestCase {+ /// highball#409: an install legendary refused reached the player as "epic install exited with 1".+ func testLegendaryInstallFailuresBecomeSentences() {+ XCTAssertEqual(EpicStore.installFailure("[cli] CRITICAL: Not enough available disk space! 51200.00 MiB < 122880.00 MiB"),+ "This Mac doesn't have enough free space for the game. It needs 120 GB and 50 GB are free. Free some space, then press Install again.")+ XCTAssertNil(EpicStore.installFailure("[cli] CRITICAL: Installation cannot proceed, exiting."), "the summary line adds nothing")+ XCTAssertEqual(EpicStore.installFailure("[cli] ERROR: Game is not owned by this account"),+ "Epic's installer stopped with this message. Game is not owned by this account")+ XCTAssertNil(EpicStore.installFailure("[cli] INFO: Download size: 95232.19 MiB (Compression savings: 2.1%)"))+ }+/// Legendary has no terminal under Highball: the selective-download prompt (optional/// language packs) raised EOFError and killed the install (#110). `-y` alone does not skip it./// legendary's lines as a GTA V Enhanced install printed them (highball#287): the size once,