Skip to content

Commit db3ebfe

Browse files
authored
Merge pull request #515 from dennisameling/git-arm64-support
Add arm64 support for Git for Windows and update to 2.47.1
2 parents ef57d76 + dfbfaac commit db3ebfe

File tree

6 files changed

+55
-37
lines changed

6 files changed

+55
-37
lines changed

.github/workflows/ci.yml

+2-18
Original file line numberDiff line numberDiff line change
@@ -26,25 +26,17 @@ jobs:
2626
fail-fast: false
2727
matrix:
2828
os: [macos-13, windows-2019, ubuntu-20.04]
29-
arch: [x86, x64]
29+
arch: [x86, x64, arm64]
3030
include:
3131
- os: macos-13
3232
friendlyName: macOS
3333
targetPlatform: macOS
34-
- os: macos-13
35-
friendlyName: macOS
36-
targetPlatform: macOS
37-
arch: arm64
3834
- os: windows-2019
3935
friendlyName: Windows
4036
targetPlatform: win32
4137
- os: ubuntu-20.04
4238
friendlyName: Linux
4339
targetPlatform: ubuntu
44-
- os: ubuntu-20.04
45-
friendlyName: Linux
46-
targetPlatform: ubuntu
47-
arch: arm64
4840
- os: ubuntu-20.04
4941
friendlyName: Linux
5042
targetPlatform: ubuntu
@@ -118,15 +110,7 @@ jobs:
118110
sudo dpkg --add-architecture armhf
119111
sudo apt-get update
120112
sudo apt-get install -y gcc-arm-linux-gnueabihf binutils-arm-linux-gnueabihf libcurl4-gnutls-dev:armhf zlib1g-dev:armhf libssl-dev:armhf gettext
121-
- name: Build (except macOS arm64)
122-
if: matrix.targetPlatform != 'macOS' || matrix.arch != 'arm64'
123-
shell: bash
124-
run: script/build.sh
125-
env:
126-
TARGET_PLATFORM: ${{ matrix.targetPlatform }}
127-
TARGET_ARCH: ${{ matrix.arch }}
128-
- name: Build (macOS arm64)
129-
if: matrix.targetPlatform == 'macOS' && matrix.arch == 'arm64'
113+
- name: Build
130114
shell: bash
131115
run: script/build.sh
132116
env:

dependencies.json

+20-7
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,27 @@
11
{
22
"git": {
3-
"version": "v2.45.3",
3+
"version": "v2.47.1",
44
"packages": [
55
{
66
"platform": "windows",
77
"arch": "amd64",
8-
"filename": "MinGit-2.45.2.2-64-bit.zip",
9-
"url": "https://github.com/git-for-windows/git/releases/download/v2.45.2.windows.2/MinGit-2.45.2.2-64-bit.zip",
10-
"checksum": "93ce6daa762cd82b7558162b7caee6fc60dc6e630b0b4b1a15307e7480a0c64d"
8+
"filename": "MinGit-2.47.1.2-64-bit.zip",
9+
"url": "https://github.com/git-for-windows/git/releases/download/v2.47.1.windows.2/MinGit-2.47.1.2-64-bit.zip",
10+
"checksum": "5bafb35dfb249b89d726b37824eeb5022379f0e51f5fbf9c29f49bef57e85b42"
1111
},
1212
{
1313
"platform": "windows",
1414
"arch": "x86",
15-
"filename": "MinGit-2.45.2.2-32-bit.zip",
16-
"url": "https://github.com/git-for-windows/git/releases/download/v2.45.2.windows.2/MinGit-2.45.2.2-32-bit.zip",
17-
"checksum": "f1b3272a303435c89e60645e2f1460b9c6679032f6ff15b21713b7d44044dd3e"
15+
"filename": "MinGit-2.47.1.2-32-bit.zip",
16+
"url": "https://github.com/git-for-windows/git/releases/download/v2.47.1.windows.2/MinGit-2.47.1.2-32-bit.zip",
17+
"checksum": "adae5363e224be913af65b3b8c454463e220dd12c811bf5f298952ba4106589a"
18+
},
19+
{
20+
"platform": "windows",
21+
"arch": "arm64",
22+
"filename": "MinGit-2.47.1.2-arm64.zip",
23+
"url": "https://github.com/git-for-windows/git/releases/download/v2.47.1.windows.2/MinGit-2.47.1.2-arm64.zip",
24+
"checksum": "c74dd8e25b2337bbef059440966ba7bf96da4b4a8bc9bf9c759a2bc5a868da2b"
1825
}
1926
]
2027
},
@@ -57,6 +64,12 @@
5764
"name": "git-lfs-windows-amd64-v3.6.1.zip",
5865
"checksum": "aaca788e04f91676e58654d5ecf96cf03c76768a63b3a6918281a9678884c20c"
5966
},
67+
{
68+
"platform": "windows",
69+
"arch": "arm64",
70+
"name": "git-lfs-windows-arm64-v3.6.1.zip",
71+
"checksum": "ad40ab00a73ef4bf63c969472d0e5a824686b495dbc01ea8e9e4cc456c49a4b0"
72+
},
6073
{
6174
"platform": "darwin",
6275
"arch": "amd64",

git

Submodule git updated 1346 files

script/build-win32.sh

+18-7
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,24 @@ if [[ -z "${DESTINATION}" ]]; then
1010
exit 1
1111
fi
1212

13-
if [ "$TARGET_ARCH" = "x64" ]; then
14-
DEPENDENCY_ARCH="amd64"
15-
MINGW_DIR="mingw64"
16-
else
17-
DEPENDENCY_ARCH="x86"
18-
MINGW_DIR="mingw32"
19-
fi
13+
case $TARGET_ARCH in
14+
x64)
15+
DEPENDENCY_ARCH="amd64"
16+
MINGW_DIR="mingw64"
17+
;;
18+
x86)
19+
DEPENDENCY_ARCH="x86"
20+
MINGW_DIR="mingw32"
21+
;;
22+
arm64)
23+
DEPENDENCY_ARCH="arm64"
24+
MINGW_DIR="clangarm64"
25+
;;
26+
*)
27+
echo "Unsupported architecture: $TARGET_ARCH"
28+
exit 1
29+
;;
30+
esac
2031

2132
GIT_LFS_VERSION=$(jq --raw-output ".[\"git-lfs\"].version[1:]" dependencies.json)
2233
GIT_LFS_CHECKSUM="$(jq --raw-output ".\"git-lfs\".files[] | select(.arch == \"$DEPENDENCY_ARCH\" and .platform == \"windows\") | .checksum" dependencies.json)"

script/update-git-lfs.ts

+1
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ async function run(): Promise<boolean> {
9393
`git-lfs-linux-arm-${version}.tar.gz`,
9494
`git-lfs-windows-386-${version}.zip`,
9595
`git-lfs-windows-amd64-${version}.zip`,
96+
`git-lfs-windows-arm64-${version}.zip`,
9697
`git-lfs-darwin-amd64-${version}.zip`,
9798
`git-lfs-darwin-arm64-${version}.zip`,
9899
]

script/update-git.ts

+13-4
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,13 @@ async function getLatestStableRelease() {
7474
async function getPackageDetails(
7575
assets: ReleaseAssets,
7676
body: string,
77-
arch: string
77+
arch: 'amd64' | 'x86' | 'arm64'
7878
) {
79-
const archValue = arch === 'amd64' ? '64-bit' : '32-bit'
79+
const archValue = {
80+
amd64: '64-bit',
81+
x86: '32-bit',
82+
arm64: 'arm64',
83+
}[arch]
8084

8185
const minGitFile = assets.find(
8286
a => a.name.indexOf('MinGit') !== -1 && a.name.indexOf(archValue) !== -1
@@ -181,12 +185,17 @@ async function run() {
181185

182186
const package64bit = await getPackageDetails(assets, body, 'amd64')
183187
const package32bit = await getPackageDetails(assets, body, 'x86')
188+
const packagearm64 = await getPackageDetails(assets, body, 'arm64')
184189

185-
if (package64bit == null || package32bit == null) {
190+
if (package64bit == null || package32bit == null || packagearm64 == null) {
186191
return
187192
}
188193

189-
updateGitDependencies(latestGitVersion, [package64bit, package32bit])
194+
updateGitDependencies(latestGitVersion, [
195+
package64bit,
196+
package32bit,
197+
packagearm64,
198+
])
190199

191200
console.log(
192201
`✅ Updated dependencies metadata to Git ${latestGitVersion} (Git for Windows ${version})`

0 commit comments

Comments
 (0)