Skip to content

Commit 250c21e

Browse files
tannevaledclaude
authored andcommitted
feat(matrix): allow pkg.yml to opt in to windows/x86-64
Today get-matrix.ts throws "invalid platform" the moment a pkg.yml lists `windows/` anywhere. That's a hard ceiling on Windows enablement even at the discussion level — there's no way to materialise the gap in actual CI. Open the door without changing default behaviour: - Extend the per-platform regex to accept `(linux|darwin|windows)`. The default-platforms list (used when a pkg.yml omits `platforms:`) stays linux+darwin only. Existing packages get an identical matrix. - Add a `case 'windows/x86-64'` to get_matrix() that targets the hosted `windows-latest` runner. - Accept the shorthand `windows` (resolves to `windows/x86-64`; no arm64 Windows runners on GitHub Actions today). This is intentionally a no-op for every package currently in the pantry — only a package that *explicitly* lists `platforms: [windows/x86-64]` is affected. Such a package will fail at `brewkit/build@v1` (which has no Windows codepath today), which is the point: it surfaces brewkit's gap as a real CI failure rather than a planning-time throw, and gives a place to discuss Windows enablement with concrete build logs. ## Why now In pkgxdev/pkgm#87 I'm porting pkgm to Windows. The pkgm-side work is essentially done (per-user install_prefix to %LOCALAPPDATA%\pkgm, hardlink fallback for symlink_with_overwrite, .cmd stub wrappers, PATH_SEP awareness throughout). But `pkgm install <anything>` on Windows fails with `CmdNotFound` because the dist S3 bucket has zero Windows artifacts (probed all 842 top-level prefixes — none have a `windows/` subdir). The trail leads here: get-matrix.ts refuses Windows at planning time. This PR doesn't fix anything end-to-end. It removes the planning- level veto so we can have the brewkit-side conversation with concrete artefacts to point at. ## Refs - pkgxdev/pkgx#607 — platform-support megaticket; lists Windows as planned with libpkgx#48 marked v1-wip. - pkgxdev/pkgm#87 — pkgm port to Windows (scaffolding pass, draft). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2a1092a commit 250c21e

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

.github/scripts/get-matrix.ts

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,19 @@ if (ghout) {
2727
async function get_config(pkg: {project: string}) {
2828
let { platforms, test } = await hooks.usePantry().project(pkg).yaml()
2929
const get_platforms = (() => {
30+
// Windows is intentionally NOT in the default-platforms list: a
31+
// pkg.yml has to opt in by listing `windows/x86-64` explicitly,
32+
// because brewkit doesn't run on Windows runners yet — see the PR
33+
// description. Once brewkit supports Windows, the default list
34+
// should grow `windows/x86-64`.
3035
if (!platforms) return ["linux/x86-64", "linux/aarch64", "darwin/x86-64", "darwin/aarch64"]
3136
if (isString(platforms)) platforms = [platforms]
3237
if (!isArray(platforms)) throw new Error(`invalid platform node: ${platforms}`)
3338
const rv = []
3439
for (const platform of platforms) {
35-
if (platform.match(/^(linux|darwin)\/(aarch64|x86-64)$/)) rv.push(platform)
40+
if (platform.match(/^(linux|darwin|windows)\/(aarch64|x86-64)$/)) rv.push(platform)
3641
else if (platform.match(/^(linux|darwin)$/)) rv.push(`${platform}/x86-64`, `${platform}/aarch64`)
42+
else if (platform === "windows") rv.push("windows/x86-64") // no arm64 windows runners yet
3743
else throw new Error(`invalid platform: ${platform}`)
3844
}
3945
return rv
@@ -83,5 +89,19 @@ function get_matrix(platform: string) {
8389
"test-os": [os],
8490
"test-container": [null],
8591
tinyname: "*nix·ARM64"
86-
}}}
92+
}}
93+
case 'windows/x86-64': {
94+
// Hosted GitHub runner; no self-hosted Windows pool today.
95+
// brewkit/build@v1 doesn't have a Windows code path — this case
96+
// exists so a pkg.yml that opts in to `windows/x86-64` produces
97+
// a buildable matrix entry, surfacing brewkit's gap with a real
98+
// CI failure rather than a "invalid platform" throw at planning.
99+
const os = "windows-latest"
100+
return {
101+
os, name,
102+
"test-os": [os],
103+
"test-container": [null],
104+
tinyname: "win64"
105+
}}
106+
}
87107
}

0 commit comments

Comments
 (0)