Windows ARM64 as a cross-compile target

未关闭
#4,858 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@hum-n 已经在做这个了。

开始于 2026年12月4日。

  • #4859 来自 @hum-n —— 未关闭

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
功能
描述清晰度
描述清楚
活跃度
停滞
技术栈
github-actions, typescript, zig

调研方向

A linked pull request, #4859, already implements this work. To understand the change, review its updates to targets.ts, target.cpp, CMakeLists.txt, targets.mjs, the Windows ARM64 runtime pack, tests, and platforms.mdx. The issue also identifies release-build.yml and release.yml as unresolved release integration points; check the pull request discussion for their status before taking any work.

由索引模型根据 Issue 内容生成。

描述

scriptc builds Windows executables for x64 only. I'd like to add aarch64-windows-gnu as a cross-compile target, so ARM64 Windows executables can be built from any supported host, the way Android and iOS work today.

Scope

  • Building for ARM64 Windows from macOS, Linux or x64 Windows.
  • It doesn't make scriptc itself run on ARM64 Windows (no win32-arm64 CLI, helper or @tsc-ts package). That's a separate, bigger change.
  • No Node islands on this target. ni_ctx_swap in scr_node_island.c is x64 assembly, so the pack leaves that file out, and @scriptc/node fails the build with SC3002 instead of at link time.

Changes (#4859)

  • The target in targets.ts. The LLVM helper accepts the triple and emits COFF for AArch64 (target.cpp, CMakeLists.txt, targets.mjs), so the helpers need a rebuild.
  • A @scriptc/runtime-win32-arm64-msvc pack, built with zig like the x64 Windows pack.
  • The early SC3002 error for island programs.
  • Tests and platforms.mdx.

Testing
I ran a lane on my fork (https://github.com/hum-n/scriptc/actions/runs/47353756780): every 4th corpus program, minus @requires-libnode ones, was cross-compiled on Linux for both aarch64-windows-gnu and x86_64-windows-gnu, and both builds ran side by side on windows-11-arm, with the x64 build (under emulation) as the reference. Of 1988 programs, 1731 gave the same stdout, stderr and exit code on both (23 of those differed only in architecture names, pids, temp folder names or the default NaN's sign bit), 256 don't build for Windows on either architecture, and 1 built for arm64 but not x64.

Questions

  1. release-build.yml and release.yml don't build or publish the new pack yet. Where do you want it built? It cross-builds on Linux with zig, same as the Android pack.
  2. Want the lane as an optional workflow_dispatch job? It takes about 30 min across 8 shards.
主要语言
TypeScript
星标
6.7k
派生
229
平均合并
14 小时 29 分钟
30 天内合并 PR
787

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

vercel-labs/scriptc 的其他 Issue

查看 vercel-labs/scriptc 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。