$ mkdir -p testapp-geo && cd $_ && git init && h create
$ h buildpacks:add https://github.com/heroku/heroku-geo-buildpack
$ h buildpacks:add heroku/python
$ echo 'GDAL' > requirements.txt
$ git add -A && git commit -m '.' && git push heroku main
This uses buildpack default Python (currently 3.6.12), default stack (currently Heroku-20), and latest GDAL (currently 3.2.1).
Expected
The pip install of the [GDAL]() package succeeds.
Actual
The pip install fails during the GCC compilation step, with 12 thousand lines of GCC output, the first/last parts of which are below. Example error:
remote: extensions/gdalconst_wrap.c: In function ‘PyInit__gdalconst’:
remote: extensions/gdalconst_wrap.c:3879:71: error: ‘GDAL_OF_MULTIDIM_RASTER’ undeclared (first use in this function)
remote: 3879 | SWIG_Python_SetConstant(d, "OF_MULTIDIM_RASTER",SWIG_From_int((int)(GDAL_OF_MULTIDIM_RASTER)));
remote: | ^~~~~~~~~~~~~~~~~~~~~~~
The build succeeds if I use GDAL < v3, eg GDAL==2.4.4.
So I'm presuming this is a combination of:
This buildpack defaults to GDAL libs v2, which aren't compatible with GDAL Python bindings 3+ (would be good to mention the incompatibility in the README)
GDAL Python bindings 3+ don't check the version of GDAL libs before building, and so display thousands of errors, instead of a useful error message
STR:
This uses buildpack default Python (currently 3.6.12), default stack (currently Heroku-20), and latest GDAL (currently 3.2.1).
Expected
The pip install of the [GDAL]() package succeeds.
Actual
The pip install fails during the GCC compilation step, with 12 thousand lines of GCC output, the first/last parts of which are below. Example error:
The GDAL package has had a few releases recently: https://pypi.org/project/GDAL/#history https://github.com/OSGeo/gdal/blob/v3.2.1/gdal/NEWS
However trying older releases (eg
GDAL==3.1.3
) didn't help.Build log: