Repository navigation
fix: disable HDF5/NetCDF/Poppler in GDAL build to resolve DLL init failure in R - #22
Merged
Merged
Conversation
ROOT CAUSE: ERROR_DLL_INIT_FAILED (Windows error 1114) when loading libgdal-*.dll in an R session. The HDF5 driver's dependency chain (libhdf5 → libsuperlu → libopenblas → libgfortran-5/libgomp-1/libquadmath-0) conflicts with Rtools45's copies of these same DLLs already loaded by R at startup. Windows' loaded-module list rule reuses the Rtools copy of libgfortran/libgomp for all subsequent DLL loads, regardless of what is in the bundle's bin/. When Rtools45 GCC and MSYS2 UCRT64 GCC versions diverge, libopenblas DllMain returns FALSE → ERROR_DLL_INIT_FAILED. FIX: Set GDAL_USE_HDF5=OFF, GDAL_USE_NETCDF=OFF, GDAL_USE_POPPLER=OFF in cmake configure. Remove corresponding MSYS2 packages from the explicit install list. Update comments and release body table to document the rationale. The build cache key (hashing build_gdal.sh) auto-busts on this change so the next workflow run produces a fresh bundle."
Copilot
AI
changed the title
[WIP] Fix failing GitHub Actions job E2E: runtime + gdalraster + hook
fix: disable HDF5/NetCDF/Poppler in GDAL build to resolve DLL init failure in R
Jul 3, 2026
jimbrig
marked this pull request as ready for review
July 3, 2026 22:41
Pull Request Summary by devActivityMetricsAchievements
|
Copilot stopped work on behalf of
jimbrig due to an error
July 3, 2026 23:03
jimbrig
added a commit
that referenced
this pull request
Jul 4, 2026
…etCDF; gate bundles on loadability Root cause of the e2e ERROR_DLL_INIT_FAILED (1114): MSYS2's libpodofo.dll runs OpenSSL initialization in its static initializers (DllMain, under the loader lock) and fails against the MSYS2-built libcrypto-3-x64.dll - in any process. libgdal imports libpodofo directly when the PDF driver is built, making libgdal-*.dll itself unloadable. Disabling only GDAL_USE_POPPLER is insufficient (the driver falls back to podofo), so the driver is off entirely: GDAL_ENABLE_DRIVER_PDF=OFF + POPPLER/PODOFO/PDFIUM=OFF. The earlier HDF5/OpenBLAS/Rtools-conflict theory (PR #22) was disproven by loading all 175 published-bundle DLLs individually inside R 4.6.1 - only libpodofo fails - so GDAL_USE_HDF5/NETCDF are ON again. Verification now has three layers so this class of breakage can never publish again: ntldd closure + banned-DLL guard (collect_dlls.sh), LoadLibrary smoke test over every bundled DLL (build.yml step 7b), and the e2e workflow on release publish. Validated locally end to end in Rtools45 UCRT64: full 3.13.1 build with the new flags, 162-DLL closed bundle (no podofo/poppler/NSS), 0 load failures, gdalraster source-built against it, algorithm registry returns all 8 names. Co-authored-by: Cursor <cursoragent@cursor.com>
1 of 4 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The e2e CI job "E2E: runtime + gdalraster + hook" fails with
ERROR_DLL_INIT_FAILED(Windows 1114) whenlibgdal-*.dllis loaded inside an R session.Root cause: Windows' loaded-module list rule — once R loads
Rblas.dllat startup (Rtools45), itslibgfortran-5.dll/libgomp-1.dll/libquadmath-0.dllare pinned in the process. The GDAL bundle's HDF5 driver chain (libhdf5 → libsuperlu → libopenblas → libgfortran/libgomp) then receives the already-loaded Rtools copies at DllMain time. When Rtools45 and the MSYS2 UCRT64 build environment use different GCC versions,libopenblas.DllMainreturnsFALSE→ the error propagates up tolibgdalitself. Poppler poses a secondary risk via its NSS/NSPR dependency.Changes
tools/build_gdal.sh-DGDAL_USE_HDF5=OFF,-DGDAL_USE_NETCDF=OFF,-DGDAL_USE_POPPLER=OFFto the cmake configure, eliminating the OpenBLAS/Fortran/OpenMP and NSS/NSPR dependency chains from the bundle entirely.github/workflows/build.ymlhdf5,netcdf,popplerfrom the MSYS2 explicit package install listHDF5=OFF,NETCDF=OFF,POPPLER=OFF) with rationaleThe build cache key hashes
build_gdal.sh, so the next workflow run automatically triggers a full rebuild producing a clean bundle. The e2e workflow auto-triggers when the new release is published.