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

Add Mac arm64 executable #1426

Merged
merged 11 commits into from
May 9, 2024
Merged

Add Mac arm64 executable #1426

merged 11 commits into from
May 9, 2024

Conversation

csasarak
Copy link
Contributor

@csasarak csasarak commented May 3, 2024

Overview

This adds an arm build of the CLI for Mac. You can get binaries from the build macOS-aarch64-build action below.

I will relax and replace some of the required checks for this branch before and after the merge to master.

Acceptance criteria

A build that works on Mac M1.

Testing plan

I set up an ARM EC2 instance, copied the binaries there and ran them. Additionally I ran a direct license-scan to verify that the license scan program worked correctly.

If you are on an ARM mac, downloading the binaries from the release step and running them should also test this.

I tested the install script to make sure that it correctly selects the arm build if it's fetching a valid version. Otherwise it falls back to the intel version of the CLI like before.
Screenshot 2024-05-07 at 2 35 06 PM

Currently, running the cli and just getting the latest fails with a 404, but the generated URL is what I expect it to be:
Screenshot 2024-05-07 at 2 38 58 PM

Risks

Costs will increase since we will be allocating two runners for Mac per build. Caching may become less reliable as we make more cache data as well.

Metrics

References

ANE-572

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 Change build to build an aarch executable. Add Mac aarch64 executable May 3, 2024
@csasarak csasarak changed the title Add Mac aarch64 executable Add Mac arm64 executable May 7, 2024
@csasarak csasarak marked this pull request as ready for review May 7, 2024 19:40
@csasarak csasarak requested a review from a team as a code owner May 7, 2024 19:40
@csasarak csasarak requested a review from spatten May 7, 2024 19:40
Copy link
Contributor

@spatten spatten left a comment

Choose a reason for hiding this comment

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

This looks great. I tested on my mac, and it all worked fine and it's an arm64 binary

file  ~/Downloads/macOS-arm64-binaries/fossa
/Users/scott/Downloads/macOS-arm64-binaries/fossa: Mach-O 64-bit executable arm64

Changelog.md Outdated
@@ -1,5 +1,8 @@
# FOSSA CLI Changelog

## Unreleased
- Release a Mac arm64 binary.
Copy link
Contributor

Choose a reason for hiding this comment

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

[nit] We should include a link to the PR

Suggested change
- Release a Mac arm64 binary.
- Release a Mac arm64 binary ([#1426](https://github.com/fossas/fossa-cli/pull/1426).

Copy link
Contributor

Choose a reason for hiding this comment

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

Also, do you want to just change ## Unreleased to ## v3.9.19 so that we don't need a separate PR to prep for release?

@@ -28,7 +28,7 @@ jobs:
ghc: '9.4.8'

- os: macos-12
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's add a comment that macos-12 was the last version of the macos runner that uses intel

@csasarak
Copy link
Contributor Author

csasarak commented May 9, 2024

Did you test that themis works from it? It did in my testing but it's good to get another check. @spatten I'll incorporate your suggestions.

@spatten
Copy link
Contributor

spatten commented May 9, 2024

Did you test that themis works from it? It did in my testing but it's good to get another check. @spatten I'll incorporate your suggestions.

I hadn't, but I just did and it works. Good call!

~/Downloads/macOS-arm64-binaries/fossa license-scan direct

results in output from Themis

@csasarak csasarak merged commit 75363fc into master May 9, 2024
17 of 18 checks passed
@csasarak csasarak deleted the mac-arm-build branch May 9, 2024 22:25
csasarak added a commit that referenced this pull request May 10, 2024
csasarak added a commit that referenced this pull request May 11, 2024
csasarak added a commit that referenced this pull request May 13, 2024
csasarak added a commit that referenced this pull request May 28, 2024
* Reapply "Add Mac arm64 executable (#1426)" (#1429)

This reverts commit 36e62bb.

* Zip up the right archive.

* Try adding an entitlement.

* Explicitly install xz.

* try entitlements.

* Move entitlements arg.

* Fix condition

* wip

* Only use entitlements for arm64.

* Use correct equality.

* Restore full conditional.

* Fix conditional
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