Skip to content

Prevent clash with system GDAL#250

Open
wonder-sk wants to merge 1 commit into
open-vcpkg:mainfrom
wonder-sk:fix-py-rasterio-homebrew
Open

Prevent clash with system GDAL#250
wonder-sk wants to merge 1 commit into
open-vcpkg:mainfrom
wonder-sk:fix-py-rasterio-homebrew

Conversation

@wonder-sk

Copy link
Copy Markdown

On macOS, I have GDAL 3.13.0 from Homebrew and rasterio's setup.py was mistakenly using it instead of using GDAL from vcpkg port. The problem is that GDAL vcpkg port deletes gdal-config (for whatever reason) and so the gdal-config from PATH (Homebrew) gets picked and rasterio uses headers/libs from here. Then, when loaded against GDAL from vcpkg (3.12.x) I was getting a nasty ImportError due to ABI mismatch.

The fix makes sure that rasterio ignores gdal-config, because there is no such executable from GDAL vcpkg port anyway.

This surfaced for me with the recent vcpkg bump in QGIS...

On macOS, I have GDAL 3.13.0 from Homebrew and rasterio's setup.py was mistakenly
using it instead of using GDAL from vcpkg port. The problem is that GDAL vcpkg port
deletes gdal-config (for whatever reason) and so the gdal-config from PATH (Homebrew)
gets picked and rasterio uses headers/libs from here. Then, when loaded against
GDAL from vcpkg (3.12.x) I was getting a nasty ImportError due to ABI mismatch.

The fix makes sure that rasterio ignores gdal-config, because there is no such
executable from GDAL vcpkg port anyway.
@m-kuhn

m-kuhn commented Jun 15, 2026

Copy link
Copy Markdown
Contributor

thanks @wonder-sk

I guess it would be cleaner to provide the clean option as a setup argument, but I am not completely sure how to do that (would have to investigate). The current approach looks good as well, let's hope that the patch applies cleanly also in future versions.

Could you also increase the port-version in vcpkg.json, commit and after that update the version db?

vcpkg x-add-version --all --x-builtin-registry-versions-dir=./versions/ --x-builtin-ports-root=./ports # add `--overwrite-version` if you need to rebuild the version database while iterating on something

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants