git/ci
Johannes Schindelin 86909a94db ci(windows): build with Rust
The Windows runners used by Git's GitHub workflow's `windows-build` job
ship `rustup` plus a `*-pc-windows-msvc` default toolchain (see
https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md
and
https://github.com/actions/partner-runner-images/blob/main/images/arm-windows-11-image.md),
but no precompiled `std` for `*-pc-windows-gnu` or
`*-pc-windows-gnullvm`. With the Makefile now picking a GCC-compatible
target triple based on `$(MSYSTEM)`, the build step needs that
precompiled `std` to be installed before invoking `make`, otherwise
`cargo build --target <triple>` fails to find a usable `std` for the
chosen target.

Add a step between the SDK setup and the `make` invocation that selects
the matching triple from `$MSYSTEM` (which
`git-for-windows/setup-git-for-windows-sdk` exports for every subsequent
step) and runs `rustup target add` for it. The mapping mirrors what
`config.mak.uname` derives from `$(MSYSTEM)` and `$(HOST_CPU)`, just
enumerated explicitly here since CI has direct knowledge of which MSYS2
subsystems the matrix actually exercises (`CLANGARM64` for the ARM64
runner, `MINGW64` for the x86_64 runner). Technically, we only need to
handle MINGW64 at present, but the switch to UCRT64 is imminent, and the
other case arms serve as a very fine documentation of what people should
do for other MSYSTEM values.

For a `staticlib` crate-type `cargo build` does not invoke an external
linker, so no further toolchain components (e.g. the `gnullvm` LLVM
linker) need to be installed; `rustup target add` alone is sufficient.

Assisted-by: Claude Opus 4.7
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2026-09-13 15:48:09 -07:00
..
config
util
check-directional-formatting.bash
check-unsafe-assertions.sh ci: add build checking for side-effects in assert() calls 2025-03-21 03:32:04 -07:00
check-whitespace.sh
install-dependencies.ps1 gitlab-ci: migrate Windows builds away from Chocolatey 2026-06-17 13:05:27 -07:00
install-dependencies.sh ci: install cargo on Alpine 2026-04-09 17:25:36 -07:00
install-sdk.ps1
lib.sh ci(windows): build with Rust 2026-09-13 15:48:09 -07:00
make-test-artifacts.sh
mount-fileshare.sh
print-test-failures.sh ci: allow github-actions print test failures again 2025-07-16 14:09:51 -07:00
run-build-and-minimal-fuzzers.sh oss-fuzz: add fuzzer for parsing reftables 2026-07-03 11:08:02 -07:00
run-build-and-tests.sh Merge branch 'ps/test-set-e-clean' 2026-05-11 10:05:54 +09:00
run-rust-checks.sh ci: verify minimum supported Rust version 2025-10-15 08:10:17 -07:00
run-static-analysis.sh contrib: move "coccinelle/" directory into "tools/" 2026-03-19 06:40:08 -07:00
run-style-check.sh clang-format: add 'RemoveBracesLLVM' to the main config 2025-07-02 09:05:29 -07:00
run-test-slice-meson.sh ci: make test slicing consistent across Meson/Make 2026-02-19 10:22:31 -08:00
run-test-slice.sh ci: handle failures of test-slice helper 2026-02-19 10:22:30 -08:00
test-documentation.sh ci: don't compile whole project when testing docs with Meson 2025-09-11 09:57:25 -07:00