WIP: Code sign Mach O files manually #208

Draft
amurgshere wants to merge 1 commits from amurgshere/fix-signing-issue-with-mach-o-files into master
amurgshere commented 2024-11-09 03:29:38 +00:00 (Migrated from github.com)

This item fixes issue https://github.com/GreemDev/Ryujinx/issues/210 .

Changes

  • Code sign Mach O files manually
  • Fix typo "Usign" to "Using"
  • Add MacOS Output and Temp folders to GitIgnore

Reproduction of Issue

  1. Clone the repository to an Apple Silicon MAC (MacOS 14.6.1)
  2. Run this command from the cloned directory to build, package and sign the app bundles:

./distribution/macos/create_macos_build_ava.sh ./ ./distribution/macos/temp ./distribution/macos/output ./distribution/macos/entitlements.xml 1.0.0 0 Release

ISSUE: x64 version is not signed properly and Universal bundle is not created at all as the x64 signing failed which stops the script. This error is shown:

/Volumes/MACBOOK/ROMS/NSW/Ryujinx/GitHub/Ryujinx/distribution/macos/temp/output_x64/Ryujinx.app: code object is not signed at all In subcomponent: /Volumes/MACBOOK/ROMS/NSW/Ryujinx/GitHub/Ryujinx/distribution/macos/temp/output_x64/Ryujinx.app/Contents/Frameworks/libglfw.3.dylib

EXPECTED OUTCOME: Both the x64 and Universal bundles should be created and signed in the distribution/macOS/output folders.

NOTE: I have not updated "rcodesign" as I do not have this and am not sure how to install it so can't test it.

This item fixes issue https://github.com/GreemDev/Ryujinx/issues/210 . **Changes** - Code sign Mach O files manually - Fix typo "Usign" to "Using" - Add MacOS Output and Temp folders to GitIgnore **Reproduction of Issue** 1) Clone the repository to an Apple Silicon MAC (MacOS 14.6.1) 2) Run this command from the cloned directory to build, package and sign the app bundles: ./distribution/macos/create_macos_build_ava.sh ./ ./distribution/macos/temp ./distribution/macos/output ./distribution/macos/entitlements.xml 1.0.0 0 Release ISSUE: x64 version is not signed properly and Universal bundle is not created at all as the x64 signing failed which stops the script. This error is shown: `/Volumes/MACBOOK/ROMS/NSW/Ryujinx/GitHub/Ryujinx/distribution/macos/temp/output_x64/Ryujinx.app: code object is not signed at all In subcomponent: /Volumes/MACBOOK/ROMS/NSW/Ryujinx/GitHub/Ryujinx/distribution/macos/temp/output_x64/Ryujinx.app/Contents/Frameworks/libglfw.3.dylib` EXPECTED OUTCOME: Both the x64 and Universal bundles should be created and signed in the distribution/macOS/output folders. NOTE: I have not updated "rcodesign" as I do not have this and am not sure how to install it so can't test it.
Kek5chen commented 2024-11-09 14:48:18 +00:00 (Migrated from github.com)

For this to merge we should probably have reviews from different OSX Versions with different releases of codesign so we don't run into another follow up issue.

I would suggest the following OSX releases:

  • Aarch64 >13.X
  • x86_64 >13.X
  • Aarch64 <13.X
  • x86_64 <13.X
For this to merge we should probably have reviews from different OSX Versions with different releases of codesign so we don't run into another follow up issue. I would suggest the following OSX releases: - [ ] Aarch64 >13.X - [ ] x86_64 >13.X - [ ] Aarch64 <13.X - [ ] x86_64 <13.X
amurgshere commented 2024-11-09 14:53:21 +00:00 (Migrated from github.com)

Thanks @Kek5chen ,

I have tested >13.X (MacOS 14.6.1) on Aarch64 and x86_64 (running on an M1 Mac using Rosetta 2) but I don’t have a device on < 13.X so cant test that.

If anyone can help out here that would be great!

also, I can see one of the builds failed when uploading artefacts on this PR, but it looks like it’s just a timeout and not anything to do with my changes, though not 100% sure as it is on the universal macOS build?

Thanks @Kek5chen , I have tested >13.X (MacOS 14.6.1) on Aarch64 and x86_64 (running on an M1 Mac using Rosetta 2) but I don’t have a device on < 13.X so cant test that. If anyone can help out here that would be great! also, I can see one of the builds failed when uploading artefacts on this PR, but it looks like it’s just a timeout and not anything to do with my changes, though not 100% sure as it is on the universal macOS build?
Kek5chen commented 2024-11-09 15:30:02 +00:00 (Migrated from github.com)

Can you tell us the exact version of your system? Because the issue you reported was successfully built on aarch64 15.0.1

Can you tell us the exact version of your system? Because the issue you reported was successfully built on aarch64 15.0.1
amurgshere commented 2024-11-09 15:33:03 +00:00 (Migrated from github.com)

Apologies @Kek5chen , it is 14.6.1, I will be upgrading to 15 in the next few weeks or so, so will retest then too. Have updated above comment.

Apologies @Kek5chen , it is 14.6.1, I will be upgrading to 15 in the next few weeks or so, so will retest then too. Have updated above comment.
Kek5chen commented 2024-11-09 15:38:03 +00:00 (Migrated from github.com)

Hmm. Interesting. I wonder what the issue is there then. It looks like the issue you're having specifically is that the custom build of glfw isn't signed. I think though that I might've used a different provided build of glfw from the nix store. Seems like that's the issue. In that case I do think that doing find and signing each is the way to go.

Though I'm not sure if building the libraries for some triggers an automatic code signing process or what the issue with glfw is specifically. Maybe you want to investigate that a bit before so we exactly know where the issue stems from.

Hmm. Interesting. I wonder what the issue is there then. It looks like the issue you're having specifically is that the custom build of glfw isn't signed. I think though that I might've used a different provided build of glfw from the nix store. Seems like that's the issue. In that case I do think that doing find and signing each is the way to go. Though I'm not sure if building the libraries for some triggers an automatic code signing process or what the issue with glfw is specifically. Maybe you want to investigate that a bit before so we exactly know where the issue stems from.
amurgshere commented 2024-11-09 15:40:17 +00:00 (Migrated from github.com)

If I manually sign that one and try again it then fails on another library , the lib sound one I think it was, so that’s when I added the line just to sign them all then it worked.

If I manually sign that one and try again it then fails on another library , the lib sound one I think it was, so that’s when I added the line just to sign them all then it worked.
Kek5chen commented 2024-11-09 18:43:08 +00:00 (Migrated from github.com)

Oh yea alright. Sounds good. Find seems like the way to go.

Oh yea alright. Sounds good. Find seems like the way to go.
github-actions[bot] commented 2024-11-23 20:38:05 +00:00 (Migrated from github.com)
Download the artifacts for this pull request: * [ryujinx-Release-1.2.0+f4e5473-linux_arm64](https://nightly.link/GreemDev/Ryujinx/actions/artifacts/2230368474.zip) * [ryujinx-Release-1.2.0+f4e5473-linux_arm64-AppImage](https://nightly.link/GreemDev/Ryujinx/actions/artifacts/2230368495.zip) * [ryujinx-Release-1.2.0+f4e5473-linux_x64](https://nightly.link/GreemDev/Ryujinx/actions/artifacts/2230370493.zip) * [ryujinx-Release-1.2.0+f4e5473-linux_x64-AppImage](https://nightly.link/GreemDev/Ryujinx/actions/artifacts/2230370519.zip) * [ryujinx-Release-1.2.0+f4e5473-macos_universal](https://nightly.link/GreemDev/Ryujinx/actions/artifacts/2230372269.zip) * [ryujinx-Release-1.2.0+f4e5473-win_x64](https://nightly.link/GreemDev/Ryujinx/actions/artifacts/2230375125.zip) <details><summary>GUI-less</summary> * [nogui-ryujinx-Release-1.2.0+f4e5473-linux_arm64](https://nightly.link/GreemDev/Ryujinx/actions/artifacts/2230368542.zip) * [nogui-ryujinx-Release-1.2.0+f4e5473-linux_x64](https://nightly.link/GreemDev/Ryujinx/actions/artifacts/2230370561.zip) * [nogui-ryujinx-Release-1.2.0+f4e5473-macos_universal](https://nightly.link/GreemDev/Ryujinx/actions/artifacts/2230372320.zip) * [nogui-ryujinx-Release-1.2.0+f4e5473-win_x64](https://nightly.link/GreemDev/Ryujinx/actions/artifacts/2230375160.zip) </details> <details><summary>Only for Developers</summary> * [ryujinx-Debug-1.2.0+f4e5473-linux_arm64](https://nightly.link/GreemDev/Ryujinx/actions/artifacts/2230368708.zip) * [ryujinx-Debug-1.2.0+f4e5473-linux_arm64-AppImage](https://nightly.link/GreemDev/Ryujinx/actions/artifacts/2230368742.zip) * [nogui-ryujinx-Debug-1.2.0+f4e5473-linux_arm64](https://nightly.link/GreemDev/Ryujinx/actions/artifacts/2230368780.zip) * [ryujinx-Debug-1.2.0+f4e5473-linux_x64](https://nightly.link/GreemDev/Ryujinx/actions/artifacts/2230371444.zip) * [ryujinx-Debug-1.2.0+f4e5473-linux_x64-AppImage](https://nightly.link/GreemDev/Ryujinx/actions/artifacts/2230371463.zip) * [nogui-ryujinx-Debug-1.2.0+f4e5473-linux_x64](https://nightly.link/GreemDev/Ryujinx/actions/artifacts/2230371503.zip) * [ryujinx-Debug-1.2.0+f4e5473-macos_universal](https://nightly.link/GreemDev/Ryujinx/actions/artifacts/2230372236.zip) * [nogui-ryujinx-Debug-1.2.0+f4e5473-macos_universal](https://nightly.link/GreemDev/Ryujinx/actions/artifacts/2230372272.zip) * [ryujinx-Debug-1.2.0+f4e5473-win_x64](https://nightly.link/GreemDev/Ryujinx/actions/artifacts/2230375809.zip) * [nogui-ryujinx-Debug-1.2.0+f4e5473-win_x64](https://nightly.link/GreemDev/Ryujinx/actions/artifacts/2230375859.zip) </details>
Kek5chen commented 2024-11-24 15:53:17 +00:00 (Migrated from github.com)

@GreemDev would probably be better to rebase instead of merge. general thing.

@GreemDev would probably be better to rebase instead of merge. general thing.
GreemDev commented 2025-01-26 22:02:30 +00:00 (Migrated from github.com)

@amurgshere An acceptable fix to this issue is removing Intel Mac building. We don't support it anyways, the reason it's still being built is because I can't figure out how to remove it.

@amurgshere An acceptable fix to this issue is removing Intel Mac building. We don't support it anyways, the reason it's still being built is because I can't figure out how to remove it.
amurgshere commented 2025-01-27 12:34:13 +00:00 (Migrated from github.com)

Ahh ok , thanks @GreemDev , I didn’t realise we don’t support it as I don’t have an x64 Mac, will take a look this when I get some more time, maybe I can remove the x64 Mac build for you, note that the universal app doesn’t sign properly either if I bypass the x64 build.

Ahh ok , thanks @GreemDev , I didn’t realise we don’t support it as I don’t have an x64 Mac, will take a look this when I get some more time, maybe I can remove the x64 Mac build for you, note that the universal app doesn’t sign properly either if I bypass the x64 build.
indianajson commented 2025-01-28 14:46:29 +00:00 (Migrated from github.com)

Just wanted to throw out there that despite not officially supporting Intel based Mac the latest build (1.2.81) works well enough based on my experience so far and saw some performance improvements over 1.2.72 (the last build I was running).

Just wanted to throw out there that despite not officially supporting Intel based Mac the latest build (1.2.81) works well enough based on my experience so far and saw some performance improvements over 1.2.72 (the last build I was running).
GreemDev commented 2025-01-28 18:10:54 +00:00 (Migrated from github.com)

Just wanted to throw out there that despite not officially supporting Intel based Mac the latest build (1.2.81) works well enough based on my experience so far and saw some performance improvements over 1.2.72 (the last build I was running).

ok we're still removing support though, at some point

> Just wanted to throw out there that despite not officially supporting Intel based Mac the latest build (1.2.81) works well enough based on my experience so far and saw some performance improvements over 1.2.72 (the last build I was running). ok we're still removing support though, at some point
This pull request has changes conflicting with the target branch.
  • .gitignore

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin amurgshere/fix-signing-issue-with-mach-o-files:amurgshere/fix-signing-issue-with-mach-o-files
git checkout amurgshere/fix-signing-issue-with-mach-o-files
Sign in to join this conversation.
No description provided.