Skip to content

ci: drop scoop from the Windows arm64 job - #523

Merged
sosukesuzuki merged 1 commit into
mainfrom
farm/8974c5b0/windows-arm64-ninja-without-scoop
Aug 27, 2026
Merged

ci: drop scoop from the Windows arm64 job#523
sosukesuzuki merged 1 commit into
mainfrom
farm/8974c5b0/windows-arm64-ninja-without-scoop

Conversation

@robobun

@robobun robobun commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Problem

  • Every Preview Build since 2026-08-27 07:15 UTC fails on Build / Windows (windows-11-arm, Debug, arm64, bun-webkit-windows-arm64-debug, ARM64): Install LLVM and Ninja (ARM64) exits 1 at once, and the release job needs that artifact.
  • Install Scoop takes 2 s (24 s before) and installs nothing: ScoopInstaller/Install@a6210927 (07:15 UTC) skips the install flow when $MyInvocation.InvocationName is ., which is what irm get.scoop.sh | iex sees inside a dot-sourced step script. The next step fails on the missing scoop command.

Fix

  • Remove the Install Scoop step and the three scoop lines (scoop config, scoop install ninja, the 7-Zip GITHUB_PATH entry that only served scoop). Rename the step to Install LLVM (ARM64). The LLVM download is unchanged.
  • Nothing replaces the ninja install: the build never ran that ninja. windows-release.ps1:30-34 moves every Visual Studio PATH entry to the front, so cmake -G Ninja resolves VS's bundled CMake\Ninja\ninja.exe. Every passing run's log shows it as the build command.
  • windows-release.ps1 now prints (Get-Command ninja).Path next to the link and clang-cl it already prints, so a missing ninja fails there with the reason in the log.
  • Verified: run 33065119524 (first revision, scoop removed, ninja downloaded instead) passed the full Preview Build. Its log shows cmake used VS's ninja. This revision's Preview Build is the end-to-end check.

Background

  • The release job needs all 42 artifacts. bun-webkit-windows-arm64-debug is the only one built on a native Windows runner.
  • GitHub's default pwsh shell runs pwsh -command ". '<script>'", so $MyInvocation.InvocationName is . in a step. Invoke-Expression runs in the caller's scope with the caller's $MyInvocation.
Notes

Failing runs: 33060265924 (and its rerun), 33060247998, 33060250463, 33060284775, 33060269980.

Timing from the Actions API for the Windows arm64 job:

run Install Scoop Install LLVM and Ninja
33014807074 (2026-08-26 21:21Z, pass) 24 s 35 s
33047663455 (2026-08-27 06:56Z, pass) 24 s 38 s
33060284775 (2026-08-27 09:49Z, fail) 2 s 0 s
33060265924 (2026-08-27 10:26Z, fail, rerun) 2 s 1 s

The cause was confirmed by reproducing the invocation on a Windows 11 arm64 machine:

pwsh -command ". 'C:\tmp\step.ps1'"
  outer: InvocationName=[.]
  iex:   InvocationName=[.]      <- what the installer sees
  & {}:  InvocationName=[&]

With the current installer, irm get.scoop.sh | iex in such a step prints nothing (not even Initializing...). iex "& {$(irm get.scoop.sh)}" or running the downloaded file with & does run the install flow. Neither is used here because nothing in the job needs scoop: the installer changed behavior three times in 2026 (#124/#125 in January, #134 on 2026-08-20, #135/#136 on 2026-08-27).

Which ninja the build uses, from the log of run 33065119524 (first revision of this PR, image 20260823.149.1): the PATH printed after the reorder in windows-release.ps1 has ...\CommonExtensions\Microsoft\CMake\Ninja at position 15, C:\LLVM\bin and C:\ninja after it, the image's C:\Tools\Ninja (Ninja 1.13.2) further back. Line 13781: Run Build Command(s): C:/PROGRA~1/MICROS~2/2022/ENTERP~1/Common7/IDE/COMMON~1/MICROS~1/CMake/Ninja/ninja.exe -v jsc testFFI. cmake itself also comes from VS (...\CMake\CMake\bin\cmake.exe). Run 33047663455 (last pass with scoop) shows the same: scoop\shims was behind VS's ninja after the reorder.

The first revision of this PR downloaded ninja-winarm64.zip 1.13.2 with a sha256 check. That was dropped after review because it was dead code: the build does not use it, and the job already floats on the image's cmake, VS, Windows SDK and 7-Zip.

#524 and the workflow commits in #485 and #517 address the same break.

Not changed here: whether the release job should require the Windows arm64 debug artifact at all. Bun's CI consumes only the release Windows arm64 tarball.

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

  • Run on-demand review

On-demand reviews are free for the next 24 days. After that, they cost $0.25 per reviewed file.

Or wait 2 minutes for your next included review.

View limit details

Limit details: You’ve used all 5 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: c453ce12-2ec9-4e88-82b4-53402fac71a7

📥 Commits

Reviewing files that changed from the base of the PR and between 568ccc2 and 9877148.

📒 Files selected for processing (2)
  • .github/workflows/build-reusable.yml
  • windows-release.ps1

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

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

LGTM — straightforward CI fix that swaps a fragile remote installer for a pinned, checksummed download.

What was reviewed:

  • Download/verify/extract logic: Get-FileHash result is lower-cased before comparison, throw fails the step on mismatch, Expand-Archive -Force and >> $Env:GITHUB_PATH are correct.
  • Removed "C:\Program Files\7-Zip" >> $Env:GITHUB_PATH is safe — the LLVM extraction on line 280 already uses the absolute 7z.exe path, and no other step relied on it.
  • No remaining scoop references in any workflow; Set-ExecutionPolicy removal is fine since nothing else needed it.
Extended reasoning...

Overview

This PR touches a single file, .github/workflows/build-reusable.yml, modifying only the Windows ARM64 job's dependency-install step. It removes the Install Scoop step (which piped get.scoop.sh into Invoke-Expression) and the scoop install ninja lines, replacing them with a direct download of ninja-winarm64.zip v1.13.2 from the official ninja-build/ninja GitHub release, a SHA-256 check, extraction to C:\ninja, and a GITHUB_PATH append. The LLVM 21 ARM64 install portion is untouched. An inline comment documents why Scoop was dropped (the upstream installer now no-ops when dot-sourced, which is how the runner's default pwsh shell invokes run: scripts).

Security risks

This is a net security improvement: the old flow executed a remote script fetched at runtime (irm get.scoop.sh | iex) with no integrity check on the installer itself; the new flow downloads a fixed asset over HTTPS from github.com and verifies it against a pinned SHA-256 before use. A wrong or tampered archive fails the step via throw. There is no injection surface (no user/PR-controlled input flows into the URL, hash, or paths — all are literals), no credential handling, and no change to permissions or artifact publishing. The removed Set-ExecutionPolicy RemoteSigned and 7-Zip GITHUB_PATH append were only needed for Scoop and are no longer referenced anywhere in .github/workflows/.

Level of scrutiny

Low. This is a small, mechanical CI infrastructure fix responding to an upstream breakage, confined to one job in a reusable workflow. No product code (JSC/WTF/bmalloc) is touched. Correctness is directly verifiable by the PR's own Preview Build run, and a wrong hash or URL would fail loudly rather than silently. The .github/CODEOWNERS entry for /.github is inherited from upstream Apple WebKit and the file itself states it does not denote ownership; it is not a meaningful gate for Bun-fork CI changes.

Other factors

I confirmed the only remaining 7-Zip usage (LLVM extraction) invokes 7z.exe by absolute path, so dropping the PATH append is safe. Get-FileHash returns uppercase hex, and the code normalizes with .ToLower() before comparing to the lowercase literal. Expand-Archive -Force avoids failures if C:\ninja pre-exists on the runner image. The bug-hunt exited on dry_streak with no findings. There are no prior reviews or outstanding objections in the timeline.

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown

Preview Builds

Commit Release Date
9877148b autobuild-preview-pr-523-9877148b 2026-08-27 15:09:44 UTC
7aed464d autobuild-preview-pr-523-7aed464d 2026-08-27 11:49:07 UTC

The get.scoop.sh installer no longer runs Install-Scoop when the script
is dot-sourced (ScoopInstaller/Install@a6210927, 2026-08-27). The
runner's pwsh shell dot-sources every `run:` script, and
Invoke-Expression inherits that invocation, so the "Install Scoop" step
exited 0 without installing anything. The next step then failed on the
missing `scoop` command, and no preview release was published.

The job only used scoop to install ninja, and that ninja was never the
one the build ran: windows-release.ps1 moves every Visual Studio PATH
entry to the front, so cmake picks up VS's bundled ninja (the build log
shows Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe).
Remove the scoop steps and the 7-Zip PATH entry that only served scoop.
The LLVM download is unchanged.

windows-release.ps1 now prints the ninja it resolves next to the link
and clang-cl it already prints, so a missing ninja fails there with the
path in the log.
@robobun
robobun force-pushed the farm/8974c5b0/windows-arm64-ninja-without-scoop branch from 7aed464 to 9877148 Compare August 27, 2026 14:37
@robobun robobun changed the title ci: install ninja for the Windows arm64 job from its GitHub release, not from scoop ci: drop scoop from the Windows arm64 job Aug 27, 2026
Comment on lines +263 to 268
- name: Install LLVM (ARM64)
if: matrix.platform == 'ARM64'
run: |
"C:\Program Files\7-Zip" >> $Env:GITHUB_PATH
scoop config use_external_7zip true
scoop install ninja
# Install LLVM ARM64 from official LLVM releases
# Use LLVM 21 for ARM64 - has better Windows ARM64 support and fixes SEH unwind bugs
$llvmVersion = "21.1.8"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 PR title/description say ninja is downloaded from the GitHub release (ninja-winarm64.zip 1.13.2, sha256-checked, extracted to C:\ninja, added to GITHUB_PATH), but the diff only deletes the scoop steps — no ninja install is added. The new comment claims ninja comes from the Visual Studio PATH reorder in windows-release.ps1, yet the PR body itself says "this change does not start to" rely on the runner-preinstalled ninja, so the intended install step appears to have been left out of the commit.

Extended reasoning...

After merge the Windows arm64 job depends on whatever ninja happens to be on PATH (Launch-VsDevShell.ps1 does not add VS's bundled CMake/Ninja dir, so this is really the runner-image ninja the author explicitly said not to rely on). If that preinstalled ninja is removed or changes in a future windows-11-arm image, (Get-Command ninja).Path at windows-release.ps1:39 throws under $ErrorActionPreference = "Stop" and the build fails again — the pinned, hash-verified download the PR promises would prevent that but is absent; a correct fix adds the described Invoke-WebRequest + Get-FileHash check + Expand-Archive to C:\ninja + >> $Env:GITHUB_PATH to this step.

Verification: normal — The PR title ("install ninja for the Windows arm64 job from its GitHub release") and the Fix section of the description ("Download ninja-winarm64.zip 1.13.2 from the ninja GitHub release, check its sha256, extract it to C:\ninja, and add that to GITHUB_PATH") describe a ninja install step that is not present in the diff. The post-change workflow at… | nit — The mismatch is…

@sosukesuzuki
sosukesuzuki merged commit d9feedf into main Aug 27, 2026
90 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.

2 participants