Skip to content

Add ucrt64 architecture axis#1361

Merged
dscho merged 13 commits into
mainfrom
ucrt64
Jun 12, 2026
Merged

Add ucrt64 architecture axis#1361
dscho merged 13 commits into
mainfrom
ucrt64

Conversation

@dscho

@dscho dscho commented Jun 7, 2026

Copy link
Copy Markdown
Member

MSYS2 deprecated MINGW64 a while back; new packages no longer get accepted there, and updates of the ones we already ship have been winding down. Git for Windows therefore has to move the SDK over to UCRT64, and the kickoff for that move on git-sdk-64 itself happened in git-for-windows/git-sdk-64#117.

Several Git for Windows component repositories (notably https://github.com/git-for-windows/git, https://github.com/git-for-windows/build-extra, and https://github.com/git-for-windows/MINGW-packages) materialise their CI environment by calling into this Action. Once they want to start exercising UCRT64 builds, they have to be able to ask for architecture: ucrt64 and get a UCRT64 SDK back. That is what this PR sets up.

The ucrt64 axis added here lives on a dedicated long-lived branch of git-sdk-64, runs under MSYSTEM=UCRT64, and keeps its on-disk output directory and cache key distinct from the existing x86_64 axis so the two variants can coexist on the same runner without clobbering each other. Only flavor: full is wired up end-to-end at this point; the other flavors depend on follow-up work in build-extra and on the ci-artifacts pipeline of git-sdk-64, both of which are explicitly tracked in git-for-windows/git-sdk-64#117 (comment).

The long-term plan is to "merge --theirs" ucrt64 into main in the git-sdk-64, therefore the architecture: ucrt64 setting is intentionally transitional (eventually it will be synonymous to x86_64).

The branch starts with a fresh AGENTS.md written against the pre-UCRT64 state of the repository, and only the later commits extend that document as the actual ucrt64 support lands. That way each commit reads as an accurate snapshot of the tree at that point, which makes the series easier to review one commit at a time. The final commit is the conventional npm run build && npm run package regeneration of dist/index.js.

dscho added 6 commits June 7, 2026 16:21
This Action is the entry point through which dozens of Git for Windows
component workflows materialise a build environment, so understanding
its shape (TypeScript -> tsc -> ncc -> dist/index.js, run as a Node 24
GitHub Action) and the flavor/architecture matrix it exposes is a
prerequisite for almost any non-trivial change here. New contributors
and AI agents alike have so far had to reverse-engineer that picture
from action.yml, the workflows, and a careful read of main.ts and
src/git.ts, which loses a fair amount of context: that the bundled
dist/index.js is verified by CI and must be regenerated in its own
commit, that the v0/v1/v2 release trains are floating branches
fast-forwarded from signed tags by release-tag.yml, that the
ci-artifacts fast path only kicks in for specific flavor+runner
combinations, and that the project's commit-message style is the same
flowing-prose convention used elsewhere in the Git for Windows
ecosystem.

Write that institutional knowledge down once, in an AGENTS.md that
follows the same shape used by the AGENTS.md files in
https://github.com/git-for-windows/git-for-windows.github.io,
https://github.com/git-for-windows/7-Zip,
https://github.com/git-for-windows/git-for-windows-automation, and
https://github.com/git-for-windows/msys2-runtime.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The `ucrt64` axis introduced by
git-for-windows/git-sdk-64#117 is materialised
from the same `git-sdk-64` repository as the existing `x86_64` axis,
just from a different long-lived branch (and with the UCRT64 flavour of
the MSYS2 toolchain rather than MINGW64). The two variants therefore
need distinct artifact names so that the on-disk output directory and
the @actions/cache key do not collide on a runner that has previously
materialised the other variant.

Map `architecture: ucrt64` to the `git-sdk-64` repository and pick
`git-sdk-ucrt64-<flavor>` as the artifact name; leave the other three
architectures untouched. This is the first piece of the larger change
to teach this Action about the `ucrt64` axis; subsequent commits will
hook it up in `getViaGit` and `main.ts`.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
`getViaGit` currently always tells `clone()` to fetch the `main`
branch of `git-sdk-*` and of `build-extra`. For the `ucrt64` axis that
will need to change: the SDK clone has to target the `ucrt64` branch
of `git-sdk-64`, while the `build-extra` clone still wants `main`.
Plumb a `branch` parameter (default `main`) through `clone()` so the
two call sites can diverge in the next commit without further
refactoring noise.

No behaviour change: every existing caller still ends up cloning
`main`.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
For `architecture: ucrt64` the source of truth is the long-lived
`ucrt64` branch of `git-sdk-64` introduced by
git-for-windows/git-sdk-64#117, not `main`.
Pick the branch up front and pass it to both the GitHub API lookup that
resolves the tip SHA and the subsequent `clone` call, so that
`getViaGit` materialises the UCRT64 variant of the SDK rather than the
MINGW64 one. The `build-extra` clone remains on `main`; that
repository is shared between the two variants.

Side-step the `flavor === 'minimal'` workflow-runs lookup for the
`ucrt64` axis. That lookup hunts for the most recent successful CI
build on the branch and there are none on `ucrt64` yet (the CI
artifacts pipeline has no UCRT64 counterpart). The GCC v14.1 workaround
that piggy-backs on the same code path is also a MINGW64-only concern,
so falling through to the plain `getBranch` lookup is the right thing
for UCRT64 from the start.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The architecture-to-MSYSTEM table in `main.ts` enumerates the
MINGW32/MINGW64/CLANGARM64 environments that the SDK ships today;
anything else falls through to the `Invalid architecture` failure path.
Add the `ucrt64 -> UCRT64` entry from the same lookup so that, once the
caller has materialised the UCRT64 variant of the SDK, the rest of the
Action will export `MSYSTEM=UCRT64` and prepend `/ucrt64/bin` to PATH,
just like it does for the other three axes.

This is a no-op without the next commit, which is the piece that
actually causes `architecture: ucrt64` to reach this code path.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The `minimal` and (since Windows 11 24H2/Server 2025) `build-installers`
flavours normally short-circuit through `getViaCIArtifacts`, which pulls
a pre-built tarball from the `ci-artifacts` release of the matching
`git-sdk-*` repository. The `ucrt64` axis has no such pre-built
artifact today; the CI-artifacts pipeline on `git-sdk-64` only produces
the MINGW64 variants. Pulling those for the UCRT64 axis would silently
materialise the wrong toolchain on disk.

Gate the fast path on `architecture !== 'ucrt64'` so that every
flavour falls through to `getViaGit`, which the previous commits
already taught to clone the `ucrt64` branch of `git-sdk-64` and to
stamp the cache key as `git-sdk-ucrt64-<flavor>`. Only `flavor: full`
is fully wired up end-to-end at this point (it goes straight through
`git worktree add`); the non-`full` flavours additionally rely on
`please.sh create-sdk-artifact` in `build-extra` learning to handle
`--architecture=ucrt64`, which is a follow-up tracked in
git-for-windows/git-sdk-64#117 (comment).

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho changed the title Add architecture axis Add ucrt64 architecture axis Jun 7, 2026
dscho added 7 commits June 8, 2026 09:49
The previous commits taught the implementation to handle
`architecture: ucrt64`, but `action.yml` is what users (and the GitHub
Actions tooling that renders the marketplace page and inlines the
description into IDE tooltips) actually read. Extend the `architecture`
input description to mention the new axis, and call out the caveat
that only `flavor: full` is wired up end-to-end at this point, since
`build-extra`'s `please.sh create-sdk-artifact` does not yet know about
`--architecture=ucrt64` and there is no UCRT64 asset in the
`ci-artifacts` release of `git-sdk-64`.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Add a `getViaGit full ucrt64` companion to the existing
`getViaGit full x86_64` test. The new test pins down the two
behaviours that distinguish the UCRT64 variant from the MINGW64 one,
both of which would silently regress to "secretly materialise the
wrong toolchain" if broken: that the artifact name is
`git-sdk-ucrt64-full` rather than `git-sdk-64-full` (so caches and
on-disk output directories never collide with `x86_64`), and that the
clone targets the `ucrt64` branch of `git-sdk-64` rather than `main`.

The clone assertion goes via `spawnAndWaitForExitCode` rather than
spying on `clone` itself, because internal callers of `clone()` within
`git.ts` resolve the binding at module load time and the `vi.spyOn`
override of the module export does not intercept them. The existing
`full x86_64` test only mocks `clone` to silence side-effects, never
to assert on its arguments, so the discrepancy in style is local to
this one new test.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The README is the entry point most consumers of this Action see before
they wire it into their workflow, so spelling out what `ucrt64`
actually does (and what it does not do yet) is important even though
the implementation pieces have already landed in the preceding
commits. Add a paragraph after the existing `i686` note that explains
the shared-repository / distinct-branch design, the resulting
distinct cache key, the `MSYSTEM=UCRT64` and `/ucrt64/bin` runtime
behaviour, and the fact that only `flavor: full` is end-to-end
functional today.

Keep the existing one-paragraph-per-line wrapping style of the README;
no other text is touched.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Now that the preceding commits have actually taught the Action about
the `ucrt64` axis, document it in AGENTS.md so the institutional
description there matches the code. Add a row to the architecture
table covering repository, MSYSTEM, mingw bin path, and current
limitations, plus a follow-up paragraph that points at
git-for-windows/git-sdk-64#117 and
git-for-windows/git-sdk-64#117 (comment)
for the larger migration context.

Mention in the relationship section that `git-sdk-64` now carries the
extra long-lived `ucrt64` branch and that no UCRT64 asset exists in
the `ci-artifacts` release, which is why the fast path is forcibly
suppressed for that axis.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The manually-triggered `test all artifact flavors` workflow is the
closest thing this repository has to an end-to-end smoke test that
actually downloads an SDK and runs in-place. Without an entry for the
new `ucrt64` axis it would silently keep verifying only the MINGW64
and MINGW32 paths, leaving regressions on the UCRT64 path to surface
only in consumer repositories.

Add a single `flavor: full, architecture: ucrt64` row via `include`,
because that is the only combination wired up end-to-end at this
point: the subset flavors still depend on `please.sh create-sdk-artifact`
in `build-extra` learning `--architecture=ucrt64` and on a UCRT64
asset appearing in the `ci-artifacts` release of `git-sdk-64`, both
tracked in
git-for-windows/git-sdk-64#117 (comment).
The build-installer step keys off `matrix.flavor == 'build-installers'`
and is therefore skipped for the new row, which is exactly what we
want.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The `test` job of `build-test` is the only PR-time gate that actually
runs this Action on a clean Windows runner and pokes at the result;
the matrix-based smoke test in `matrix.yml` only fires on manual
dispatch. So far that gate has only covered the historical default
combination (`flavor: minimal`, `architecture: x86_64`), which means
any regression on the new `ucrt64` axis would slip through CI and
only surface in a consumer repository.

Turn the job into a matrix that adds `architecture: ucrt64` next to
the existing `x86_64` row, with `flavor: full` for the UCRT64 entry
because that is the only flavor wired up end-to-end at this point
(the subset flavors still depend on follow-up work in `build-extra`
and on the `ci-artifacts` pipeline of `git-sdk-64`, tracked in
git-for-windows/git-sdk-64#117 (comment)).

The verification step's previously hard-coded `/mingw64/bin/gcc`
becomes `$MINGW_PREFIX/bin/gcc`, with `MINGW_PREFIX` injected from
the matrix so it picks up `/mingw64` for the `x86_64` row and
`/ucrt64` for the `ucrt64` row. The name follows the MSYS2 ecosystem
convention for the per-environment path, which is the same variable
the SDK's own shell profile exports.

Assisted-by: Opus 4.7
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho dscho requested review from mjcheetham and rimrul June 8, 2026 07:56
@dscho dscho self-assigned this Jun 8, 2026
@dscho dscho marked this pull request as ready for review June 8, 2026 07:56

@rimrul rimrul left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I've skipped over AGENTS.md, because I have no clue about that, but the rest looks good to me.

@dscho dscho merged commit 853682a into main Jun 12, 2026
3 checks passed
@dscho dscho deleted the ucrt64 branch June 12, 2026 12:15
dscho added a commit that referenced this pull request Jun 16, 2026
…ers` flavors (#1362)

Follow-up to
#1361,
which added the `ucrt64` axis but only for `flavor: full`. This PR
extends that to the `minimal`, `makepkg-git`, and `build-installers`
flavors so the `ucrt64` axis is on equal footing with the others.

The Action itself doesn't need new source code for this; it just needed
`please.sh create-sdk-artifact --architecture=ucrt64` to be a working
invocation, which is what
git-for-windows/build-extra#710 adds. So the
diff here is documentation hygiene (removing the "only `full` for now"
caveats) and matrix extensions (so the new combinations are exercised
both on every PR and in the manual all-flavors run). The CI-artifacts
fast path stays suppressed for `ucrt64` until upstream grows a UCRT64
asset; that is a separate concern.
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