From 98f578dd18d018ec6fd93a2bcf5d28162a2568c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Fri, 25 Sep 2026 22:01:55 -0400 Subject: [PATCH 1/2] CI: Add diagnostic step to dump gdal DLL/pyd symbols (not for merge) Runs dumpbin on the currently installed gdal313.dll and _gdal.pyd right after OSGeo4W setup, to find which exported symbol is missing and causing "DLL load failed... The specified procedure could not be found" when importing osgeo.gdal, first seen in CI on 2026-09-25 after the gdal package moved from 3.13.3-1 to 3.13.3-2. Temporary, for CI investigation only. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/osgeo4w.yml | 42 +++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index 96b5a6bb9aa..d0aabf159cd 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -98,6 +98,48 @@ jobs: sqlite3-devel zstd-devel + - name: "[CI diagnostic, not for merge] Dump gdal DLL exports and _gdal.pyd imports" + # Locates the exact symbol _gdal.pyd fails to resolve at import time + # against the current gdal 3.13.3-2 build, using dumpbin from the + # Visual Studio install already on the runner. + shell: pwsh + env: + O4WROOT: ${{ steps.osgeo4w.outputs.root }} + run: | + $ErrorActionPreference = 'Stop' + $vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" + $dumpbin = & $vswhere -latest -products * -find '**\dumpbin.exe' | Select-Object -First 1 + if (-not $dumpbin) { + Write-Output '::error::dumpbin.exe not found via vswhere' + exit 1 + } + Write-Output "Using dumpbin: $dumpbin" + + $gdalDll = Get-ChildItem -Path "$env:O4WROOT\bin" -Filter 'gdal*.dll' | Select-Object -First 1 + $gdalPyd = Get-ChildItem -Path "$env:O4WROOT\apps" -Recurse -Filter '_gdal.pyd' | Select-Object -First 1 + if (-not $gdalDll) { + Write-Output '::error::gdal*.dll not found under O4WROOT\bin' + exit 1 + } + if (-not $gdalPyd) { + Write-Output '::error::_gdal.pyd not found under O4WROOT\apps' + exit 1 + } + Write-Output "gdal DLL: $($gdalDll.FullName)" + Write-Output "_gdal.pyd: $($gdalPyd.FullName)" + + Write-Output '::group::gdal DLL exports containing GlobalDestructor' + & $dumpbin /exports $gdalDll.FullName | Select-String 'GlobalDestructor' + Write-Output '::endgroup::' + + Write-Output '::group::_gdal.pyd dependents' + & $dumpbin /dependents $gdalPyd.FullName + Write-Output '::endgroup::' + + Write-Output '::group::_gdal.pyd full import table' + & $dumpbin /imports $gdalPyd.FullName + Write-Output '::endgroup::' + - name: Set number of cores for compilation run: | echo "MAKEFLAGS=-j$(nproc)" >> "${GITHUB_ENV}" From ccf7f84ac4be8b239b632a0ae273ec0ff4d498f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edouard=20Choini=C3=A8re?= <27212526+echoix@users.noreply.github.com> Date: Fri, 25 Sep 2026 22:24:47 -0400 Subject: [PATCH 2/2] CI: Fix _gdal.pyd filename pattern for ABI-tagged builds (not for merge) python3-gdal installs osgeo/_gdal.cp312-win_amd64.pyd (ABI-tagged), not _gdal.pyd, so the previous filter matched nothing. Co-Authored-By: Claude Sonnet 5 --- .github/workflows/osgeo4w.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/osgeo4w.yml b/.github/workflows/osgeo4w.yml index d0aabf159cd..b1eafc195de 100644 --- a/.github/workflows/osgeo4w.yml +++ b/.github/workflows/osgeo4w.yml @@ -115,14 +115,16 @@ jobs: } Write-Output "Using dumpbin: $dumpbin" + # python3-gdal ships ABI-tagged pyd names, e.g. _gdal.cp312-win_amd64.pyd; + # the dotted filter excludes siblings like _gdal_array.cp312-win_amd64.pyd. $gdalDll = Get-ChildItem -Path "$env:O4WROOT\bin" -Filter 'gdal*.dll' | Select-Object -First 1 - $gdalPyd = Get-ChildItem -Path "$env:O4WROOT\apps" -Recurse -Filter '_gdal.pyd' | Select-Object -First 1 + $gdalPyd = Get-ChildItem -Path "$env:O4WROOT\apps" -Recurse -Filter '_gdal.*.pyd' | Select-Object -First 1 if (-not $gdalDll) { Write-Output '::error::gdal*.dll not found under O4WROOT\bin' exit 1 } if (-not $gdalPyd) { - Write-Output '::error::_gdal.pyd not found under O4WROOT\apps' + Write-Output '::error::_gdal.*.pyd not found under O4WROOT\apps' exit 1 } Write-Output "gdal DLL: $($gdalDll.FullName)"