Skip to content

ci: run the Scoop installer as a script file so it still installs after ScoopInstaller/Install#136 - #524

Closed
robobun wants to merge 1 commit into
mainfrom
farm/31ade078/ci-scoop-install
Closed

ci: run the Scoop installer as a script file so it still installs after ScoopInstaller/Install#136#524
robobun wants to merge 1 commit into
mainfrom
farm/31ade078/ci-scoop-install

Conversation

@robobun

@robobun robobun commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

Problem

  • Every Preview Build in this repository since 09:48 UTC today fails the windows-11-arm job (bun-webkit-windows-arm64-debug) about 7 seconds after it starts: the Install Scoop step finishes in 2 seconds instead of 24, and the next step dies on scoop config because scoop is not on PATH. Nine runs on nine branches fail the same way, and no preview release gets published because the release job needs every build job.
  • The cause is upstream: ScoopInstaller/Install a6210927 ("refactor!: guard install flow against dot-sourcing", Replace Cygwin-based ICU build with MSBuild on Windows #136, 07:15 UTC today) wraps the install flow in if ($MyInvocation.InvocationName -ne '.'). GitHub Actions runs a pwsh step by dot-sourcing the step script, so Invoke-RestMethod -Uri https://get.scoop.sh | Invoke-Expression (build-reusable.yml:260) now inherits . as the invocation name, defines the installer's functions, and returns without installing anything.

Fix

  • Download get.scoop.sh to a file under $env:RUNNER_TEMP and run it with the call operator. A script run as & $path has the path as its invocation name, so the guard passes and Install-Scoop runs, exactly as before the upstream change. No installer option changes (-RunAsAdmin is still not passed).
  • The step now fails by itself if scoop\shims\scoop.ps1 is missing afterwards, so a silent skip like this one stops at the step that caused it instead of one step later.
  • Verified by reading the installer: c64d4147 and a6210927 in ScoopInstaller/Install are the only changes to it today, and $IS_EXECUTED_FROM_IEX (the only other place that looks at how the script was started) affects just how a failed install exits, which $env:CI already controls. The Preview Build of this PR is the runtime check: its windows-11-arm job has to pass.

Background

  • build-reusable.yml is the shared build matrix behind both the Preview Build workflow (PRs) and the release builds. The Windows arm64 jobs install ninja through Scoop and LLVM from a release archive.
  • $MyInvocation.InvocationName is the command name as typed by the caller: . for a dot-sourced script, & for a script block run with the call operator, and the path for & $path. Invoke-Expression runs its text in the caller's scope, so the text sees the caller's $MyInvocation.

…ession

ScoopInstaller/Install#136 (2026-08-27) made install.ps1 skip the install
flow when it is dot-sourced: the script now only calls Install-Scoop when
$MyInvocation.InvocationName is not '.'. GitHub Actions runs a pwsh step by
dot-sourcing the step script, so `irm get.scoop.sh | iex` inherits that
invocation name, defines the functions and exits without installing. The
next step then fails on `scoop config` within a second. Every Preview Build
and release build in this repository has failed that way on the
windows-11-arm job since 09:48 UTC.

Download the installer to a file and run it with the call operator, whose
invocation name is the file path, and fail the step if scoop.ps1 is not in
the shims directory afterwards.

@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 hotfix for the upstream Scoop installer's new dot-sourcing guard.

What was reviewed:

  • Confirmed the download source (https://get.scoop.sh) and installer invocation options are unchanged, so no new supply-chain surface is introduced.
  • Checked that & $scoopInstaller gives the script its file path as $MyInvocation.InvocationName, satisfying the -ne '.' guard added in ScoopInstaller/Install#136.
  • Verified the new Test-Path guard and the unchanged $GITHUB_PATH append both resolve ~\scoop\shims the same way, so the fail-fast check matches what the next step actually needs.
  • Scoped to the windows-11-arm job only; no other matrix legs or the artifact-publish path are touched.
Extended reasoning...

Overview

This PR modifies a single step ("Install Scoop") in the Windows job of .github/workflows/build-reusable.yml. It replaces the one-line Invoke-RestMethod https://get.scoop.sh | Invoke-Expression with a download-to-temp-file + call-operator invocation, adds a Test-Path guard that throws if ~\scoop\shims\scoop.ps1 is missing after the installer returns, and keeps the existing $GITHUB_PATH append. The change is 1 line removed, 9 lines added (3 of which are an explanatory comment). It addresses an upstream behavior change in ScoopInstaller/Install#136 where the installer now no-ops when dot-sourced — and GitHub Actions dot-sources pwsh step scripts, so iex inherits . as the invocation name.

Security risks

None introduced. The script is still fetched over HTTPS from the same origin (get.scoop.sh) that the workflow already trusted; the only difference is that it lands in $env:RUNNER_TEMP before execution instead of being piped through iex. No new network endpoints, no credentials, no -RunAsAdmin or other privilege changes, and no user- or PR-controlled input flows into the step. The added Test-Path check is purely defensive and reads a fixed path under the runner's home directory.

Level of scrutiny

Low. This is a small, mechanical CI-infrastructure fix with a well-documented root cause and a standard workaround (run the installer as a script file rather than via iex). The Windows job it touches is a single matrix leg (windows-11-arm, Debug), and the change is self-contained within one step. The bug-hunt exited on dry_streak with no findings and no ruled-out candidates. The repository's .github/CODEOWNERS nominally covers /.github, but that file is inherited verbatim from upstream Apple WebKit (Apple copyright header, all upstream WebKit contributors) and does not reflect ownership of Bun-fork-specific CI workflows like build-reusable.yml, which do not exist upstream.

Other factors

The PR description is unusually thorough and matches the diff exactly. The added inline comment documents why the workaround is needed, which will help future maintainers. The fail-fast throw moves the error to the step that caused it rather than the following scoop config call, improving debuggability. Runtime verification is provided by this PR's own Preview Build, which exercises the exact job being fixed.

@coderabbitai

coderabbitai Bot commented Aug 27, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f7fd2385-e66f-4dad-9b2f-8915522c7845

📥 Commits

Reviewing files that changed from the base of the PR and between 7259739 and bd90755.

📒 Files selected for processing (1)
  • .github/workflows/build-reusable.yml

Included review availability: Your plan provides up to 5 included reviews per hour; 1 remains after this review.


Walkthrough

Changes

The Windows ARM64 runner now executes the Scoop installer from a temporary PowerShell script. The workflow verifies the Scoop shim and reports installation failure explicitly.

Windows Scoop installation

Layer / File(s) Summary
Install and validate Scoop
.github/workflows/build-reusable.yml
The workflow downloads and executes install-scoop.ps1 as a file. It checks for the Scoop PowerShell shim and fails when installation is unsuccessful.

Merge Risk: ⚪ Minimal · up to bd907

The change runs the Scoop installer from a script file and fails fast if installation does not complete, restoring Windows ARM build setup behavior; no actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 3 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description clearly explains the CI failure, root cause, fix, validation, and affected workflow. It does not follow the repository template because it omits a bug title, Bugzilla URL or ID, the re… Add the required bug title, Bugzilla URL or ID, "Reviewed by NOBODY (OOPS!)." line, a concise explanation of why the fix resolves the bug, and the changed file and function entries required by the template.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies the main CI change: running the Scoop installer as a script file to address ScoopInstaller/Install#136.
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.
Full details: Description check

Explanation

The description clearly explains the CI failure, root cause, fix, validation, and affected workflow. It does not follow the repository template because it omits a bug title, Bugzilla URL or ID, the required review line, and a dedicated changed-file/function list.

  • Fix all pre-merge checks with AI

Warning

Git: CodeRabbit could not clone the repository, so clone-backed analysis was skipped and this review may be incomplete. Verify repository clone access, such as SSH credentials, before requesting another full review. If clone access is intentionally unavailable, use path_filters to narrow the review scope.


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

@github-actions

Copy link
Copy Markdown

Preview Builds

Commit Release Date
bd907558 autobuild-preview-pr-524-bd907558 2026-08-27 11:54:50 UTC

@robobun

robobun commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

Runtime check of this fix: the Preview Build of #485 at c3bf2c74, which carries this commit, passed all 43 jobs (https://github.com/oven-sh/WebKit/actions/runs/33065627856). Its windows-11-arm job ran Install Scoop in 21 seconds and Install LLVM and Ninja (ARM64) in 34 seconds, then built for 25 minutes, against the 7 second failures of every run since 09:48 UTC.

@robobun

robobun commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

#523 (opened at 10:55 UTC) fixes the same break by removing scoop from the job instead of keeping it alive. Two findings from that PR's preview build that apply here as well:

  • The build never used the scoop ninja. windows-release.ps1:30-34 moves every Visual Studio PATH entry to the front, so cmake -G Ninja resolves VS's bundled Common7\IDE\CommonExtensions\Microsoft\CMake\Ninja\ninja.exe. The log of every passing run (for example 33047663455, line 13709, and 33065119524, line 13781) shows that path as the build command. The runner image also ships Ninja 1.13.2 at C:\Tools\Ninja.
  • The Preview Build of ci: drop scoop from the Windows arm64 job #523 (run 33065119524) passed end to end with scoop removed and the release published.

Keeping the installer alive keeps the job dependent on get.scoop.sh, which changed behavior three times in 2026. Since nothing in the job needs scoop, I suggest closing this one in favor of #523.

@robobun

robobun commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator Author

Superseded by #523, which removed Scoop from the Windows arm64 job instead of fixing the installer call. Closing.

@robobun robobun closed this Aug 27, 2026
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