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 Windows arm64 release binaries #1250

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

dennisameling
Copy link

Closes #1068

Even though the GitHub Runner hosts are x64, MSVC and Rust support cross-compiling to arm64 perfectly fine on Windows. This PR uploads arm64 artifacts for fnm.

Copy link

changeset-bot bot commented Sep 12, 2024

🦋 Changeset detected

Latest commit: 07b9e43

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

This PR includes changesets to release 1 package
Name Type
fnm 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

Copy link

vercel bot commented Sep 12, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
fnm ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 9, 2024 1:23pm

@dennisameling
Copy link
Author

dennisameling commented Sep 12, 2024

Successful CI run in my fork (given that the CI in this PR is pending maintainer approval): https://github.com/dennisameling/fnm/actions/runs/10829319005/job/30046612481?pr=1

This basically doubles the build time for the "Release build for Windows" job, because the builds run sequentially. Alternatively, I could change the CI config in such way that both builds (x64 and arm64) run in parallel. WDYT @Schniz?

afbeelding

The output of fnm env also looks good on both binaries (I removed $env:PATH from the lines below for brevity):

.\fnm-arm64.exe env
$env:FNM_MULTISHELL_PATH = "C:\Users\dennisameling\AppData\Local\fnm_multishells\1148_1726139007471"
$env:FNM_VERSION_FILE_STRATEGY = "local"
$env:FNM_DIR = "C:\Users\dennisameling\AppData\Roaming\fnm"
$env:FNM_LOGLEVEL = "info"
$env:FNM_NODE_DIST_MIRROR = "https://nodejs.org/dist"
$env:FNM_COREPACK_ENABLED = "false"
$env:FNM_RESOLVE_ENGINES = "false"
$env:FNM_ARCH = "arm64"

.\fnm-x64.exe env
$env:FNM_MULTISHELL_PATH = "C:\Users\dennisameling\AppData\Local\fnm_multishells\8532_1726139011793"
$env:FNM_VERSION_FILE_STRATEGY = "local"
$env:FNM_DIR = "C:\Users\dennisameling\AppData\Roaming\fnm"
$env:FNM_LOGLEVEL = "info"
$env:FNM_NODE_DIST_MIRROR = "https://nodejs.org/dist"
$env:FNM_COREPACK_ENABLED = "false"
$env:FNM_RESOLVE_ENGINES = "false"
$env:FNM_ARCH = "x64"

@Schniz
Copy link
Owner

Schniz commented Oct 6, 2024

@dennisameling will it download the correct Windows version off Node.js dist?

@dennisameling
Copy link
Author

@Schniz it will indeed! The only caveat is that official Windows arm64 support was added in Node 20 (see e.g. here). Windows arm64 supports x64 emulation, so folks needing older versions can always do something like fnm install 18 --arch x64 to get those. That might be nice to add to the release notes.

I don't think fnm would need to implement any workarounds for that; looking at the LTS schedule, v18 support will end in May 2025, v20 is already LTS, and v22 will become LTS later this month as well.

Here's some examples using the arm64 binary I built locally:

PS > .\fnm install 20
Installing Node v20.18.0 (arm64)
00:00:07 ██████████████████████████████████████████████████████████████████████████ 25.00 MiB/25.00 MiB (3.28 MiB/s, 0s)

PS > .\fnm install 18
Installing Node v18.20.4 (arm64)
error: Can't download the requested binary: v18.20.4 for arm64 not found upstream.
You can `fnm ls-remote` to see available versions or try a different `--arch`.

@ahaoboy
Copy link
Contributor

ahaoboy commented Oct 13, 2024

May also need to modify install.sh, and perhaps add binstall support at the same time

#1280

If use these two names, you can skip the compilation using cargo binstall

fnm-x86_64-pc-windows-msvc.zip
fnm-arm64-pc-windows-msvc.zip

@dennisameling
Copy link
Author

This can potentially be superseded by #1282

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.

Windows on Arm
3 participants