Repository navigation
Include Rust in the minimal-sdk/makepkg-git/build-installers SDK artifacts - #67
Conversation
bc22926 to
4747c0d
Compare
|
So, a couple of notes:
|
|
The only reason why this isn't pointed out by the failing Howver, the failures do point straight at the
So apparently not only a new |
## 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 `clangarm64/bin/libLLVM-22.dll` with `filter=upx`. - Remove sync's oversized-DLL stripping workaround, including its temporary installation and removal of x64 LLVM. UPX now supports Windows ARM64 binaries, allowing explicitly selected LLVM DLLs to use compressed storage without stripping package files. 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 #67 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. Actionlint, shell syntax, and whitespace checks passed. Native ARM64 filter execution has not been tested locally.
As part of #67, I unshadowed `mingw-w64-llm`. Or at least, I [tried](https://github.com/git-for-windows/git-for-windows-automation/actions/runs/45251567691), [tried again](https://github.com/git-for-windows/git-for-windows-automation/actions/runs/45258314743), and [eventually succeeded](https://github.com/git-for-windows/git-for-windows-automation/actions/runs/45259053139) (third time's a charm, right?). [EDIT] Narrator's voice: it [wasn't](https://github.com/git-for-windows/git-for-windows-automation/actions/runs/45359350453). Unfortunately, the [`sync` after that failed](https://github.com/git-for-windows/git-sdk-arm64/actions/runs/45254159505). The reason is that UPX is apparently found somewhere on the `PATH`, but not the intended one, and it's apparently missing DLLs on the `PATH`, resulting in an exit code 127. Let's work around that by forcing "our" UPX to be in the `PATH` _first_. While at it, clean up some `update-via-pacman` things, too.
68bba00 to
16ac2cb
Compare
…#777) The `git-sdk-64` and `git-sdk-arm64` repositories store their largest DLLs packed with UPX, merely to stay below GitHub's 100MB file size limit. The SDK artifacts should not inherit that workaround: UPX-packed DLLs need to be decompressed every single time they are loaded, and they even compress worse: with zstd level 10, `libLLVM-23.dll` takes up 41,589,197 bytes when packed, but only 38,354,366 bytes when unpacked. So let's install the large-DLL filter in the worktree from which the artifacts are generated. The filter script and `upx.exe` are written into the worktree's gitdir, so that they don't end up in the artifacts. While at it, let's also hard-link identical files: Git stores each blob only once, but a checkout writes every copy, whereas `tar` stores hard-linked files only once. That shaves another ~2.3% off the minimal SDK (with Rust). This was prototyped in git-for-windows/git-sdk-arm64#67.
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> Cherry-picked-from: 22f11cc (ci: Add a GitHub workflow to install Pacman packages into the SDK, 2026-09-25)
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-aarch64-build-installers` artifact is the minimal SDK plus the `makepkg-git` sparse checkout, it gets them, too. The ARM64 Rust package uses the `aarch64-pc-windows-gnullvm` target provided by the Clang/LLVM subsystem. Cargo's default linker for that target is `aarch64-w64-mingw32-clang`. Without it, the build fails with "error: linker `aarch64-w64-mingw32-clang` not found". Linking also needs `libsynchronization.a`. Shipping the prefixed name means nobody has to override Cargo's linker in every environment. The file is byte-identical to `clang.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: the zstd-compressed (level 10) minimal-sdk CI artifact grew from 121.41 MiB to 191.65 MiB, i.e. by 70.24 MiB (+57.85%). That was measured before build-extra#777's hard-linking and DLL unpacking, which shave off some of that. 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>
3615d61 to
b2c37ed
Compare
mingw-w64-clang-aarch64-http-parser (new: 2.9.4-3) mingw-w64-clang-aarch64-libgit2 (new: 1.9.7-3) mingw-w64-clang-aarch64-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/git-for-windows/git-sdk-arm64/actions/runs/45697015836 Signed-off-by: Git for Windows Build Agent <ci@git-for-windows.build>
makepkg-git/build-installers SDK artifactsminimal-sdk/makepkg-git/build-installers SDK artifacts
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>
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>
I ran into this while measuring how much including Rust in the minimal SDK (git-for-windows/git-sdk-arm64#67) would grow the artifacts. `please.sh create-sdk-artifact --head=<rev>` checked out the files of `<rev>`, but it read the `.sparse/*` definitions from the SDK repository's `HEAD`. Which means the file selection came from `HEAD`, not from the revision I was trying to measure. With this fix, both `build-installers` and `minimal-sdk` grow by roughly 74MB (zstd level 10, as in CI). CI does not pass `--head`, so its behavior is unchanged.
The Git for Windows SDK repositories contain many byte-identical files (`clang.exe` and its aliases, for example). Git stores each such blob only once, but a checkout writes a separate copy for every path, which inflates the artifacts produced by `please.sh create-sdk-artifact`. Turning those copies into hard links recovers some of that space. In a minimal-sdk artifact including Rust, 129 groups of identical files accounted for 21,126,354 duplicate bytes uncompressed. Archived with Windows' `tar.exe` (bsdtar) at zstd level 10, the archive shrank from 200,956,866 to 196,312,913 bytes, about 2.3%. Both bsdtar and MSYS tar store the extra names as hard-link entries and recreate them as hard links on extraction. Only files that are unmodified relative to the index and have the regular mode 100644 are linked. Files this function deliberately rewrites, such as the minimal `etc/profile`, therefore never end up linked to pristine copies. This logic was first proven as an interim step in git-sdk-arm64's ci-artifacts workflow, in git-for-windows/git-sdk-arm64#67. Doing it here benefits every caller. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
The `--head=<rev>` option is supposed to create the artifact from a commit other than the SDK repository's HEAD. It already does that for the files themselves, but the sparse-checkout definitions were still read from HEAD. The result mixed the two: the files came from <rev>, yet the set of files was decided by HEAD's definitions. This came up while measuring how much adding Rust to the minimal SDK (git-for-windows/git-sdk-arm64#67) grows the `build-installers` artifact. With `--head` pointing at that PR's commit and HEAD still on `main`, the generated sparse definition was missing the Rust entries. CI calls `create-sdk-artifact` without `--head`, so there HEAD and <rev> are the same commit and nothing changes. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
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.
This comes at a bit of a hefty price; the
build-installers.tar.zstincreases size from ~243MB to ~317MB (although that is less of a delta than for the sibling PR git-for-windows#132), whileminimal-sdk.tar.zstincreases 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.