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

Fix Mac ARM release process #1428

Merged
merged 13 commits into from
May 28, 2024
Merged

Fix Mac ARM release process #1428

merged 13 commits into from
May 28, 2024

Conversation

csasarak
Copy link
Contributor

@csasarak csasarak commented May 10, 2024

Overview

I made a mistake in my last PR where I didn't change the command to make the final release archives correctly. It was putting the intel binaries into the arm archive.

I also addressed an issue that came up with code-signing while testing the release action. On ARM the liblzma dylib fails during the verification of code signing when running fossa because the library is not signed by either Apple or us:

dyld[11361]: Library not loaded: /opt/homebrew/opt/xz/lib/liblzma.5.dylib
  Referenced from: <339C808F-7D5F-3897-BEE5-FF154705274E> /Users/ec2-user/arm_macos/fossa
  Reason: tried: '/opt/homebrew/opt/xz/lib/liblzma.5.dylib' (code signature in <1E29DFAD-90C2-3D94-889D-7A212125B52B> '/opt/homebrew/Cellar/xz/5.4.6/lib/liblzma.5.dylib' not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/opt/xz/lib/liblzma.5.dylib' (no such file), '/opt/homebrew/opt/xz/lib/liblzma.5.dylib' (code signature in <1E29DFAD-90C2-3D94-889D-7A212125B52B> '/opt/homebrew/Cellar/xz/5.4.6/lib/liblzma.5.dylib' not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs), '/opt/homebrew/Cellar/xz/5.4.6/lib/liblzma.5.dylib' (code signature in <1E29DFAD-90C2-3D94-889D-7A212125B52B> '/opt/homebrew/Cellar/xz/5.4.6/lib/liblzma.5.dylib' not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs), '/System/Volumes/Preboot/Cryptexes/OS/opt/homebrew/Cellar/xz/5.4.6/lib/liblzma.5.dylib' (no such file), '/opt/homebrew/Cellar/xz/5.4.6/lib/liblzma.5.dylib' (code signature in <1E29DFAD-90C2-3D94-889D-7A212125B52B> '/opt/homebrew/Cellar/xz/5.4.6/lib/liblzma.5.dylib' not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs)

On my Intel system, the liblzma dylib seems to be built-in and present in /usr/local/lib which seems to be trusted. But on ARM it is from homebrew. I spent some time investigating solutions hoping to find one that would allow the homebrew liblzma to pass verification but could not. The solution I came up with is to disable the library verification using entitlements.plist. This is less than ideal, but I could not find another way to make this work that wouldn't involve changing the way we distribute our OS X binaries to bundle in liblzma.

You can find a copy of the signed and notarized arm binaries with the entitlements here.

Acceptance criteria

It puts the ARM binaries into the arm archive.

Testing plan

I pushed dummy tags v9.9.9 and used these to test the release action. I then downloaded and ran the fossa arm binaries on an EC2 instance. If whoever reviews this is using an apple silicon system it would be good if they could also test the signed binaries I link to above.

Risks

There is the additional entitlement for Mac OS X binaries on arm. I think the actual risk here is small, but it is a risk.

Checklist

  • I added tests for this PR's change (or explained in the PR description why tests don't make sense).
  • If this PR introduced a user-visible change, I added documentation into docs/.
  • If this PR added docs, I added links as appropriate to the user manual's ToC in docs/README.ms and gave consideration to how discoverable or not my documentation is.
  • If this change is externally visible, I updated Changelog.md. If this PR did not mark a release, I added my changes into an # Unreleased section at the top.
  • If I made changes to .fossa.yml or fossa-deps.{json.yml}, I updated docs/references/files/*.schema.json AND I have updated example files used by fossa init command. You may also need to update these if you have added/removed new dependency type (e.g. pip) or analysis target type (e.g. poetry).
  • If I made changes to a subcommand's options, I updated docs/references/subcommands/<subcommand>.md.

@csasarak csasarak changed the title Zip up the right archive. Fix Mac ARM release process May 16, 2024
@csasarak csasarak marked this pull request as ready for review May 16, 2024 02:24
@csasarak csasarak requested a review from a team as a code owner May 16, 2024 02:24
Copy link
Contributor

@JeffreyHuynh1 JeffreyHuynh1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested the linked arm binaries and it works well on my machine

@csasarak csasarak merged commit 6c4e3e1 into master May 28, 2024
17 of 18 checks passed
@csasarak csasarak deleted the fix-arm-release branch May 28, 2024 16:22
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.

None yet

2 participants