Open kloczek opened 3 months ago
There are more warnings.
Here is full build output where is possible to see some build
warnings as well
@kloczek thanks for the report! I can do something about this for 1.10.0. I've fixed a bunch of these in the main branch already.
This prevents Fiona being built with GCC 14:
[ 48s] fiona/crs.c:16104:18: warning: ‘__pyx_pw_5fiona_3crs_3CRS_35__hash__’ defined but not used [-Wunused-function]
[ 48s] 16104 | static Py_hash_t __pyx_pw_5fiona_3crs_3CRS_35__hash__(PyObject *__pyx_v_self) {
[ 48s] | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ 54s] INFO:root:gcc -shared build/temp.linux-x86_64-cpython-310/fiona/crs.o -L/usr/lib64 -L/usr/lib64 -lgdal -o build/lib.linux-x86_64-cpython-310/fiona/crs.cpython-310-x86_64-linux-gnu.so
[ 55s] INFO:root:building 'fiona._env' extension
[ 55s] INFO:root:gcc -Wno-unused-result -Wsign-compare -DNDEBUG -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g -DOPENSSL_LOAD_CONF -fwrapv -fno-semantic-interposition -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g -IVendor/ -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -g -IVendor/ -fPIC -I/usr/include/gdal -I/usr/include/python3.10 -c fiona/_env.c -o build/temp.linux-x86_64-cpython-310/fiona/_env.o
[ 55s] fiona/_env.c: In function ‘__pyx_f_5fiona_4_env_set_proj_search_path’:
[ 55s] fiona/_env.c:4255:32: error: passing argument 1 of ‘CSLAddString’ from incompatible pointer type [-Wincompatible-pointer-types]
[ 55s] 4255 | __pyx_v_paths = CSLAddString(__pyx_v_paths, __pyx_v_path_c);
[ 55s] | ^~~~~~~~~~~~~
[ 55s] | |
[ 55s] | const char **
[ 55s] In file included from fiona/_env.c:1260:
[ 55s] /usr/include/gdal/cpl_string.h:65:36: note: expected ‘char **’ but argument is of type ‘const char **’
[ 55s] 65 | char CPL_DLL **CSLAddString(char **papszStrList,
[ 55s] | ~~~~~~~^~~~~~~~~~~~
[ 55s] fiona/_env.c:4255:17: error: assignment to ‘const char **’ from incompatible pointer type ‘char **’ [-Wincompatible-pointer-types]
[ 55s] 4255 | __pyx_v_paths = CSLAddString(__pyx_v_paths, __pyx_v_path_c);
[ 55s] | ^
[ 55s] error: command '/usr/bin/gcc' failed with exit code 1
[ 55s] error: subprocess-exited-with-error
[ 55s]
[ 55s] × Building wheel for fiona (pyproject.toml) did not run successfully.
[ 55s] │ exit code: 1
[ 55s] ╰─> See above for output.
[ 55s]
[ 55s] note: This error originates from a subprocess, and is likely not a problem with pip.
[ 55s] full command: /usr/bin/python3.10 /usr/lib/python3.10/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py build_wheel /tmp/tmpqk1sjr_o
[ 55s] cwd: /home/abuild/rpmbuild/BUILD/fiona-1.9.6
[ 55s] Building wheel for fiona (pyproject.toml): finished with status 'error'
[ 55s] ERROR: Failed building wheel for fiona
[ 55s] Failed to build fiona
[ 55s] ERROR: Failed to build one or more wheels
@kloczek thanks for the report! I can do something about this for 1.10.0. I've fixed a bunch of these in the main branch already.
Can you give some hints on how to fix these issues? I have tried looking into the Cython code but it's rather obfuscated to me.
@kloczek @glaubitz what I see with fiona's main branch is that we only have one compiler warning/error when the package is built using GDAL's ubuntu-small-3.6.4 image (ubuntu 22.04 with gcc 13).
CFLAGS="-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS" make dockertest
...
building 'fiona.ogrext' extension
aarch64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include -I/venv/include -I/usr/include/python3.10 -c fiona/ogrext.c -o build/temp.linux-aarch64-3.10/fiona/ogrext.o
fiona/ogrext.c: In function ‘__pyx_f_5fiona_6ogrext_15StringListField_set’:
fiona/ogrext.c:32818:57: warning: passing argument 3 of ‘OGR_F_SetFieldStringList’ from incompatible pointer type [-Wincompatible-pointer-types]
32818 | OGR_F_SetFieldStringList(__pyx_v_feature, __pyx_v_i, ((char const **)__pyx_v_string_list));
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| const char **
In file included from /usr/include/gdal.h:50,
from fiona/ogrext.c:1282:
/usr/include/ogr_api.h:523:57: note: expected ‘CSLConstList’ {aka ‘char **’} but argument is of type ‘const char **’
523 | void CPL_DLL OGR_F_SetFieldStringList(OGRFeatureH, int, CSLConstList);
| ^~~~~~~~~~~~
aarch64-linux-gnu-gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 -Wl,-Bsymbolic-functions -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-aarch64-3.10/fiona/ogrext.o -lgdal -o build/lib.linux-aarch64-3.10/fiona/ogrext.cpython-310-aarch64-linux-gnu.so
Can either of you test with the main branch or the issue1365
branch to confirm?
@kloczek @glaubitz what I see with fiona's main branch is that we only have one compiler warning/error when the package is built using GDAL's ubuntu-small-3.6.4 image (ubuntu 22.04 with gcc 13).
CFLAGS="-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS" make dockertest ... building 'fiona.ogrext' extension aarch64-linux-gnu-gcc -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -I/usr/include -I/venv/include -I/usr/include/python3.10 -c fiona/ogrext.c -o build/temp.linux-aarch64-3.10/fiona/ogrext.o fiona/ogrext.c: In function ‘__pyx_f_5fiona_6ogrext_15StringListField_set’: fiona/ogrext.c:32818:57: warning: passing argument 3 of ‘OGR_F_SetFieldStringList’ from incompatible pointer type [-Wincompatible-pointer-types] 32818 | OGR_F_SetFieldStringList(__pyx_v_feature, __pyx_v_i, ((char const **)__pyx_v_string_list)); | ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | const char ** In file included from /usr/include/gdal.h:50, from fiona/ogrext.c:1282: /usr/include/ogr_api.h:523:57: note: expected ‘CSLConstList’ {aka ‘char **’} but argument is of type ‘const char **’ 523 | void CPL_DLL OGR_F_SetFieldStringList(OGRFeatureH, int, CSLConstList); | ^~~~~~~~~~~~ aarch64-linux-gnu-gcc -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -g -fwrapv -O2 -Wl,-Bsymbolic-functions -g -fwrapv -O2 -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-aarch64-3.10/fiona/ogrext.o -lgdal -o build/lib.linux-aarch64-3.10/fiona/ogrext.cpython-310-aarch64-linux-gnu.so
Can either of you test with the main branch or the
issue1365
branch to confirm?
I'm confused. Your patch changes a different part of the source, so I'm not sure whether this patch will help.
I'm looking now whether the issue in question has already been fixed on the main branch.
The proper fix for this issue should be #1314.
@glaubitz PR #1314 is already merged into the main branch, which will be 1.10.0. There won't be a 1.9.7. And in the issue1365 branch I no longer see any compiler warnings with gcc 13. I am not able to test with gcc 14 right now. That is why I am asking if you can check the issue1365 branch for me.
With latest glibc and
-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS
in $CFLAGS glibc headers are turning some warnings into errors