Installing a cask requiring a different architecture causes softlock
Bug Report
Mandatory Information
Describe the bug When installing a cask that requires an architecture different from the computer's (e.g. trying to install an Apple Silicon app on an Intel Mac), Cork gets stuck at "Building Dependency Graph..." instead of cancelling the installation, even though the operation output recognises that an error has occurred. Since there's no way to manually cancel the operation, Cork becomes stuck and needs to be force quit.
To Reproduce While using an Intel MacBook Air, I tried installing the cask Nightshade with Cork.
Expected Behavior Cork would automatically terminate the process upon encountering the error.
Screenshots
System and Cork Information:
- macOS version: 14.3 (23D56)
- Cork Version: 1.3.3.1 (50)
- Did you compile Cork yourself?: Yes
Optional Information
Additional context Nil
Checklist
- [x] I filled everything out under Mandatory Information
- [x] This bug affects the UI and I have included a screenshot
Thanks, I'll add the condition
Could you please try the branch wrong-architecture-lock-fix? It should be fixed
Unfortunately, it still seems to have the same error. From what I understand there's supposed to be some button appearing, but I didn't notice any.
There's supposed to be a new state triggered for this output. See line 211 here: https://github.com/buresdv/Cork/blob/wrong-architecture-lock-fix/Cork/Logic/Installation%20&%20Removal/Installation/Install%20Selected%20Packages.swift
Can you post the console output in Xcode when you trigger this state?
Packages to install: [Cork.PackageInProgressOfBeingInstalled(id: 12C8ED7A-BF2E-4AD8-9592-8A5C12B2591F, package: Cork.BrewPackage(id: FE977E10-AC51-406C-8ECA-429DA91DF54E, name: "nightshade", isCask: true, isTagged: false, installedOn: nil, versions: [], installedIntentionally: true, sizeInBytes: nil, isBeingModified: false), installationStage: Ready, packageInstallationProgress: 0.0, realTimeTerminalOutput: [])]
[Cork.PackageInProgressOfBeingInstalled(id: 12C8ED7A-BF2E-4AD8-9592-8A5C12B2591F, package: Cork.BrewPackage(id: FE977E10-AC51-406C-8ECA-429DA91DF54E, name: "nightshade", isCask: true, isTagged: false, installedOn: nil, versions: [], installedIntentionally: true, sizeInBytes: nil, isBeingModified: false), installationStage: Ready, packageInstallationProgress: 0.0, realTimeTerminalOutput: [])]
Installing package nightshade
Package is Cask
Installing package nightshade
Final environment: ["HOMEBREW_NO_INSTALL_CLEANUP": "TRUE", "HOME": "/Users/ryanwee"]
Line had error: Error: Cask nightshade depends on hardware architecture being one of [{:type=>:arm, :bits=>64}], but you are running {:type=>:intel, :bits=>64}.
Started Formula loading task at 2024-04-01 09:23:02 +0000
I don't know much about Swift but this might be useful:
This might fix it
Yep
Thanks a lot! Yes, it turns out that I accidentaly used the wrong characters in the REGEX. I pushed some updates that should fix it, can you try again with the current state of the branch?
Yep, works now
Great to hear, I'll merge it and it will be in the next release 😊