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 aarch64 binaries #47

Merged
merged 5 commits into from
Dec 18, 2024
Merged

Add aarch64 binaries #47

merged 5 commits into from
Dec 18, 2024

Conversation

mcgordonite
Copy link
Contributor

@mcgordonite mcgordonite commented Sep 13, 2024

Motivation

Implements #46.

Approach

The native binaries for both arm64 and x64 are shipped in the package's dist directory:

dist
├── arm64
│   ├── ctrlc-windows.node
│   └── process-killer.exe
└── x64
    ├── ctrlc-windows.node
    └── process-killer.exe

Previously, only x64 binaries were available. Also:

  • index.js loads the module for the correct architecture at runtime.
  • A JS build script runs napi build for a particular architecture then moves the artifacts to the correct path in dist. By default, this builds for the host system.
  • CI is updated to build for both platforms.

A package created from a slightly modified version of the CI in this repo on both platforms, but I've not been able to test the full release CI on my fork.

Alternate Designs

I suggested using napi-rs's default build approach in #46. This would publish two additional platform-specific packages to NPM: ctrlc-windows-x64 and ctrlc-windows-arm64. This turned out to be quite hard, partly due to the additional process-killer.exe binary. I couldn't get napi-rs's CLI to copy it to the correct path, meaning we'd need a build script anyway.

The downside is shipping an extra 180KB in the package. Hopefully this is worth it to avoid the extra build and consumer complexity.

Copy link

changeset-bot bot commented Sep 13, 2024

🦋 Changeset detected

Latest commit: 06dabc0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
ctrlc-windows Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mcgordonite mcgordonite mentioned this pull request Sep 27, 2024
@jburggraaf
Copy link

I have been looking into doing exactly what this library does but I need arm support to see if it works for my project. Thanks for PR.

@cowboyd cowboyd requested a review from jbolda October 10, 2024 17:36
@cowboyd
Copy link
Member

cowboyd commented Oct 11, 2024

We need to look into why this is failing. I'll try and pull the source later today.

Copy link
Collaborator

@jbolda jbolda left a comment

Choose a reason for hiding this comment

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

I don't think it would add consumer complexity, but it would require adjustments and that we make certain to thread the needle with the right dependency structure. napi-rs should help us with this, but it doesn't seem worth blocking this longer.

We can came back and address this with separate packages (and likely updated dependencies) in the next version.

@cowboyd
Copy link
Member

cowboyd commented Dec 17, 2024

@jbolda Any idea why the checks aren't running?

@jbolda
Copy link
Collaborator

jbolda commented Dec 17, 2024

You need to approve as I apparently don't have write access.

@cowboyd
Copy link
Member

cowboyd commented Dec 17, 2024

@jbolda You are listed as a maintainer, as well as all of our engineering team. I think the problem was that the "new" merge experience doesn't actually let you run workflows or something? What if you try now ( I switched it back to "classic").

@cowboyd cowboyd merged commit 631c550 into thefrontside:v2 Dec 18, 2024
6 checks passed
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.

4 participants