Skip to content

feat(release): Intel macOS and Windows arm64 tsc - #34

Merged
t3dotgg merged 8 commits into
mainfrom
goport-plat2
Oct 10, 2026
Merged

t3dotgg merged 8 commits into
mainfrom
goport-plat2

Conversation

@t3dotgg

@t3dotgg t3dotgg commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Problem

T3 Code #16704 switches the typecheck to tsc-rs. tsc-rs 0.2.0 has no binary for Intel Macs or Windows, so on those platforms the T3 Code launcher falls back to the old compiler. #33 added Windows x64. Intel Macs and Windows arm64 were still missing.

Fix

  • release.yml builds two more platforms, the same way as the others: the plain build, the PGO build trained on its own platform (pgo-train.sh), the PGO-against-plain check, the platform npm package, an archive and a verify job that installs the npm tgz and runs tsc-rs.
    • darwin-x64 (x86_64-apple-darwin) on GitHub's macos-15-intel. Blacksmith has no Intel Mac.
    • win32-arm64 (aarch64-pc-windows-msvc, +crt-static) on GitHub's windows-11-arm (free for public repos). Blacksmith has no arm64 Windows.
  • win32-arm64 links with the toolchain's rust-lld. On arm64, link.exe aligns each section contribution to 4 bytes, also the 1-byte start markers of the LLVM profile sections. The instrumented tsc then wrote 3 zero bytes before the function names, and llvm-profdata rejected every profile ("symbol name is empty"). The PDB section contributions and the .lprfn bytes of the instrumented tsc show it. lld-link keeps the 1-byte alignment, as link.exe does on x64.
  • Each PGO training run writes its own profile file (pgo-train.sh, PGO_PROFILE_DIR from build-pgo.sh). rustc's default -Cprofile-generate name (default_%m.profraw) has no PID, so every run merged into one file inside the profile runtime, on every platform. That runtime merge crashed on arm64 Windows (access violation in lprofMergeValueProfData, cdb stack). Linux and macOS now write 12 to 16 files instead of 1; the merged profile sizes and the PGO-against-plain check are the same.
  • The verify job checks that Node's process.platform-process.arch matches the package, so an emulated Node cannot hide a wrong package.
  • The build timeout goes from 120 to 180 minutes for the 4 vCPU GitHub-hosted runners. darwin-x64 takes about 63 minutes, win32-arm64 about 53.
  • ci.yml: the macOS test job cross checks the tsc for x86_64-apple-darwin (33 s), so a PR that breaks Intel macOS fails in CI.
  • Docs and npm/trust-setup.sh list the 7 packages. Run npm/trust-setup.sh before the next tag: @tsc-rs/darwin-x64, @tsc-rs/win32-arm64 (and @tsc-rs/win32-x64 from feat(release): Windows x64 tsc and a Windows CI job #33) are new on npm.

No Rust changes.

Runs

Head 1219df8f5:

  • Release 38019998692: green. All 7 builds (PGO, PGO-against-plain check) and all 7 verify jobs pass. darwin-x64 build 63 min, win32-arm64 build 53 min.
  • CI 38019998689: green. The x86_64-apple-darwin check passes on the macOS job.

Earlier runs on this PR:

  • Release 38007891677: win32-arm64 training crashed (exit 139) on the second run.
  • Diagnosis 38010948002 (temporary branch): the plain win32-arm64 tsc passes the training set. The instrumented one crashes in lprofMergeValueProfData (cdb).
  • Release 38013239266: with one profile file per run, llvm-profdata rejected all 12 profiles ("symbol name is empty").
  • Diagnosis 38015825984: with rust-lld, the names start right after the marker byte and llvm-profdata reads 63,989 functions.
  • Release 38015811497: all 7 builds pass. Both Windows verify jobs failed on tee /dev/stderr (no /dev/stderr in Git Bash on Actions). Fixed.

This PR was made by Claude Opus 5.5 in Claude Code (workflow agent).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Added support for macOS x64 and Windows ARM64, expanding the platforms available for the upcoming release.
  • Documentation
    • Updated the platform support and installation information to include macOS x64, Linux ARM64, and Windows ARM64.
    • Updated release guidance to cover packaging and publishing for the expanded platform set.

Note

Add Intel macOS and Windows arm64 tsc release builds

  • Expands the release build matrix in release.yml with darwin-x64 (macos-15-intel) and win32-arm64 (windows-11-arm) native runners, and raises the build timeout to 180 minutes.
  • Adds platform-specific npm packages and standalone archives, plus verify, publish, and trusted-publishing entries for both new platforms in trust-setup.sh and release.yml.
  • Adds a macOS CI step in ci.yml that cargo-checks the tsgo binary against the x86_64-apple-darwin target.
  • PGO changes: build-pgo.sh exports PGO_PROFILE_DIR to custom training commands, and pgo-train.sh writes a separate LLVM profile file per training run and aborts with exit code 3 when a project directory change fails.
  • Behavioral Change: Windows arm64 builds use the Rust rust-lld linker instead of the default linker; PGO training no longer treats a failed cd as an expected compiler diagnostic.

Macroscope summarized 271f600.

…he release

release.yml builds darwin-x64 (x86_64-apple-darwin) on GitHub's
macos-15-intel and win32-arm64 (aarch64-pc-windows-msvc, +crt-static) on
GitHub's windows-11-arm: Blacksmith has neither. Each gets the plain build,
the PGO build trained on its own platform, the PGO-against-plain check,
@tsc-rs/darwin-x64 or @tsc-rs/win32-arm64, an archive and a verify job on
the same runner image. The verify job checks that Node's platform and arch
match the package. The build timeout goes to 180 minutes for the 4 vCPU
runners.

ci.yml: the macOS test job cross checks the tsc for x86_64-apple-darwin.
Docs: the platform lists and npm/trust-setup.sh (7 packages).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 9, 2026 •

Copy link
Copy Markdown

Review in Change Stack →Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Team
  • Run ID: fe86cb7b-9640-4f47-9c9a-337cd7591d95


📥 Commits

Reviewing files that changed from the base of the PR and between 1219df8 and 271f600.



📒 Files selected for processing (2)
  • .github/workflows/release.yml
  • scripts/goport/pgo-train.sh


🚧 Files skipped from review as they are similar to previous changes (1)
  • .github/workflows/release.yml


Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 3 remain after this review.




Walkthrough

The release workflow adds macOS x64 and Windows arm64 builds, package verification, and publishing. Project documentation and trusted-publishing setup list the added platforms. PGO training now passes and uses the profile directory.

Changes

Platform package expansion

Layer / File(s) Summary
Add target builds and CI checks
.github/workflows/ci.yml, .github/workflows/release.yml
CI checks the Intel macOS target. The release matrix adds macOS x64 and Windows arm64 builds, with rust-lld configured for Windows arm64.
Package, verify, and publish targets
.github/workflows/release.yml
The workflow packages and publishes both targets. Verification runs on matching-architecture runners and checks Node's platform and architecture against the matrix.
Update platform and publishing instructions
README.md, npm/README.md, npm/tsc-rs-readme.md, npm/trust-setup.sh
Documentation and trusted-publishing setup include the added platform packages.

PGO profile handling

Layer / File(s) Summary
Pass and select PGO profile paths
crates/ts_goport/scripts/build-pgo.sh, scripts/goport/pgo-train.sh
The custom training command receives PGO_PROFILE_DIR. Compiler invocations set LLVM_PROFILE_FILE to a per-project, per-run path when that directory is set.

Priority: ➖ Normal

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant BuildRunners
  participant PlatformArchives
  participant VerificationRunners
  participant NpmRegistry
  GitHubActions->>BuildRunners: Build platform binaries
  BuildRunners->>PlatformArchives: Package Darwin x64 and Windows ARM64 binaries
  PlatformArchives->>VerificationRunners: Provide packages for installation checks
  VerificationRunners->>VerificationRunners: Check Node platform and architecture
  GitHubActions->>NpmRegistry: Publish platform packages
Loading

Merge Risk: ⚪ Minimal · up to 271f6

The new macOS Intel and Windows ARM64 packages are connected to their build, verification, and publishing paths, and PGO profiles are directed to the merge step. No concrete merge-blocking issue is apparent; proceed with normal CI and release validation.

Pre-merge checks | Passed 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. (1 skipped: 1 …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly identifies the release change for Intel macOS and Windows arm64 support. It matches the main objective of the pull request.

✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR



🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR



  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

t3dotgg and others added 3 commits October 9, 2026 17:10
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The win32-arm64 instrumented tsc crashed (access violation) in its second
training run. rustc's default profile name, default_%m_%p.profraw, has the
PID, and Windows gave that run the PID of the run before, so the profile
runtime merged into the existing file. That merge (LLVM 22
__llvm_profile_merge_from_buffer) skips the padding after the bitmap bytes,
and on arm64 Windows that section has 3 bytes, so it read the value profile
data 3 bytes off and past the end of the mapping (cdb stack in
lprofMergeValueProfData).

build-pgo.sh passes the profile dir to the training command as
PGO_PROFILE_DIR, and pgo-train.sh sets LLVM_PROFILE_FILE to
<dir>/<project>-<run>-%p.profraw for each run. llvm-profdata merges the
files, as before. Linux and macOS never reused a PID, so their profiles
do not change.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Comment thread scripts/goport/pgo-train.sh Outdated
The win32-arm64 training profiles had 3 zero bytes before the function
names, and llvm-profdata rejected every file ("malformed instrumentation
profile data: symbol name is empty"). On arm64, link.exe aligns each
section contribution to 4 bytes, also the 1-byte start marker of the
LLVM names section (.lprfn$A, IMAGE_SCN_ALIGN_1BYTES), so the names began
at offset 4, not 1 (PDB section contributions of the instrumented tsc).
The same padding gave the bitmap section 3 bytes, which broke the
runtime merge.

The win32-arm64 build sets CARGO_TARGET_AARCH64_PC_WINDOWS_MSVC_LINKER to
the toolchain's rust-lld, for the plain, the instrumented and the PGO
build. lld-link keeps the 1-byte alignment, as link.exe does on x64.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@t3dotgg
t3dotgg changed the base branch from goport-win1 to main October 10, 2026 02:50
t3dotgg and others added 3 commits October 9, 2026 20:16
Git Bash on the Windows runners has no /dev/stderr, so tee failed in both Windows verify jobs.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
…file comment

A failed cd in one() left the subshell running with rc 0, and rc 1 or 2
counts as expected diagnostics, so it now exits 3. rustc's default
-Cprofile-generate name has no PID: every run merged into one file in the
runtime, which crashed on arm64 Windows.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
t3dotgg added a commit that referenced this pull request Oct 10, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@t3dotgg
t3dotgg merged commit 6c16912 into main Oct 10, 2026
22 checks passed
t3dotgg added a commit that referenced this pull request Oct 10, 2026
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
t3dotgg added a commit that referenced this pull request Oct 10, 2026
Automatic merge. main has R188 (goport-int58 515506f, already merged)
and PR #34 (CI, release workflow, PGO training, npm files). PORTING.md
is unchanged by this merge: main resolved the K2 list as int59 did (G5 no
early emit, G6 partial writes).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
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.

1 participant