Skip to content

ci/macos: add arm64 job#11945

Merged
Frenzie merged 6 commits into
koreader:masterfrom
benoit-pierre:pr/macos_arm64
Jun 11, 2024
Merged

ci/macos: add arm64 job#11945
Frenzie merged 6 commits into
koreader:masterfrom
benoit-pierre:pr/macos_arm64

Conversation

@benoit-pierre

@benoit-pierre benoit-pierre commented Jun 1, 2024

Copy link
Copy Markdown
Member

Untested, someone with access to a real machine will have to test the bundle.


This change is Reviewable

@Frenzie

Frenzie commented Jun 1, 2024

Copy link
Copy Markdown
Member

I can't find the artifact link on macOS?

Edit: for myself https://github.com/koreader/koreader/suites/24414987552/artifacts/1558523165

Edit 2: login required? wtf, why

@Frenzie

Frenzie commented Jun 1, 2024

Copy link
Copy Markdown
Member

Bad news.
image

@Frenzie

Frenzie commented Jun 1, 2024

Copy link
Copy Markdown
Member

I can't seem to find a way to get anything useful out of macOS.

This is a Macbook Air M1 with a broken screen.

@Frenzie

Frenzie commented Jun 1, 2024

Copy link
Copy Markdown
Member

The x86_64 build also doesn't want to open, but with an error message that possibly explains the arm64 failure as well.

Edit: no, presumably that's not the problem, unless Apple's actively lying about it. Apparently if you right click (or ctrl+click) and pick open it offers an additional open anyway button. That works for x86_64, but it makes no difference for arm64.

Edit 2: btw, I won't have that Macbook anywhere near me for the following week.

@benoit-pierre

Copy link
Copy Markdown
Member Author

So just to be clear, the x86_64 build starts once you work around the "scary" security warning popup?

@benoit-pierre

Copy link
Copy Markdown
Member Author

Starting from a terminal should give more info.

@Frenzie

Frenzie commented Jun 2, 2024

Copy link
Copy Markdown
Member

So just to be clear, the x86_64 build starts once you work around the "scary" security warning popup?

Yes.

Starting from a terminal should give more info.

Full and complete instructions since obviously that's the very first thing I tried. ;-) The only way I could find to start from terminal is with open, which doesn't provide any logs nor does it have some kind of -v or --verbose option, at least if you go by --help. It might have something hidden.

You can browse the contents of it, which looks effectively identical to the x86_64 one.

@benoit-pierre

Copy link
Copy Markdown
Member Author

It looks like the rules for arm64 and x86_64 are different: https://wiki.lazarus.freepascal.org/macOS_Big_Sur_changes_for_developers#Code_signing_-_Intel_vs_M1

Let's see if signing (ad hoc) the application bundle changes anything.

Full and complete instructions since obviously that's the very first thing I tried. ;-) The only way I could find to start from terminal is with open, which doesn't provide any logs nor does it have some kind of -v or --verbose option, at least if you go by --help. It might have something hidden.

I think you should be able to run ./KOReader.app/Contents/MacOS/koreader directly.

@Frenzie

Frenzie commented Jun 2, 2024

Copy link
Copy Markdown
Member

Pinging @ryanwwest

(or ping me in a week if I forget)

@kmkipta

kmkipta commented Jun 2, 2024

Copy link
Copy Markdown

@Frenzie I am actually using KOReader with moderate success (I have never used this app before) on M1 right now without any cli intervention. It does crash on maximize I noticed so far.

Screenshot 2024-06-02 at 4 45 21 PM

@benoit-pierre

Copy link
Copy Markdown
Member Author

@kmkipta: which version? Can you get a log for that crash?

@Frenzie

Frenzie commented Jun 2, 2024

Copy link
Copy Markdown
Member

@kmkipta The arm64 build you mean? The x86_64 build runs on everything.

@Frenzie

Frenzie commented Jun 11, 2024

Copy link
Copy Markdown
Member

@benoit-pierre Your codesign experiment seems to have worked. The steps are now the same as for x86_64 (i.e., use right click or ctrl+click → open), even if the exact messages are slightly different.

@benoit-pierre

Copy link
Copy Markdown
Member Author

Good. 👍

@Frenzie

Frenzie commented Jun 11, 2024

Copy link
Copy Markdown
Member

Minor correction, it's macOS itself that changed the error messages in version 14.5. They are identical for both versions.

Edit: or of course it probably changed slightly since you signed it… d'oh! ;-)

@Frenzie

Frenzie commented Jun 11, 2024

Copy link
Copy Markdown
Member

Could you remove the "Hopefully" from that commit message for completion's sake? ^_^

Only keep the target architecture.
Necessary for the arm64 variant, or macOS will complain about the
application being "damaged" (instead of the developer being not
verified), with no possible right click / ctrl+click workaround.
We actually don't need luarocks anymore for building (just testing).
@benoit-pierre

Copy link
Copy Markdown
Member Author

Out of curiosity, what's the new scary warning? :P

@Frenzie

Frenzie commented Jun 11, 2024

Copy link
Copy Markdown
Member

I think you should be able to run ./KOReader.app/Contents/MacOS/koreader directly.

This might work (as in it doesn't obviously fail out of the gate) but it's missing a way to get at the ctrl+click variety of the dialog.

Out of curiosity, what's the new scary warning? :P

Hold on, I'll have to look up the Apple screenshot shortcut. It's something like shift+command+s except that's not it.

@Frenzie

Frenzie commented Jun 11, 2024

Copy link
Copy Markdown
Member

shift+command+4

regular open
Screenshot 2024-06-11 at 21 40 32

right click/ctrl+click open
Screenshot 2024-06-11 at 21 40 48

@Frenzie Frenzie added this to the 2024.06 milestone Jun 11, 2024
@Frenzie Frenzie merged commit 41f4b1f into koreader:master Jun 11, 2024
@benoit-pierre benoit-pierre deleted the pr/macos_arm64 branch June 11, 2024 19:34
@Frenzie

Frenzie commented Jun 11, 2024

Copy link
Copy Markdown
Member

This might work (as in it doesn't obviously fail out of the gate) but it's missing a way to get at the ctrl+click variety of the dialog.

Aha, got it.

xattr -r -d com.apple.quarantine ./KOReader.app
./KOReader.app/Contents/MacOS/koreader

Courtesy of https://apple.stackexchange.com/a/240610

@kmkipta

kmkipta commented Jun 24, 2024

Copy link
Copy Markdown

@kmkipta: which version? Can you get a log for that crash?

I know it's been a minute, but I have the log for that crash. Here's the bad access exception:

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

Exception Type:        EXC_BAD_ACCESS (SIGSEGV)
Exception Codes:       KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Codes:       0x0000000000000001, 0x0000000000000000

Termination Reason:    Namespace SIGNAL, Code 11 Segmentation fault: 11
Terminating Process:   exc handler [62906]

I can post the entire report somewhere, but I can reproduce this on 2 different ARM m1 macs using the most recent mac arm build from action #10831

@benoit-pierre

Copy link
Copy Markdown
Member Author

@kmkipta: please create a dedicated issue.

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

Successfully merging this pull request may close these issues.

3 participants