Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 3.0.0-rc10 #607

Merged
merged 9 commits into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions lib/git-environment.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import * as path from 'path'
import { EnvMap } from './env-map'

function getWin32GitSubfolder(): string {
if (process.arch === 'x64') {
return 'mingw64'
} else if (process.arch === 'arm64') {
return 'clangarm64'
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arm64 builds introduce the clangarm64 subfolder

} else {
return 'mingw32'
}
}

export function resolveEmbeddedGitDir(): string {
if (
process.platform === 'darwin' ||
Expand Down Expand Up @@ -57,8 +67,7 @@ export function resolveGitExecPath(
}
const gitDir = resolveGitDir(localGitDir)
if (process.platform === 'win32') {
const mingw = process.arch === 'x64' ? 'mingw64' : 'mingw32'
return path.join(gitDir, mingw, 'libexec', 'git-core')
return path.join(gitDir, getWin32GitSubfolder(), 'libexec', 'git-core')
} else {
return path.join(gitDir, 'libexec', 'git-core')
}
Expand Down Expand Up @@ -89,10 +98,9 @@ export function setupEnvironment(
const gitDir = resolveGitDir(localGitDir)

if (process.platform === 'win32') {
const mingw = process.arch === 'x64' ? 'mingw64' : 'mingw32'
env.set(
'PATH',
`${gitDir}\\${mingw}\\bin;${gitDir}\\${mingw}\\usr\\bin;${
`${gitDir}\\${getWin32GitSubfolder()}\\bin;${gitDir}\\${getWin32GitSubfolder()}\\usr\\bin;${
env.get('PATH') ?? ''
}`
)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "dugite",
"version": "3.0.0-rc6",
"version": "3.0.0-rc10",
"description": "Elegant bindings for Git",
"main": "./build/lib/index.js",
"typings": "./build/lib/index.d.ts",
Expand Down
6 changes: 0 additions & 6 deletions script/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,6 @@ function getConfig() {
arch = process.env.npm_config_arch
}

if (process.platform === 'win32' && arch === 'arm64') {
// Use the Dugite Native ia32 package for Windows arm64 (arm64 can run 32-bit code through emulation)
console.log('Downloading 32-bit Dugite Native for Windows arm64')
arch = 'ia32'
}

const key = `${process.platform}-${arch}`

const entry = embeddedGit[key]
Expand Down
53 changes: 29 additions & 24 deletions script/embedded-git.json
Original file line number Diff line number Diff line change
@@ -1,42 +1,47 @@
{
"win32-x64": {
"name": "dugite-native-v2.45.3-249d956-windows-x64.tar.gz",
"url": "https://github.com/desktop/dugite-native/releases/download/v2.45.3/dugite-native-v2.45.3-249d956-windows-x64.tar.gz",
"checksum": "c673e4afba7541767ae2421c40d0dda9e0af6d58c02dea28207627d4dff05fb3"
"name": "dugite-native-v2.47.1-8d348e6-windows-x64.tar.gz",
"url": "https://github.com/desktop/dugite-native/releases/download/v2.47.1/dugite-native-v2.47.1-8d348e6-windows-x64.tar.gz",
"checksum": "bca0fb95b136ec4227452ee603eb5b8bf5213f9a8c99b72a617db654046c17c7"
},
"win32-ia32": {
"name": "dugite-native-v2.45.3-249d956-windows-x86.tar.gz",
"url": "https://github.com/desktop/dugite-native/releases/download/v2.45.3/dugite-native-v2.45.3-249d956-windows-x86.tar.gz",
"checksum": "26c129ad566ea27100e4d724badb40ee6becedf21db229c96553f4b835367056"
"name": "dugite-native-v2.47.1-8d348e6-windows-x86.tar.gz",
"url": "https://github.com/desktop/dugite-native/releases/download/v2.47.1/dugite-native-v2.47.1-8d348e6-windows-x86.tar.gz",
"checksum": "f938bc2ef0ae702479b53bb0838b5cfeea14d35c4215757e1a6df95dea52cad4"
},
"win32-arm64": {
"name": "dugite-native-v2.47.1-8d348e6-windows-arm64.tar.gz",
"url": "https://github.com/desktop/dugite-native/releases/download/v2.47.1/dugite-native-v2.47.1-8d348e6-windows-arm64.tar.gz",
"checksum": "4a3f4d77f3fec67b1c3235a6a82c3e259eb8eb4babd868da5a3e5d5ac309c590"
},
"darwin-x64": {
"name": "dugite-native-v2.45.3-249d956-macOS-x64.tar.gz",
"url": "https://github.com/desktop/dugite-native/releases/download/v2.45.3/dugite-native-v2.45.3-249d956-macOS-x64.tar.gz",
"checksum": "f8191f31248200866172ef7be6e8c97d724278c90a4c021c71362bde47a3ee2a"
"name": "dugite-native-v2.47.1-8d348e6-macOS-x64.tar.gz",
"url": "https://github.com/desktop/dugite-native/releases/download/v2.47.1/dugite-native-v2.47.1-8d348e6-macOS-x64.tar.gz",
"checksum": "475040cf643a3962d557aad9b91e861eace6d6bb28c01bb54535544c43e19459"
},
"darwin-arm64": {
"name": "dugite-native-v2.45.3-249d956-macOS-arm64.tar.gz",
"url": "https://github.com/desktop/dugite-native/releases/download/v2.45.3/dugite-native-v2.45.3-249d956-macOS-arm64.tar.gz",
"checksum": "b24aa30a56cc352159e1c842f1d248009e61f1b9e594dd34f09809dc792cf90f"
"name": "dugite-native-v2.47.1-8d348e6-macOS-arm64.tar.gz",
"url": "https://github.com/desktop/dugite-native/releases/download/v2.47.1/dugite-native-v2.47.1-8d348e6-macOS-arm64.tar.gz",
"checksum": "451dc41889a4deef06e2d3495364f74f6416bda8234b876144f5c254874b306d"
},
"linux-x64": {
"name": "dugite-native-v2.45.3-249d956-ubuntu-x64.tar.gz",
"url": "https://github.com/desktop/dugite-native/releases/download/v2.45.3/dugite-native-v2.45.3-249d956-ubuntu-x64.tar.gz",
"checksum": "ca947928afd3c58b49bd686824d3b7d0b0103add6f77ccc3148f16b569db99dc"
"name": "dugite-native-v2.47.1-8d348e6-ubuntu-x64.tar.gz",
"url": "https://github.com/desktop/dugite-native/releases/download/v2.47.1/dugite-native-v2.47.1-8d348e6-ubuntu-x64.tar.gz",
"checksum": "0e6b3a0776e92ddef3a3fdc966d960fbf150b3f5bb74632576c0bdfbcb638042"
},
"linux-ia32": {
"name": "dugite-native-v2.45.3-249d956-ubuntu-x86.tar.gz",
"url": "https://github.com/desktop/dugite-native/releases/download/v2.45.3/dugite-native-v2.45.3-249d956-ubuntu-x86.tar.gz",
"checksum": "3b4989b0656654e7c5e7bde52f8be1cd575590276c7a5d7b1acfd17af4e9e022"
"name": "dugite-native-v2.47.1-8d348e6-ubuntu-x86.tar.gz",
"url": "https://github.com/desktop/dugite-native/releases/download/v2.47.1/dugite-native-v2.47.1-8d348e6-ubuntu-x86.tar.gz",
"checksum": "7263bed583503808a11a5e3b5e259e63fe66e08d8c8c3934bef3bc6ca42f1e2e"
},
"linux-arm": {
"name": "dugite-native-v2.45.3-249d956-ubuntu-arm.tar.gz",
"url": "https://github.com/desktop/dugite-native/releases/download/v2.45.3/dugite-native-v2.45.3-249d956-ubuntu-arm.tar.gz",
"checksum": "725398745dacb94d82b23d01f5348aebe413c924bc0b78178f2fbff517741f61"
"name": "dugite-native-v2.47.1-8d348e6-ubuntu-arm.tar.gz",
"url": "https://github.com/desktop/dugite-native/releases/download/v2.47.1/dugite-native-v2.47.1-8d348e6-ubuntu-arm.tar.gz",
"checksum": "a89292d44106150037932b95ddc233e09c6faf7489b44672c93d801838f496cd"
},
"linux-arm64": {
"name": "dugite-native-v2.45.3-249d956-ubuntu-arm64.tar.gz",
"url": "https://github.com/desktop/dugite-native/releases/download/v2.45.3/dugite-native-v2.45.3-249d956-ubuntu-arm64.tar.gz",
"checksum": "e605f8f5d5146e8ba10be30a781639ef81de4b01e85c87d24641316c928b88ed"
"name": "dugite-native-v2.47.1-8d348e6-ubuntu-arm64.tar.gz",
"url": "https://github.com/desktop/dugite-native/releases/download/v2.47.1/dugite-native-v2.47.1-8d348e6-ubuntu-arm64.tar.gz",
"checksum": "b9fcc671557a86259408b31875badaedd43408c9ef1fd4d502386d2bd36923ef"
}
}
11 changes: 10 additions & 1 deletion script/update-embedded-git.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ fetch(`https://api.github.com/repos/desktop/dugite-native/releases/latest`)
const output = {
'win32-x64': await findWindows64BitRelease(assets),
'win32-ia32': await findWindows32BitRelease(assets),
'win32-arm64': await findWindowsARM64BitRelease(assets),
'darwin-x64': await findMacOSx64BitRelease(assets),
'darwin-arm64': await findMacOSARM64BitRelease(assets),
'linux-x64': await findLinux64BitRelease(assets),
Expand Down Expand Up @@ -54,6 +55,14 @@ function findWindows32BitRelease(assets) {
return getDetailsForAsset(assets, asset)
}

function findWindowsARM64BitRelease(assets) {
const asset = assets.find(a => a.name.endsWith('-windows-arm64.tar.gz'))
if (asset == null) {
throw new Error('Could not find Windows arm64 archive in latest release')
}
return getDetailsForAsset(assets, asset)
}

function findMacOSx64BitRelease(assets) {
const asset = assets.find(a => a.name.endsWith('-macOS-x64.tar.gz'))
if (asset == null) {
Expand All @@ -65,7 +74,7 @@ function findMacOSx64BitRelease(assets) {
function findMacOSARM64BitRelease(assets) {
const asset = assets.find(a => a.name.endsWith('-macOS-arm64.tar.gz'))
if (asset == null) {
throw new Error('Could not find MacOS 64-bit archive in latest release')
throw new Error('Could not find MacOS arm64 archive in latest release')
}
return getDetailsForAsset(assets, asset)
}
Expand Down
4 changes: 2 additions & 2 deletions test/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ import { join } from 'path'
import { tmpdir } from 'os'

// NOTE: bump these versions to the latest stable releases
export const gitVersion = '2.45.3'
export const gitForWindowsVersion = '2.45.2.windows.2'
export const gitVersion = '2.47.1'
export const gitForWindowsVersion = '2.47.1.windows.2'
export const gitLfsVersion = '3.6.1'
export const gitCredentialManagerVersion = '2.6.1'

Expand Down
Loading