pgRouting / pgrouting

Repository contains pgRouting library. Development branch is "develop", stable branch is "master"
https://pgrouting.org
GNU General Public License v2.0
1.14k stars 364 forks source link

pgRouting develop doesn't compile against PG16 #2525

Closed robe2 closed 1 year ago

robe2 commented 1 year ago

Problem PG16 is currently in beta which means there should be no more breaking changes and we should start to make sure pgRouting works against it.

To Reproduce Try compiling pgRouting develop against PG16 and it fails:

C:/ming64gcc81/projects/pgrouting/branches/pgrouting/src/cpp_common/get_check_data.cpp: In function 'char* pgrouting::getText(HeapTuple, TupleDescData* const&, const Column_info_t&)':
C:/ming64gcc81/projects/pgrouting/branches/pgrouting/src/cpp_common/get_check_data.cpp:455:40: error: invalid conversion from 'char*' to 'Datum' {aka 'long long unsigned int'} [-fpermissive]
     return DatumGetCString(SPI_getvalue(tuple, tupdesc, info.colNumber));
                            ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:/ming64gcc81/projects/pgrouting/branches/pgrouting/include/cpp_common/get_check_data.hpp:31,
                 from C:/ming64gcc81/projects/pgrouting/branches/pgrouting/src/cpp_common/get_check_data.cpp:26:
C:/ming64gcc81/projects/postgresql/rel/pg16w64gcc81/include/server/postgres.h:335:23: note:   initializing argument 1 of 'char* DatumGetCString(Datum)'
 DatumGetCString(Datum X)
                 ~~~~~~^
make[2]: *** [src/cpp_common/CMakeFiles/cpp_common.dir/build.make:170: src/cpp_common/CMakeFiles/cpp_common.dir/get_check_data.cpp.obj] Error 1
make[2]: Leaving directory '/projects/pgrouting/build'
make[1]: *** [CMakeFiles/Makefile2:1944: src/cpp_common/CMakeFiles/cpp_common.dir/all] Error 2
make[1]: Leaving directory '/projects/pgrouting/build'
make: *** [Makefile:139: all] Error 2

Expectation Should compile

Sample Data

Platform/versions

SELECT version();
SELECT postgis_full_version();

-- fails since can't compile
SELECT pgr_version();
PostgreSQL 16devel on x86_64-w64-mingw32, compiled by gcc.exe (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 8.1.0, 64-bit
POSTGIS="3.4.0dev 3.3.0rc2-1089-g924567262" [EXTENSION] PGSQL="160" GEOS="3.12.0dev-CAPI-1.18.0" PROJ="8.2.1 NETWORK_ENABLED=OFF URL_ENDPOINT=https://cdn.proj.org USER_WRITABLE_DIRECTORY=C:\Users\Administrator\AppData\Local/proj DATABASE_PATH=C:\ming64gcc81\projects\proj\rel-proj-8.2.1w64gcc81/share/proj/proj.db" LIBXML="2.9.14" LIBJSON="0.12" LIBPROTOBUF="1.2.1" WAGYU="0.5.0 (Internal)"

I think it might have broken because of this change 9 months ago

https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=c8b2ef0

robe2 commented 1 year ago

There is no need to backport this. The issue appears to be only in develop with the introduction of the cpp_common/get_check_data.cpp file

I confirmed that main branch compiles cleanly against PG16, though I didn't do a check on the tests.

robe2 commented 1 year ago

this is fixed with the merge. I'll open another issues for the PG16 failures of tests on main and develop