Segfault-Inc / Multicorn

Data Access Library
https://multicorn.org/
PostgreSQL License
699 stars 145 forks source link

Build failure with PG11: error: incompatible types when initializing type 'Form_pg_attribute {aka struct FormData_pg_attribute *}' using type 'FormData_pg_attribute {aka struct FormData_pg_attribute}' #206

Closed df7cb closed 5 years ago

df7cb commented 6 years ago

Multicorn fails to build against PG 11beta1:

10:10:11 gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -g -g -O2 -fdebug-prefix-map=/build/postgresql-11-LcCi7f/postgresql-11-11~beta1=. -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -I/usr/include/python2.7 -I/usr/include/x86_64-linux-gnu/python2.7  -I. -I./ -I/usr/include/postgresql/11/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -I/usr/include/mit-krb5  -c -o src/python.o src/python.c
10:10:12 src/python.c: In function 'getColumnsFromTable':
10:10:12 src/python.c:462:28: error: incompatible types when initializing type 'Form_pg_attribute {aka struct FormData_pg_attribute *}' using type 'FormData_pg_attribute {aka struct FormData_pg_attribute}'
10:10:12     Form_pg_attribute att = desc->attrs[i];
10:10:12                             ^~~~
10:10:12 src/python.c: In function 'getCacheEntry':
10:10:12 src/python.c:569:38: error: macro "AllocSetContextCreate" passed 5 arguments, but takes just 3
10:10:12                 ALLOCSET_SMALL_MAXSIZE),
10:10:12                                       ^
10:10:12 src/python.c:565:30: error: 'AllocSetContextCreate' undeclared (first use in this function); did you mean 'SlabContextCreate'?
10:10:12   MemoryContext tempContext = AllocSetContextCreate(CurrentMemoryContext,
10:10:12                               ^~~~~~~~~~~~~~~~~~~~~
10:10:12                               SlabContextCreate
10:10:12 src/python.c:565:30: note: each undeclared identifier is reported only once for each function it appears in
10:10:12 src/python.c: In function 'pythonDictToTuple':
10:10:12 src/python.c:1217:28: error: incompatible types when initializing type 'Form_pg_attribute {aka struct FormData_pg_attribute *}' using type 'FormData_pg_attribute {aka struct FormData_pg_attribute}'
10:10:12    Form_pg_attribute attr = slot->tts_tupleDescriptor->attrs[i];
10:10:12                             ^~~~
10:10:12 src/python.c: In function 'pythonSequenceToTuple':
10:10:12 src/python.c:1266:28: error: incompatible types when initializing type 'Form_pg_attribute {aka struct FormData_pg_attribute *}' using type 'FormData_pg_attribute {aka struct FormData_pg_attribute}'
10:10:12    Form_pg_attribute attr = slot->tts_tupleDescriptor->attrs[i];
10:10:12                             ^~~~
10:10:12 src/python.c: In function 'tupleTableSlotToPyObject':
10:10:12 src/python.c:1661:28: error: incompatible types when initializing type 'Form_pg_attribute {aka struct FormData_pg_attribute *}' using type 'FormData_pg_attribute {aka struct FormData_pg_attribute}'
10:10:12    Form_pg_attribute attr = tupdesc->attrs[i];
10:10:12                             ^~~~~~~
10:10:12 make[2]: *** [<builtin>: src/python.o] Error 1
devrimgunduz commented 6 years ago

Hi @rdunklau ,

PostgreSQL 11 Beta 2 is already out. Any updates on this?

Regards, Devrim

gunces commented 5 years ago

Hello,

I've got similar error when I try with PostgreSQL11 Beta 4. You can find more detail as bellow.

[root@localhost Multicorn]# make Python version is 2.7 [ -d sql ] || mkdir sql [ -d src ] || mkdir src touch directories.stamp gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -I. -I./ -I/usr/include/python2.7 -I. -I./ -I/usr/pgsql-11/include/server -I/usr/pgsql-11/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -c -o src/errors.o src/errors.c gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fPIC -I. -I./ -I/usr/include/python2.7 -I. -I./ -I/usr/pgsql-11/include/server -I/usr/pgsql-11/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -c -o src/python.o src/python.c src/python.c: In function ‘getColumnsFromTable’: src/python.c:462:28: error: incompatible types when initializing type ‘Form_pg_attribute’ {aka ‘struct FormData_pg_attribute ’} using type ‘FormData_pg_attribute’ {aka ‘struct FormData_pg_attribute’} Form_pg_attribute att = desc->attrs[i]; ^~~~ src/python.c: In function ‘getCacheEntry’: src/python.c:569:38: error: macro "AllocSetContextCreate" passed 5 arguments, but takes just 3 ALLOCSET_SMALL_MAXSIZE), ^ src/python.c:565:30: error: ‘AllocSetContextCreate’ undeclared (first use in this function); did you mean ‘SlabContextCreate’? MemoryContext tempContext = AllocSetContextCreate(CurrentMemoryContext, ^~~~~ SlabContextCreate src/python.c:565:30: note: each undeclared identifier is reported only once for each function it appears in src/python.c: In function ‘pythonDictToTuple’: src/python.c:1217:28: error: incompatible types when initializing type ‘Form_pg_attribute’ {aka ‘struct FormData_pg_attribute ’} using type ‘FormData_pg_attribute’ {aka ‘struct FormData_pg_attribute’} Form_pg_attribute attr = slot->tts_tupleDescriptor->attrs[i]; ^~~~ src/python.c: In function ‘pythonSequenceToTuple’: src/python.c:1266:28: error: incompatible types when initializing type ‘Form_pg_attribute’ {aka ‘struct FormData_pg_attribute ’} using type ‘FormData_pg_attribute’ {aka ‘struct FormData_pg_attribute’} Form_pg_attribute attr = slot->tts_tupleDescriptor->attrs[i]; ^~~~ src/python.c: In function ‘tupleTableSlotToPyObject’: src/python.c:1661:28: error: incompatible types when initializing type ‘Form_pg_attribute’ {aka ‘struct FormData_pg_attribute ’} using type ‘FormData_pg_attribute’ {aka ‘struct FormData_pg_attribute’} Form_pg_attribute attr = tupdesc->attrs[i]; ^~~ make: *** [: src/python.o] Error 1 [root@localhost Multicorn]#

devrimgunduz commented 5 years ago

ping. v11 will be out on Thursday.

df7cb commented 5 years ago

I got Multicorn to build with PG11 on Debian by appying #210 and #214. I'm not happy with the latter one as it suppresses a regression in the cache invalidation test, but it's a start. Hopefully someone with more clue about the code can have a look and improve on it.

kalluri023 commented 5 years ago

_we need to change Multicorn source code **src/query.c Install the llvm5.0 libraries, it is working fine

postgres=# \dx List of installed extensions Name | Version | Schema | Description

-----------+---------+------------+----------------------------------------------------

multicorn | 1.3.4 | public | Multicorn Python bindings for Postgres 9.2.* Foreig n Data Wrapper pgrouting | 2.6.2 | public | pgRouting Extension plpgsql | 1.0 | pg_catalog | PL/pgSQL procedural language postgis | 2.5.1 | public | PostGIS geometry, geography, and raster spatial typ es and functions (4 rows)

postgres=# select version(); version


PostgreSQL 11.1 on x8664-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28), 64-bit reference :+1: 1) https://github.com/phdowling/Multicorn/pull/1/files 2 ) https://github.com/Kozea/Multicorn/pull/214/commits/e85bdec8009778302d632ad4cb0349858d16436e

devrimgunduz commented 5 years ago

Hi,

Thanks! Any chance for a new release, so that I can update the RPMs?

Regards, Devrim

galuszkak commented 5 years ago

@devrimgunduz there is still work that needs to be done on #214 to make the release that will work for PostgreSQL 11. There is also a question around #221 as for now releases can be done by @rdunklau