Skip to content

Include Rust in the minimal-sdk/makepkg-git/build-installers SDK artifacts - #132

Merged
dscho merged 7 commits into
git-for-windows:mainfrom
dscho:include-rust-in-makepkg-git
Nov 25, 2026
Merged

dscho merged 7 commits into
git-for-windows:mainfrom
dscho:include-rust-in-makepkg-git

Conversation

@dscho

@dscho dscho commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

This comes at a bit of a hefty price; the build-installers.tar.zst increases size from ~183MB to ~297MB, while minimal-sdk.tar.zst increases from ~61MB to ~176MB.

The upside is that we're staying consistent with the MSYS2 project instead of mixing a MSYS2-provided MINGW GCC with a Rust-provided Cargo targeting MINGW GCC.

@dscho dscho self-assigned this Sep 25, 2026

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

This comes at a bit of a hefty price; the build-installers.tar.zst increases size from 188,577,828 to 301,498,112 bytes.

This is a shame, but not much we can do right? ¯\_(ツ)_/¯

dscho added a commit that referenced this pull request Nov 4, 2026
## Summary

Prepare package-update automation to store Rust's LLVM DLL through the
UPX clean filter, preserving original package bytes in the working tree.

- Configure repository-local filters before staging in
`.github/commit-sdk.sh`, using `--no-refresh`.
- Stop before staging if filter setup fails.
- Select only `ucrt64/bin/libLLVM-22.dll` with `filter=upx`.

Ordinary clones retain runnable packed binaries. Users can optionally
enable smudge filtering to trade disk space for faster loading.

## Follow-ups

This does not install Rust or LLVM. Updating the package-install
workflow on Rust PR #132 is a follow-up. No installation workflow has
been dispatched.

## Validation

Disposable repository tests verified setup runs before staging,
successful commits leave working-tree bytes unchanged, and setup failure
prevents staging and committing.

Attribute checks confirmed only the intended LLVM DLL is selected. Shell
syntax and whitespace checks passed.
@dscho
dscho force-pushed the include-rust-in-makepkg-git branch 3 times, most recently from 9feea02 to 21dcab8 Compare November 24, 2026 10:11
Thanks to yours truly, there was a `grep` update that was long overdue,
but it resulted in a change: `grep` now depends on PCRE2 instead of
PCRE1, and we need to ship the new dependency in the minimal SDK as
well.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
When `commit-sdk.sh` commits DLLs that exceed GitHub's maximum blob
size (`libLLVM-*.dll`), it uses a clean/smudge filter that runs `upx`
to pack them. `upx` is installed in `/ucrt64/bin`, but nothing else
in that step puts that directory on the `PATH`.

The same problem already broke the sync in git-sdk-arm64 (fixed there
in c014e0a):
https://github.com/git-for-windows/git-sdk-arm64/actions/runs/45254159505

Here, the sync has only been spared so far because the SDK does not
yet contain any libLLVM DLL. That will change as soon as Rust (which
needs libLLVM) is installed, which is what this work is preparing for.

Assisted-by: GitHub Copilot (Auto)
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Rust needs to enter the SDK so that we can have "time-traveling"
branches for security bug fix releases and MinGit backports.

The safest way to install Rust is by running the `pacman -S` command in
a clean, pristine SDK checkout in a GitHub workflow, so that it's not
only virtually guaranteed that it's not tampered with, there is also a
public record.

Assisted-by: GPT-6 Sol
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
@dscho
dscho force-pushed the include-rust-in-makepkg-git branch from 21dcab8 to 1a8dfdf Compare November 25, 2026 22:09
dscho and others added 4 commits November 25, 2026 23:45
Upstream Git plans to make its Rust parts mandatory with v3.0, and Git
for Windows will enable them already after v2.56. Let's include what is
needed to build them in the minimal SDK, which is what Git's CI uses.
Since the `git-sdk-x86_64-build-installers` artifact is the minimal SDK
plus the `makepkg-git` sparse checkout, it gets them, too.

The UCRT64 Rust package targets `x86_64-pc-windows-gnu`, and Cargo's
default linker for that target is `x86_64-w64-mingw32-gcc`. Without it,
the build fails with "error: linker `x86_64-w64-mingw32-gcc` not found".
`libsynchronization.a` is included as well because the ARM64 counterpart
(git-for-windows#67) needed it to
link, and the Rust standard library is the same on both architectures.

Shipping the prefixed name means nobody has to set
`CARGO_TARGET_X86_64_PC_WINDOWS_GNU_LINKER=gcc` in every environment.
The file is byte-identical to `gcc.exe`, and `please.sh
create-sdk-artifact` hard-links identical files (see
git-for-windows/build-extra#777), so the extra
name costs practically nothing in the archive.

This does make the artifact substantially larger. For reference, the
ARM64 counterpart grew the zstd-compressed (level 10) build-installers
artifact from ~243MB to ~317MB, and the minimal SDK from ~121MB to
~194MB.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The minimal SDK now has what it takes to build Git's Rust parts, so
there's no reason to keep passing `NO_RUST=UnfortunatelyYes` to the test
build. Let's drop it. That way, this job checks that the minimal SDK
really can build Git with Rust, and the downstream test jobs exercise
that build.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
mingw-w64-ucrt-x86_64-http-parser (new: 2.9.4-3)
mingw-w64-ucrt-x86_64-libgit2 (new: 1.9.7-3)
mingw-w64-ucrt-x86_64-libxml2 (new: 2.15.4-3)
mingw-w64-ucrt-x86_64-llvm-libs (new: 23.1.5-1)
mingw-w64-ucrt-x86_64-rust (new: 1.100.0-2)

Signed-off-by: Git for Windows Build Agent <ci@git-for-windows.build>
Rust is now installed via pacman, and the SDK package changes
have been committed. Retire the workflow so later pushes to the PR
branch do not repeat the installation.

Generated by https://github.com/dscho/git-sdk-64/actions/runs/45710852716

Signed-off-by: Git for Windows Build Agent <ci@git-for-windows.build>
@dscho
dscho force-pushed the include-rust-in-makepkg-git branch from 8f5ab85 to c85675c Compare November 25, 2026 22:52
@dscho

dscho commented Nov 25, 2026

Copy link
Copy Markdown
Member Author

Despite the hefty price, I actually decided to go the whole nine yards and include Rust also in the minimal SDK. Yes, this will make each Windows-based CI job a bit more expensive. At the same time, it will make CI more consistent, too: GitLab and GitHub CI can then use the precise same compilers even when Git v3.0 will require Rust to be built.

@dscho dscho changed the title Include Rust in the makepkg-git/build-installers SDK artifacts Include Rust in the minimal-sdk/makepkg-git/build-installers SDK artifacts Nov 25, 2026
@dscho
dscho merged commit 1373e0a into git-for-windows:main Nov 25, 2026
23 checks passed
dscho added a commit to git-for-windows/git-sdk-arm64 that referenced this pull request Nov 25, 2026
…K artifacts (#67)

This comes at a bit of a hefty price; the `build-installers.tar.zst`
increases size from ~243MB to ~317MB (although that is less of a delta
than for the sibling PR
git-for-windows#132), while
`minimal-sdk.tar.zst` increases from ~121MB to ~194MB.

The upside is that we're staying consistent with the MSYS2 project
instead of mixing a MSYS2-provided Clang with a Rust-provided Cargo
targeting Clang.
@dscho
dscho deleted the include-rust-in-makepkg-git branch November 25, 2026 23:38
dscho added a commit to git-for-windows/git-for-windows-automation that referenced this pull request Nov 26, 2026
This covers the remaining checkbox of git-for-windows/git#6276 ("Build
with the Rust bits by default") for the release builds. All the
prerequisites are now merged: git-for-windows/MINGW-packages#235 on
2026-11-12, and git-for-windows/git-sdk-64#132 and
git-for-windows/git-sdk-arm64#67 earlier today, which add the Rust
toolchain to the SDK artifacts these workflows use.

The `git-artifacts` workflows in git-sdk-64 and git-sdk-arm64 have
opt-outs of their own; those are reverted in separate PRs in those
repositories. git-sdk-32 keeps its opt-out, as there is no usable i686
Rust.
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