Skip to content

Commit b28a745

Browse files
committed
Test ARM64 ODBC driver natively using Firebird snapshot-master
PSFirebird v1.2.0 adds snapshot support. Firebird snapshot-master publishes win-arm64 binaries, enabling native ARM64 builds and tests. - windows-11-arm: build ARM64 natively (no -A flag), test against Firebird snapshot-master win-arm64 binary (real ARM64 fbclient.dll) - Remove win-x64 emulation workaround on ARM64 Windows hosts - windows-latest ARM64 build-only job retained for release artifact - Require PSFirebird >= 1.2.0 (snapshot branch support) - build-test-databases: supports -Branch for snapshot Firebird
1 parent 22801d7 commit b28a745

3 files changed

Lines changed: 19 additions & 13 deletions

File tree

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,9 @@ jobs:
2929
artifact-name: windows-arm64-binaries
3030
arch: ARM64
3131
build-only: true
32-
# Windows ARM64 tests: build as x64 and test via emulation
33-
# because Firebird has no ARM64 Windows binaries yet.
32+
# Windows ARM64 native: build + test using Firebird snapshot-master (win-arm64).
33+
# Firebird does not publish official ARM64 Windows releases; snapshots do.
3434
- os: windows-11-arm
35-
arch: x64
3635
- os: ubuntu-22.04
3736
artifact-name: linux-x64-binaries
3837
- os: ubuntu-22.04-arm

firebird-odbc-driver.build.ps1

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -42,20 +42,20 @@ if ($IsWindowsOS) {
4242
$DriverPath = Join-Path $BuildDir $DriverFileName
4343
}
4444

45-
# Map build Architecture to PSFirebird RuntimeIdentifier (RID).
45+
# Map build Architecture to PSFirebird RuntimeIdentifier (RID) and optional branch.
4646
# Used by build-test-databases to download the correct Firebird binaries.
47-
# ARM64 falls back to win-x64 because Firebird has no ARM64 Windows builds.
4847
$FirebirdRid = switch ($Architecture) {
4948
'Win32' { 'win-x86' }
50-
'ARM64' { 'win-x64' }
5149
default { '' }
5250
}
51+
$FirebirdBranch = ''
5352

54-
# On ARM64 Windows hosts building for x64 (emulation), explicitly request
55-
# win-x64 Firebird since PSFirebird would otherwise auto-detect win-arm64.
56-
if (-not $FirebirdRid -and $IsWindowsOS -and
53+
# On native ARM64 Windows (no Architecture override = native ARM64 build),
54+
# use the Firebird snapshot-master branch which publishes win-arm64 binaries.
55+
if (-not $Architecture -and $IsWindowsOS -and
5756
[System.Runtime.InteropServices.RuntimeInformation]::OSArchitecture -eq 'Arm64') {
58-
$FirebirdRid = 'win-x64'
57+
$FirebirdRid = 'win-arm64'
58+
$FirebirdBranch = 'master'
5959
}
6060

6161
# Synopsis: Remove the build directory.
@@ -85,7 +85,8 @@ task build {
8585
# Synopsis: Create Firebird test databases.
8686
task build-test-databases {
8787
$fbVersion = '5.0.2'
88-
$envPath = '/fbodbc-tests/fb502'
88+
# Use a distinct env path for snapshot (branch) builds to avoid stale cache.
89+
$envPath = if ($FirebirdBranch) { "/fbodbc-tests/snapshot-$FirebirdBranch" } else { '/fbodbc-tests/fb502' }
8990
$dbPathUtf8 = '/fbodbc-tests/TEST.FB50.FDB'
9091
$dbPathIso = '/fbodbc-tests/TEST-ISO.FB50.FDB'
9192

@@ -104,12 +105,18 @@ task build-test-databases {
104105
$fbExtraParams['RuntimeIdentifier'] = $FirebirdRid
105106
print Cyan "Using Firebird RID: $FirebirdRid"
106107
}
108+
if ($FirebirdBranch) {
109+
$fbExtraParams['Branch'] = $FirebirdBranch
110+
print Cyan "Using Firebird snapshot branch: $FirebirdBranch"
111+
} else {
112+
$fbExtraParams['Version'] = $fbVersion
113+
}
107114

108115
if (Test-Path (Join-Path $envPath 'firebird.msg')) {
109116
$fb = Get-FirebirdEnvironment -Path $envPath
110117
print Green "Reusing existing Firebird environment: $envPath"
111118
} else {
112-
$fb = New-FirebirdEnvironment -Version $fbVersion -Path $envPath -Force @fbExtraParams
119+
$fb = New-FirebirdEnvironment -Path $envPath -Force @fbExtraParams
113120
print Green "Firebird environment created: $envPath"
114121
}
115122

install-prerequisites.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,5 +21,5 @@ if ($IsLinux) {
2121
Register-PackageSource -Name 'NuGet' -Location 'https://api.nuget.org/v3/index.json' -ProviderName NuGet -Force
2222
}
2323

24-
Install-Module -Name PSFirebird -MinimumVersion 1.1.0 -Force -AllowClobber -Scope CurrentUser -Repository PSGallery
24+
Install-Module -Name PSFirebird -MinimumVersion 1.2.0 -Force -AllowClobber -Scope CurrentUser -Repository PSGallery
2525
Install-Module -Name InvokeBuild -Force -Scope CurrentUser

0 commit comments

Comments
 (0)