Cork icon indicating copy to clipboard operation
Cork copied to clipboard

Installing a cask requiring a different architecture causes softlock

Open LowBudgetReference opened this issue 2 years ago • 11 comments

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 Screenshot 2024-02-02 at 17 45 16@2x

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

LowBudgetReference avatar Feb 02 '24 09:02 LowBudgetReference

Thanks, I'll add the condition

buresdv avatar Feb 08 '24 17:02 buresdv

Could you please try the branch wrong-architecture-lock-fix? It should be fixed

buresdv avatar Mar 31 '24 18:03 buresdv

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. Screenshot 2024-04-01 at 17 01 45@2x

LowBudgetReference avatar Apr 01 '24 09:04 LowBudgetReference

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?

buresdv avatar Apr 01 '24 09:04 buresdv

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

LowBudgetReference avatar Apr 01 '24 09:04 LowBudgetReference

I don't know much about Swift but this might be useful: Screenshot 2024-04-01 at 17 33 06@2x

LowBudgetReference avatar Apr 01 '24 09:04 LowBudgetReference

This might fix it Screenshot 2024-04-01 at 17 37 04@2x

LowBudgetReference avatar Apr 01 '24 09:04 LowBudgetReference

Yep Screenshot 2024-04-01 at 17 40 32@2x

LowBudgetReference avatar Apr 01 '24 09:04 LowBudgetReference

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?

buresdv avatar Apr 01 '24 10:04 buresdv

Yep, works now

LowBudgetReference avatar Apr 01 '24 10:04 LowBudgetReference

Great to hear, I'll merge it and it will be in the next release 😊

buresdv avatar Apr 01 '24 10:04 buresdv