kotatogram-desktop icon indicating copy to clipboard operation
kotatogram-desktop copied to clipboard

macOS arm64 binary doesn't launch

Open CodeWithShreyans opened this issue 3 years ago • 64 comments

Steps to reproduce

  1. Copy .app file from dmg to Applications folder.
  2. Right click and click open.

Expected behaviour

The app launches.

Actual behaviour

macOS says that it cant open the app. image

Operating system

macOS 12.2 Beta (21D5025f)

Version of Kotatogram Desktop

1.4.6 beta (TD 3.3)

Installation source

Static binary from official website

Logs

No response

CodeWithShreyans avatar Dec 24 '21 09:12 CodeWithShreyans

Well, we don't have mac hardware, so any help from your side on why this may happen will be highly appreciated

ilya-fedin avatar Dec 24 '21 09:12 ilya-fedin

Well that was an extremely fast reply

CodeWithShreyans avatar Dec 24 '21 09:12 CodeWithShreyans

Can you tell me some ways to find the problem? I am on an M1 Macbook Air 2020 And 1.4.4 works fine

CodeWithShreyans avatar Dec 24 '21 09:12 CodeWithShreyans

You were having some issues with macOS builds, maybe that is related?

CodeWithShreyans avatar Dec 24 '21 09:12 CodeWithShreyans

I can suggest the Linux way to get helpful logs: try to run the application from terminal. Both the .app and actual binary inside .app.

ilya-fedin avatar Dec 24 '21 09:12 ilya-fedin

You were having some issues with macOS builds, maybe that is related?

Well, 1.4.6 is built with other build method. Previously we used packages from brew, now we're using tdesktop's build scripts. That way offers support for macOS 10.12+ and native ARM support.

ilya-fedin avatar Dec 24 '21 09:12 ilya-fedin

The downside is it builds 6 hours on github actions :rofl:

ilya-fedin avatar Dec 24 '21 09:12 ilya-fedin

The application cannot be opened for an unexpected reason, error=Error Domain=RBSRequestErrorDomain Code=5 "Launch failed." UserInfo={NSLocalizedFailureReason=Launch failed., NSUnderlyingError=0x6000036c13b0 {Error Domain=NSPOSIXErrorDomain Code=153 "Unknown error: 153" UserInfo={NSLocalizedDescription=Launchd job spawn failed}}}

This error in terminal

CodeWithShreyans avatar Dec 24 '21 09:12 CodeWithShreyans

It's when try to run the .app I guess, what about the actual binary?

ilya-fedin avatar Dec 24 '21 10:12 ilya-fedin

It doesn't let it run for security reasons

CodeWithShreyans avatar Dec 24 '21 10:12 CodeWithShreyans

Can you overcome that somehow?

ilya-fedin avatar Dec 24 '21 10:12 ilya-fedin

Let me try

CodeWithShreyans avatar Dec 24 '21 10:12 CodeWithShreyans

zsh: killed     /Users/shreyans/Downloads/Kotatogram.app/Contents/MacOS/Kotatogram

Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.

[Process completed]

Just this after overriding security policy

CodeWithShreyans avatar Dec 24 '21 10:12 CodeWithShreyans

:sob: just killed?

ilya-fedin avatar Dec 24 '21 10:12 ilya-fedin

Yeah this is the only logging that happens after launching the binary directly

CodeWithShreyans avatar Dec 24 '21 10:12 CodeWithShreyans

Maybe because you switched from x86_64 only to universal binary?

CodeWithShreyans avatar Dec 24 '21 10:12 CodeWithShreyans

macOS is a murderer :see_no_evil:

ilya-fedin avatar Dec 24 '21 10:12 ilya-fedin

Maybe because you switched from x86_64 only to universal binary?

Maybe, I don't know much about macOS internals

ilya-fedin avatar Dec 24 '21 10:12 ilya-fedin

I think you should atleast stop the update rollout as clicking update button in app breaks it

CodeWithShreyans avatar Dec 24 '21 10:12 CodeWithShreyans

But a person in kotato's telegram group says it works :thinking:

ilya-fedin avatar Dec 24 '21 10:12 ilya-fedin

Is he on apple silicon running kotato 1.4.6 with macOS Monterey?

CodeWithShreyans avatar Dec 24 '21 10:12 CodeWithShreyans

He is on x64 hackintosh IIRC, I don't remember the version though

ilya-fedin avatar Dec 24 '21 10:12 ilya-fedin

works perfecty if I force it to run through rosetta which means something is wrong with the arm64 binary

CodeWithShreyans avatar Dec 24 '21 10:12 CodeWithShreyans

I wonder what's wrong with arm64 binary, but looks like macOS is not going to tell that

ilya-fedin avatar Dec 24 '21 10:12 ilya-fedin

I found the issue! Something is going wrong with app signing so only the x86_64 binary is getting correctly signed. I locally signed the app with sudo codesign --force -- deep --sign - /Path/to/App.app

CodeWithShreyans avatar Dec 24 '21 20:12 CodeWithShreyans

kotato has no sign...

ilya-fedin avatar Dec 24 '21 20:12 ilya-fedin

sudo codesign --verify --verbose ./Path/to/App.app

./Kotatogram.app: code object is not signed at all
In architecture: arm64

CodeWithShreyans avatar Dec 24 '21 20:12 CodeWithShreyans

What do you mean no sign?

CodeWithShreyans avatar Dec 24 '21 20:12 CodeWithShreyans

I think you mean the x86_64 binary is signed but just not verified by apple

CodeWithShreyans avatar Dec 24 '21 20:12 CodeWithShreyans

I think you mean the x86_64 binary is signed but just not verified by apple

CodeWithShreyans avatar Dec 24 '21 20:12 CodeWithShreyans