Skip to content

Commit d74d224

Browse files
authored
Support building and deploying UCRT64 packages (#178)
This is part of the overall effort in git-for-windows/git-sdk-64#117, and it was used to deploy the UCRT64 variants of the Git for Windows-only MINGW packages to the Pacman repository.
2 parents a946602 + 73a7953 commit d74d224

2 files changed

Lines changed: 26 additions & 12 deletions

File tree

.github/workflows/build-and-deploy.yml

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ on:
1717
description: 'The ref containing the package definition'
1818
required: true
1919
architecture:
20-
description: 'The architecture to build for (only for MSYS packages and all arm64 builds)'
20+
description: 'The architecture to build for (only for MSYS packages, ucrt64 builds, and all arm64 builds)'
2121
required: false
2222
actor:
2323
description: The GitHub user on whose behalf this workflow is run
@@ -232,6 +232,10 @@ jobs:
232232
GIT_EXE="/mingw32/bin/git.exe"
233233
BUILD_SRC=
234234
;;
235+
ucrt64)
236+
GIT_EXE="/ucrt64/bin/git.exe"
237+
BUILD_SRC=
238+
;;
235239
*)
236240
GIT_EXE="/mingw64/bin/git.exe"
237241
BUILD_SRC="YesPlease"
@@ -251,10 +255,11 @@ jobs:
251255
aarch64,*) echo "clangarm64";;
252256
x86_64,*) echo "mingw64";;
253257
i686,*) echo "mingw32";;
254-
,mingw-w64-wintoast) echo "mingw32 mingw64 clangarm64";; # We're (cross-)compiling via Visual Studio
255-
,mingw-w64-git-credential-manager) echo "mingw32 mingw64 clangarm64";; # We're downloading the pre-built artifacts for all three platforms
256-
,mingw-w64-git-lfs) echo "mingw32 mingw64 clangarm64";; # We're downloading the pre-built artifacts from Git LFS' official release page
257-
,*) echo "mingw32 mingw64";;
258+
ucrt64,*) echo "ucrt64";;
259+
,mingw-w64-wintoast) echo "mingw32 mingw64 ucrt64 clangarm64";; # We're (cross-)compiling via Visual Studio
260+
,mingw-w64-git-credential-manager) echo "mingw32 mingw64 ucrt64 clangarm64";; # We're downloading the pre-built artifacts for all three platforms
261+
,mingw-w64-git-lfs) echo "mingw32 mingw64 ucrt64 clangarm64";; # We're downloading the pre-built artifacts from Git LFS' official release page
262+
,*) echo "mingw32 mingw64 ucrt64";;
258263
esac
259264
)
260265

update-scripts/ensure-not-yet-deployed.sh

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,11 @@ architecture=
1010
while case "$1" in
1111
--architecture=*)
1212
architecture=${1#*=}
13-
if test aarch64 = "$architecture"
14-
then
15-
MINGW_PACKAGE_PREFIX=mingw-w64-clang-aarch64
16-
else
17-
MINGW_PACKAGE_PREFIX=mingw-w64-$architecture
18-
fi
13+
case "$architecture" in
14+
aarch64) MINGW_PACKAGE_PREFIX=mingw-w64-clang-aarch64;;
15+
ucrt64) MINGW_PACKAGE_PREFIX=mingw-w64-ucrt-x86_64;;
16+
*) MINGW_PACKAGE_PREFIX=mingw-w64-$architecture;;
17+
esac
1918
;;
2019
-*) die "Unhandled option: '$1'";;
2120
*) break;
@@ -27,6 +26,16 @@ die "Usage: $0 <directory-containing-PKGBUILD>"
2726
cd "$1" ||
2827
die "Could not switch to '$1'"
2928

29+
# Some PKGBUILDs use $CARCH at top level (outside functions). Set it before
30+
# sourcing so that architecture-dependent logic (case statements, variable
31+
# assignments) works correctly even though we are not running under makepkg.
32+
case "$architecture" in
33+
aarch64) CARCH=aarch64;;
34+
i686) CARCH=i686;;
35+
*) CARCH=x86_64;;
36+
esac &&
37+
export CARCH &&
38+
3039
. ./PKGBUILD ||
3140
die "No/invalid PKGBUILD in '$1'?"
3241

@@ -58,7 +67,7 @@ esac &&
5867

5968
subdir="${architecture:-$arch}" &&
6069
case "$subdir" in
61-
any) subdir=x86_64;;
70+
any|ucrt64) subdir=x86_64;;
6271
esac &&
6372

6473
case "$pkgname" in

0 commit comments

Comments
 (0)