Skip to content

ci: add windows-latest build job so Windows compile/link breaks fail PRs - #6610

Merged
proggeramlug merged 1 commit into
mainfrom
ci/windows-build-job
Jul 19, 2026
Merged

ci: add windows-latest build job so Windows compile/link breaks fail PRs#6610
proggeramlug merged 1 commit into
mainfrom
ci/windows-build-job

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

What

Adds a windows-build job to .github/workflows/test.yml (the required-checks workflow). It runs on windows-latest and builds:

cargo build --profile perry-dev -p perry -p perry-runtime -p perry-stdlib -p perry-ui-windows -p perry-ui-windows-winui

That package set covers the compiler binary (so perry.exe actually links), the runtime/stdlib pair (the usual home of cfg(windows) externs), and both Windows UI crates — exactly the crates cargo-test's ubuntu runner must --exclude and therefore never compiles. Setup mirrors the workflow's existing conventions: actions/checkout@v7, dtolnay/rust-toolchain@stable, Swatinem/rust-cache@v2 with shared-key: "${{ runner.os }}-perry" (auto-keyed per OS) and the same main-only save-if (the nightly cron warms it, since schedule runs on refs/heads/main).

Why

Every job in this workflow runs exclusively on ubuntu/macos, so Windows builds of main break silently. Two real, current examples that shipped through green required checks:

  1. rustc E0308 in perry-runtime — the ExitProcess extern declaration in crates/perry-runtime/src/process/env_misc.rs (Windows-only cfg, so Unix CI never type-checks it). Fix in flight on fix/windows-exitprocess-never.
  2. LNK2019: js_crypto_ed25519_verify unresolved when linking perry.exe — the extern is declared in perry-updater but only defined in perry-stdlib; Unix linkers dead-strip the unused reference, MSVC's link.exe hard-errors. Fix in a parallel PR.

This job would have turned both into a red PR check instead of a broken main.

Why the perry-dev profile

perry-dev (opt-level 1, codegen-units 16, no LTO — see [profile.perry-dev] in Cargo.toml) builds in minutes instead of the ~30+ a --release/LTO build takes, while still driving the full compile and link of perry.exe — so both the E0308 class and the LNK2019 class are caught. --release would be far too slow for per-PR CI and adds nothing for this gate.

Notes

  • timeout-minutes: 75: cold Windows builds are slow and this workflow never runs on pushes to main, so PR runs after a cache-less night can be near-cold; a timeout on a required-path job is a deterministic PR blocker (same reasoning as the conformance-smoke bump in CI: conformance-smoke shards hit the 60-min timeout-minutes cap; slowest shard cancels and blocks merges #6456).
  • Making the job a required check is repo branch-protection settings, not yml — left to the maintainer.
  • Expect this job to be red on this PR until the two fixes above merge: it is gating exactly the breaks that motivated it.
  • No version bump / changelog per maintainer instruction — folded in at merge.

Summary by CodeRabbit

  • Tests
    • Added a Windows build verification job to detect platform-specific compilation and linking issues.
    • Windows builds now cover the core application, runtime, standard library, and Windows UI components.

@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds a Windows-only GitHub Actions job that installs stable Rust, enables caching, and builds the compiler, runtime, standard library, and Windows UI crates with the perry-dev profile.

Changes

Windows build CI

Layer / File(s) Summary
Windows compilation checkpoint
.github/workflows/test.yml
Adds a windows-build job on windows-latest with a 75-minute timeout, stable Rust setup, main-branch cache saving, and compilation of the specified crates using the perry-dev profile.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Suggested reviewers: andrewtdiz, thehypnoo

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is substantive, but it does not follow the required template and omits Summary, Changes, Related issue, Test plan, and Checklist sections. Reformat the PR body to match the template and add Summary, Changes, Related issue, Test plan, and Checklist entries.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title is concise and accurately describes the new Windows CI build job that gates compile/link failures.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/windows-build-job

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/test.yml:
- Line 625: Update the actions/checkout step in the PR build job to set
persist-credentials to false, preventing the GitHub token from being stored in
local Git configuration while leaving the existing checkout behavior unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 6d6b436a-2028-4ce2-956b-24dbe34c25af

📥 Commits

Reviewing files that changed from the base of the PR and between 01edd9f and d80af3f.

📒 Files selected for processing (1)
  • .github/workflows/test.yml

# timeout on a required-path job is a deterministic PR blocker).
timeout-minutes: 75
steps:
- uses: actions/checkout@v7

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Inspect the relevant workflow section around the reported line.
sed -n '600,650p' .github/workflows/test.yml

# Show the workflow triggers and top-level permissions if present.
python3 - <<'PY'
from pathlib import Path
import re
p = Path('.github/workflows/test.yml')
text = p.read_text()
for key in ['on:', 'permissions:']:
    m = re.search(rf'(^\s*{key}.*$)', text, re.M)
    print(f"\n== first {key} line ==")
    print(m.group(1) if m else 'not found')
PY

Repository: PerryTS/perry

Length of output: 3005


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Map all uses of actions/checkout in workflows to see if this repo consistently disables credentials.
rg -n "actions/checkout@v7|persist-credentials" .github/workflows -S

Repository: PerryTS/perry

Length of output: 3401


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Read the workflow header to inspect triggers and permissions.
sed -n '1,120p' .github/workflows/test.yml

# Inspect the exact job block around the reported checkout step.
sed -n '610,640p' .github/workflows/test.yml

Repository: PerryTS/perry

Length of output: 6956


🏁 Script executed:

#!/bin/bash
set -euo pipefail

# Find the event names used by this workflow.
rg -n "^\s*(pull_request|pull_request_target|push|schedule|workflow_dispatch|workflow_call)\b" .github/workflows/test.yml

# Show the job name that contains the reported checkout step.
python3 - <<'PY'
from pathlib import Path
text = Path('.github/workflows/test.yml').read_text().splitlines()
for i in range(620, 633):
    print(f"{i+1}: {text[i]}")
PY

Repository: PerryTS/perry

Length of output: 735


🏁 Script executed:

#!/bin/bash
set -euo pipefail

sed -n '1,90p' .github/workflows/test.yml

Repository: PerryTS/perry

Length of output: 3980


🏁 Script executed:

#!/bin/bash
set -euo pipefail

nl -ba .github/workflows/test.yml | sed -n '618,633p'

Repository: PerryTS/perry

Length of output: 191


Disable checkout credential persistence for the PR build job.

actions/checkout writes ${{ github.token }} into the local Git config by default. Since this job runs Cargo build scripts and procedural macros on pull requests, set persist-credentials: false so untrusted build code can’t reuse the token.

🧰 Tools
🪛 zizmor (1.26.1)

[warning] 625-625: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/test.yml at line 625, Update the actions/checkout step in
the PR build job to set persist-credentials to false, preventing the GitHub
token from being stored in local Git configuration while leaving the existing
checkout behavior unchanged.

Source: Linters/SAST tools

@proggeramlug
proggeramlug merged commit 5a1a333 into main Jul 19, 2026
23 of 26 checks passed
@proggeramlug
proggeramlug deleted the ci/windows-build-job branch July 19, 2026 01:16
proggeramlug added a commit that referenced this pull request Jul 20, 2026
actions/checkout leaves the workflow token in .git/config by default;
the windows-build job compiles PR-controlled build scripts and proc
macros, so it should not have the token on disk. Flagged by zizmor
(artipacked) via the CodeRabbit review on #6610. The 16 pre-existing
checkout steps in this workflow share the same default; sweeping them
is left as a maintainer decision since some jobs may rely on the
persisted token.

Co-authored-by: Ralph Kuepper <ralph@skelpo.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