Heroic-Games-Launcher / HeroicGamesLauncher

A games launcher for GOG, Amazon and Epic Games for Linux, Windows and macOS.
https://heroicgameslauncher.com
GNU General Public License v3.0
8.22k stars 429 forks source link

[macOS] Heroic Should show a warning if Rosetta is not installed #3292

Open benzado opened 11 months ago

benzado commented 11 months ago

Describe the bug

When using the macOS Apple Silicon build, various actions trigger a dialog like this:

Nile

Error:

Error running command "NILE_CONFIG_PATH="/Users/benzado/Library/Application Support/heroic/nile_config" /Applications/Heroic.app/Contents/Resources/app.asar.unpacked/build/bin/darwin/nile --version": Error: spawn Unknown system error -86
at ChildProcess.spawn (node:internal/child_process:413:11)
at Object.spawn (node:child_process:783:9)
at /Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:96:273
at new Promise (<anonymous>)
at callRunner (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:96:231)
at runRunnerCommand$2 (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:82:7196)
at getNileVersion (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:128:2825)
at WebContents.<anonymous> (node:electron/js2c/browser_init:2:89008)
at WebContents.emit (node:events:514:28)

Add logs

(00:53:49) INFO:    [Legendary]:        Legendary location: /Applications/Heroic.app/Contents/Resources/app.asar.unpacked/build/bin/darwin/legendary
(00:53:49) INFO:    [Gog]:              GOGDL location: /Applications/Heroic.app/Contents/Resources/app.asar.unpacked/build/bin/darwin/gogdl
(00:53:49) INFO:    [Connection]:       Connectivity: check-online
(00:53:49) INFO:    [Connection]:       Pinging external endpoints
(00:53:49) INFO:    [Backend]:          DRM module staus {
  "oimompecagnajdejgnnjijobebaeigek": {
    "name": "Widevine Content Decryption Module",
    "status": "new",
    "version": "4.10.2710.0"
  }
}
(00:53:49) WARNING: [Backend]:          Protocol already registered.
(00:53:49) INFO:    [Legendary]:        Running command: LEGENDARY_CONFIG_PATH="/Users/benzado/Library/Application Support/heroic/legendaryConfig/legendary" /Applications/Heroic.app/Contents/Resources/app.asar.unpacked/build/bin/darwin/legendary --version
(00:53:49) INFO:    [Gog]:              Running command: /Applications/Heroic.app/Contents/Resources/app.asar.unpacked/build/bin/darwin/gogdl --auth-config-path "/Users/benzado/Library/Application Support/heroic/gog_store/auth.json" --version
(00:53:49) INFO:    [Nile]:             Running command: NILE_CONFIG_PATH="/Users/benzado/Library/Application Support/heroic/nile_config" /Applications/Heroic.app/Contents/Resources/app.asar.unpacked/build/bin/darwin/nile --version
(00:53:49) ERROR:   [Legendary]:        Error running command "LEGENDARY_CONFIG_PATH="/Users/benzado/Library/Application Support/heroic/legendaryConfig/legendary" /Applications/Heroic.app/Contents/Resources/app.asar.unpacked/build/bin/darwin/legendary --version": Error: spawn Unknown system error -86
    at ChildProcess.spawn (node:internal/child_process:413:11)
    at Object.spawn (node:child_process:783:9)
    at /Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:96:273
    at new Promise (<anonymous>)
    at callRunner (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:96:231)
    at runRunnerCommand (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:98:8771)
    at getLegendaryVersion (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:128:2419)
    at getSystemInfo (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:128:3164)
(00:53:49) ERROR:   [Gog]:              Error running command "/Applications/Heroic.app/Contents/Resources/app.asar.unpacked/build/bin/darwin/gogdl --auth-config-path "/Users/benzado/Library/Application Support/heroic/gog_store/auth.json" --version": Error: spawn Unknown system error -86
    at ChildProcess.spawn (node:internal/child_process:413:11)
    at Object.spawn (node:child_process:783:9)
    at /Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:96:273
    at new Promise (<anonymous>)
    at callRunner (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:96:231)
    at runRunnerCommand$3 (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:3:14626)
    at getGogdlVersion (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:128:2682)
    at getSystemInfo (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:128:3186)
(00:53:49) ERROR:   [Nile]:             Error running command "NILE_CONFIG_PATH="/Users/benzado/Library/Application Support/heroic/nile_config" /Applications/Heroic.app/Contents/Resources/app.asar.unpacked/build/bin/darwin/nile --version": Error: spawn Unknown system error -86
    at ChildProcess.spawn (node:internal/child_process:413:11)
    at Object.spawn (node:child_process:783:9)
    at /Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:96:273
    at new Promise (<anonymous>)
    at callRunner (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:96:231)
    at runRunnerCommand$2 (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:82:7196)
    at getNileVersion (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:128:2825)
    at getSystemInfo (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:128:3204)
(00:53:49) INFO:    [Backend]:          
System Information:
CPU: 10x Apple M2 Pro
Memory: 17.18 GB (used: 6.89 GB)
GPUs:

OS:  14.1.2 (darwin)

The current system is not a Steam Deck
We are not running inside a Flatpak container

Software Versions:
  Heroic: 2.11.0 Kumachi
  Legendary: invalid
  gogdl: invalid
  Nile: invalid

(00:53:49) INFO:    [Connection]:       Connectivity: online
(00:53:49) INFO:    [Backend]:          User Not Found, removing it from Store
(00:53:49) ERROR:   [Gog]:              Unable to syncQueued playtime, userData not present
(00:53:49) INFO:    [Backend]:          AreWeAntiCheatYet data downloaded
(00:53:49) INFO:    [Backend]:          Loading Screen Ready
(00:53:49) INFO:    [Backend]:          Frontend Ready
(00:53:49) INFO:    [Backend]:          Checking for new Heroic Updates
(00:53:49) INFO:    [Backend]:          Checking for current version changelog
(00:53:51) INFO:    [GlobalConfig]:     Searching for Gaming Porting Toolkit Wine
(00:53:51) INFO:    [Winetricks]:       Downloading Winetricks
(00:53:54) INFO:    [WineDownloader]:   Updating wine versions info
(00:53:54) INFO:    [WineDownloader]:   Fetching upstream information...
(00:53:54) INFO:    [Backend]:          Starting the Download Queue
(00:53:55) INFO:    [WineDownloader]:   wine versions updated
(00:54:05) INFO:    [Legendary]:        Running command: LEGENDARY_CONFIG_PATH="/Users/benzado/Library/Application Support/heroic/legendaryConfig/legendary" /Applications/Heroic.app/Contents/Resources/app.asar.unpacked/build/bin/darwin/legendary --version
(00:54:05) ERROR:   [Legendary]:        Error running command "LEGENDARY_CONFIG_PATH="/Users/benzado/Library/Application Support/heroic/legendaryConfig/legendary" /Applications/Heroic.app/Contents/Resources/app.asar.unpacked/build/bin/darwin/legendary --version": Error: spawn Unknown system error -86
    at ChildProcess.spawn (node:internal/child_process:413:11)
    at Object.spawn (node:child_process:783:9)
    at /Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:96:273
    at new Promise (<anonymous>)
    at callRunner (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:96:231)
    at runRunnerCommand (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:98:8771)
    at getLegendaryVersion (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:128:2419)
    at WebContents.<anonymous> (node:electron/js2c/browser_init:2:89008)
    at WebContents.emit (node:events:514:28)
(00:54:05) INFO:    [Gog]:              Running command: /Applications/Heroic.app/Contents/Resources/app.asar.unpacked/build/bin/darwin/gogdl --auth-config-path "/Users/benzado/Library/Application Support/heroic/gog_store/auth.json" --version
(00:54:05) ERROR:   [Gog]:              Error running command "/Applications/Heroic.app/Contents/Resources/app.asar.unpacked/build/bin/darwin/gogdl --auth-config-path "/Users/benzado/Library/Application Support/heroic/gog_store/auth.json" --version": Error: spawn Unknown system error -86
    at ChildProcess.spawn (node:internal/child_process:413:11)
    at Object.spawn (node:child_process:783:9)
    at /Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:96:273
    at new Promise (<anonymous>)
    at callRunner (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:96:231)
    at runRunnerCommand$3 (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:3:14626)
    at getGogdlVersion (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:128:2682)
    at WebContents.<anonymous> (node:electron/js2c/browser_init:2:89008)
    at WebContents.emit (node:events:514:28)
(00:54:05) INFO:    [Nile]:             Running command: NILE_CONFIG_PATH="/Users/benzado/Library/Application Support/heroic/nile_config" /Applications/Heroic.app/Contents/Resources/app.asar.unpacked/build/bin/darwin/nile --version
(00:54:05) ERROR:   [Nile]:             Error running command "NILE_CONFIG_PATH="/Users/benzado/Library/Application Support/heroic/nile_config" /Applications/Heroic.app/Contents/Resources/app.asar.unpacked/build/bin/darwin/nile --version": Error: spawn Unknown system error -86
    at ChildProcess.spawn (node:internal/child_process:413:11)
    at Object.spawn (node:child_process:783:9)
    at /Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:96:273
    at new Promise (<anonymous>)
    at callRunner (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:96:231)
    at runRunnerCommand$2 (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:82:7196)
    at getNileVersion (/Applications/Heroic.app/Contents/Resources/app.asar/build/electron/main.52896897.js:128:2825)
    at WebContents.<anonymous> (node:electron/js2c/browser_init:2:89008)
    at WebContents.emit (node:events:514:28)

Steps to reproduce

  1. Launch Heroic
  2. Click "Settings" then "Advanced"
  3. The "Nile" error appears

Expected behavior

Error does not appear.

Screenshots

No response

Heroic Version

Latest Stable

System Information

% uname -a
Darwin MB231021 23.1.0 Darwin Kernel Version 23.1.0: Mon Oct  9 21:28:45 PDT 2023; root:xnu-10002.41.9~6/RELEASE_ARM64_T6020 arm64

Additional information

I believe this problem is due to Intel-only binaries being bundled with the "Apple Chips" version of the Heroic app. I am able to confirm on my system that, although the main app binary targets arm64, several bundled tools are x86_64:

% file /Applications/Heroic.app/Contents/MacOS/Heroic 
/Applications/Heroic.app/Contents/MacOS/Heroic: Mach-O 64-bit executable arm64
% file /Applications/Heroic.app/Contents/Resources/app.asar.unpacked/build/bin/darwin/*
/Applications/Heroic.app/Contents/Resources/app.asar.unpacked/build/bin/darwin/gogdl:     Mach-O 64-bit executable x86_64
/Applications/Heroic.app/Contents/Resources/app.asar.unpacked/build/bin/darwin/legendary: Mach-O 64-bit executable x86_64
/Applications/Heroic.app/Contents/Resources/app.asar.unpacked/build/bin/darwin/nile:      Mach-O 64-bit executable x86_64

Using man errno we can find the explanation for the error code:

86 EBADARCH Bad CPU type in executable. The executable in question does not support the current CPU.

I expect that systems with Rosetta installed will transparently launch the Intel binaries and the problem will not be reproducible.

flavioislima commented 11 months ago

Yes, heroic itself it built for apple silicon but the other binaries that it uses like legendary, nile and gogdl doesn't. That's because github doesn't offer arm64 runners for free.

I will try to built those binaries myself on a M1 for the next release, but we have no way to automate it for now.

benzado commented 11 months ago

I would strongly recommend against doing it manually, even if it's not much trouble now you're making yourself a part of the build pipeline and, in my experience, that always makes technology problems into personal problems. For a free software project, that's not worth it.

I think it would be reasonable to simply warn that the Apple Silicon build requires Rosetta (for now). It would be good to get a pure arm64 build working eventually, but are there even many compatible games ready at this point?

It should be theoretically possible to cross-compile arm64 binaries without using an arm64 runner (after all, that's how the main binary is being created, right?) but I can understand if figuring out how to do that isn't top priority.

I'm not part of the project, so it's not up to me, but I'd be happy if this bug was closed by having the main app recognize error code 86 and put up a more friendly error message explaining that Rosetta is required by that component.

imLinguin commented 11 months ago

Games require Rosetta nevertheless I haven't seen that much arm64 builds. I also doubt old ones were updated

flavioislima commented 11 months ago

@benzado yes, perhaps we should detect if Rosetta is installed and show a warning if it is not, with a link on a how to install.

@imLinguin that's also a good point, most games won't work at all.

At the same time, having those binaries compiled to the architecture will make them run faster for things like loading the library, etc.