Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build for macOS >= 12.4 #2529

Closed
silv2k opened this issue Jul 30, 2022 · 23 comments
Closed

Build for macOS >= 12.4 #2529

silv2k opened this issue Jul 30, 2022 · 23 comments

Comments

@silv2k
Copy link

silv2k commented Jul 30, 2022

I have a MacBook M1 and used KVIrc until Apple decided to remove Python 2.7 with the update to macOS 12.4.

Is there a possibilty to run KVIrc without Python 2.7?
Disabling SIP and installing Python 2.7 to the previous path is not an option.

I tried to make a build with homebrew and Python 3.10.5 by following the instructions for macOS, but the app crashs everytime at starting.
The report says it is a codesigning error.
I tried serveral command to resign the app, but nothing worked.

Can somebody make a build for macOS without Python 2.7 or help me to troubleshoot my bugs?

Thank you

-------------------------------------

Translated Report (Full Report Below)

-------------------------------------

Process: kvirc [473]

Path: /Users/USER/Downloads/*/KVIrc.app/Contents/MacOS/kvirc

Identifier: com.kvirc.kvirc

Version: 5.0.1 (???)

Code Type: ARM-64 (Native)

Parent Process: launchd [1]

User ID: 501

Date/Time: 2022-07-31 00:07:30.8322 +0200

OS Version: macOS 12.5 (21G72)

Report Version: 12

Anonymous UUID: 668A36F9-98A4-4E28-B055-A6509AB4E253

Time Awake Since Boot: 36 seconds

System Integrity Protection: enabled

Crashed Thread: 0 Dispatch queue: com.apple.main-thread

Exception Type: EXCBADACCESS (SIGKILL (Code Signature Invalid))

Exception Codes: UNKNOWN_0x32 at 0x0000000103904000

Exception Codes: 0x0000000000000032, 0x0000000103904000

Exception Note: EXCCORPSENOTIFY

Termination Reason: Namespace CODESIGNING, Code 2


@emarsk
Copy link

emarsk commented Nov 21, 2022

I installed Python2 with homebrew via this tap, then I linked the framework to a location where the pre-built KVIrc is expecting it:

sudo ln -svfn /usr/local/Cellar/python@2/2.7.18/Frameworks/Python.framework /Library/Frameworks/

/Library isn't locked by SIP, so this should work for you as well.


I also tried a build with Python3, following the instructions here (note that the path to qt5 is now /usr/local/opt/qt@5/). It works for me, no errors.

@silv2k
Copy link
Author

silv2k commented Nov 21, 2022

Thank you for the advice.
Meanwhile I compiled the package by myself with Python 3 inside the bundle.
The compiling was not so difficult, but the code signing process was awfull.
Now the app works nice.

@stendro
Copy link

stendro commented Jan 31, 2023

I have a problem with invalid signature. Ad-hoc signature doesn't work even though I read online that it's supposed to for ARM binaries on M1.

Edit: Just signed with developer sign. same problem.
Namespace CODESIGNING, Code 2 Invalid Page

@silv2k
Copy link
Author

silv2k commented Jan 31, 2023

I had the same problem.
I had to sign every framework and dylib in the KVIrc.app folder before signing the KVIrc.app.

for example:
codesign --force -s - Python.framework

do this for every *.framework and *.dylib

next step:
codesign --force --deep -s - KVIrc.app

Update (smarter):
Use the following three commands:
find . -iname 'framework' -type d | while read dir; do codesign --force --deep -s - $dir; done
find . -iname 'dylib' | while read dir; do codesign --force --deep -s - $dir; done
codesign --force --deep -s - KVIrc.app

@stendro
Copy link

stendro commented Jan 31, 2023

Thank you @silv2k
that works, but you forgot to put * in-front of the search terms.

find . -iname '*framework' -type d | while read dir; do codesign --force --deep -s - $dir; done
find . -iname '*dylib' | while read dir; do codesign --force --deep -s - $dir; done
codesign --force --deep -s - KVIrc.app

@stefan1983
Copy link

stefan1983 commented Feb 22, 2023

Will there be a - ready to install - binary file (dmg) anytime soon (for all around here not able to compile by themselves)?

@silv2k
Copy link
Author

silv2k commented Feb 23, 2023

I made a fork of this project.
There you can find an ad-hoc signed binary for macOS >= 12.4 with Apple Silicon.

@stefan1983
Copy link

Thanks, works fine so far! Is this project still going on or dead already? There isn't much progress anymore (nightly / daily builds).

@DarthGandalf
Copy link
Member

@stefan1983 If there are no new commits, there's no need to build them.

But travis CI which produced some nightlies doesn't work anymore. We need to move it to github actions or something else. Appveyor (windows CI) might need fixing as well.

@silv2k do you need to have some kind of apple key for that?

@silv2k
Copy link
Author

silv2k commented Feb 24, 2023

@DarthGandalf You don't need a Developer ID certificate from Apple to sign the binary, but it has some advantages, if you have one and sign the binary with it. You can let Apple notarize the app so that Gatekeeper knows the app and users can start it directly without extra allowing it.

@stefan1983
Copy link

stefan1983 commented Feb 25, 2023

@silv2k I see some spontaneous app crashes but no crash logs being created in ~/Library/Logs/DiagnosticReports/
Have you any idea if there are some reports anywhere?

If so where would I put those logs? Is there still anyone maintaining bugs?

Questions over questions ;)

@silv2k
Copy link
Author

silv2k commented Feb 25, 2023

@stefan1983 That's weird... I never had a crash since I use it. I can't say why there is no log in ~/Library/Logs/DiagnosticReports/, because I'm not a developer.

@DarthGandalf Maybe you can help here?

@stefan1983
Copy link

stefan1983 commented Feb 25, 2023

I looked in the macOS console and found some more infos:

  1. there are some invalid timestamps appearing
    image

  2. There is an error:
    image

Here is the full console log:
https://justpaste.it/b3pla

@stefan1983
Copy link

The issue is reproducible for me. I just need to have this window here open for about 30-45 seconds:
For example creating a new network:
image

Insert a new IRC server and leave it open for several seconds:
image

It does not take long until the app crashes / closes itself.

@silv2k Can you reproduce as well?

@silv2k
Copy link
Author

silv2k commented Feb 25, 2023

@stefan1983 No crashes here. Window is open for about 5 minutes. No problems here.
Which version of macOS do you have? Mine is 12.6.3 on M1 Pro processor.

@stendro
Copy link

stendro commented Feb 25, 2023

@stefan1983 Just a thought (I'm new to apple in general, so this is just my recent experience with weird issues talking), does the app have the "quarantine attribute"?
xattr -l /Applications/KVIrc.app
If so you should remove it (with "xattr -dr"), it has given me numerous problems on different occasions.
Could also try open -F /Applications/KVIrc.app - this might make it prompt for new permissions that are needed.

I can also report that the above scenario does not crash on my own compiled kvirc app, on Ventura 13.2

@erwinc1
Copy link

erwinc1 commented Jul 18, 2023

Thank you @silv2k that works, but you forgot to put * in-front of the search terms.

find . -iname '*framework' -type d | while read dir; do codesign --force --deep -s - $dir; done find . -iname '*dylib' | while read dir; do codesign --force --deep -s - $dir; done codesign --force --deep -s - KVIrc.app

this should be pinned answer

@ctrlaltca
Copy link
Contributor

I've just integrated a CI build for macOS in github.
Can someone with a recent mac please test the result at https://github.com/kvirc/KVIrc/actions/runs/5806880154 ?
I'd like to know if the generated package work and if the codesign step can be integrated inside the CI

@DarthGandalf
Copy link
Member

Yes, it seems to run. There is one issue with installer though: by default the Kvirc icon is not there, but just empty space. I randomly managed to find it somewhere on the right, by resizing the window.

изображение

I need to find some good way to upload this to nightly.kvirc.net

@ctrlaltca
Copy link
Contributor

There is one issue with installer though: by default the Kvirc icon is not there, but just empty space. I randomly managed to find it somewhere on the right, by resizing the window.

Looks like it's a known issue: QQxiaoming/create-dmg-action#127

@ctrlaltca
Copy link
Contributor

I need to find some good way to upload this to nightly.kvirc.net

Maybe https://github.com/marketplace/actions/copy-via-ssh ?

@ctrlaltca
Copy link
Contributor

We are about to release a new version, please try https://github.com/kvirc/KVIrc/releases/tag/5.2.0-beta1-fix and report if this issue is still present. Thank you

@silv2k
Copy link
Author

silv2k commented Dec 9, 2023

Works perfect for me. No issues until now. Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants