greenplum-db/plcontainer

Doesn't Compile on CentOS 7

Opened this issue · 2 comments

Hi Guys,
I am impressed with this project and am trying out my hand at running it in raw PostgreSQL. I am using 9.6 to start and once I get that working I will then tweek the code to work on PG10 and PG11. The first real issues I am encountering with building from instructions in the README_PG.md file is that your code does NOT compile on CENTOS 7. I tried on CentOS6, but, I can't install Docker Community Edition there. Below is the compile errors I get from the master branch (please look past the unusd parameter warnings, I assume I can set CFLAGS and shut them off):

In file included from /home/denisl/pg/9.6.11/include/postgresql/server/executor/spi.h:16:0,
from src/message_fns.c:44:
/home/denisl/pg/9.6.11/include/postgresql/server/lib/ilist.h: In function ‘dlist_next_node’:
/home/denisl/pg/9.6.11/include/postgresql/server/lib/ilist.h:421:29: error: unused parameter ‘head’ [-Werror=unused-parameter]
dlist_next_node(dlist_head *head, dlist_node *node)
^
/home/denisl/pg/9.6.11/include/postgresql/server/lib/ilist.h: In function ‘dlist_prev_node’:
/home/denisl/pg/9.6.11/include/postgresql/server/lib/ilist.h:431:29: error: unused parameter ‘head’ [-Werror=unused-parameter]
dlist_prev_node(dlist_head *head, dlist_node *node)
^
/home/denisl/pg/9.6.11/include/postgresql/server/lib/ilist.h: In function ‘slist_next_node’:
/home/denisl/pg/9.6.11/include/postgresql/server/lib/ilist.h:622:29: error: unused parameter ‘head’ [-Werror=unused-parameter]
slist_next_node(slist_head *head, slist_node *node)
^
In file included from /home/denisl/pg/9.6.11/include/postgresql/server/access/heapam.h:21:0,
from /home/denisl/pg/9.6.11/include/postgresql/server/nodes/execnodes.h:18,
from /home/denisl/pg/9.6.11/include/postgresql/server/executor/execdesc.h:18,
from /home/denisl/pg/9.6.11/include/postgresql/server/utils/portal.h:50,
from /home/denisl/pg/9.6.11/include/postgresql/server/executor/spi.h:18,
from src/message_fns.c:44:
/home/denisl/pg/9.6.11/include/postgresql/server/storage/bufpage.h: In function ‘PageValidateSpecialPointer’:
/home/denisl/pg/9.6.11/include/postgresql/server/storage/bufpage.h:310:33: error: unused parameter ‘page’ [-Werror=unused-parameter]
PageValidateSpecialPointer(Page page)
^
src/message_fns.c: In function ‘plcontainer_procedure_get’:
src/message_fns.c:84:2: error: unknown type name ‘Form_pg_type’
Form_pg_type typeTup;
^
src/message_fns.c:106:3: error: implicit declaration of function ‘GETSTRUCT’ [-Werror=implicit-function-declaration]
procStruct = (Form_pg_proc) GETSTRUCT(procHeapTup);
^
src/message_fns.c:106:16: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
procStruct = (Form_pg_proc) GETSTRUCT(procHeapTup);
^
src/message_fns.c:126:3: error: implicit declaration of function ‘HeapTupleHeaderGetXmin’ [-Werror=implicit-function-declaration]
proc->fn_xmin = HeapTupleHeaderGetXmin(procHeapTup->t_data);
^
src/message_fns.c:135:3: error: ISO C90 forbids mixed declarations and code [-Werror=declaration-after-statement]
HeapTuple rvTypeTup;
^
src/message_fns.c:136:3: error: unknown type name ‘Form_pg_type’
Form_pg_type rvTypeStruct;
^
src/message_fns.c:143:19: error: ‘Form_pg_type’ undeclared (first use in this function)
rvTypeStruct = (Form_pg_type) GETSTRUCT(rvTypeTup);
^
src/message_fns.c:143:19: note: each undeclared identifier is reported only once for each function it appears in
src/message_fns.c:143:33: error: expected ‘;’ before ‘GETSTRUCT’
rvTypeStruct = (Form_pg_type) GETSTRUCT(rvTypeTup);
^
src/message_fns.c:146:19: error: invalid type argument of ‘->’ (have ‘int’)
if (rvTypeStruct->typtype == TYPTYPE_PSEUDO) {
^
src/message_fns.c:146:32: error: ‘TYPTYPE_PSEUDO’ undeclared (first use in this function)
if (rvTypeStruct->typtype == TYPTYPE_PSEUDO) {
^
src/message_fns.c:147:34: error: ‘TRIGGEROID’ undeclared (first use in this function)
if (procStruct->prorettype == TRIGGEROID)
^
src/message_fns.c:151:39: error: ‘VOIDOID’ undeclared (first use in this function)
else if (procStruct->prorettype != VOIDOID
^
src/message_fns.c:152:35: error: ‘RECORDOID’ undeclared (first use in this function)
&& procStruct->prorettype != RECORDOID)
^
src/message_fns.c:159:16: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
procStruct = (Form_pg_proc) GETSTRUCT(procHeapTup);
^
In file included from src/message_fns.c:38:0:
src/message_fns.c:177:60: error: ‘TEXTOID’ undeclared (first use in this function)
textHeapTup = SearchSysCache(TYPEOID, ObjectIdGetDatum(TEXTOID), 0, 0, 0);
^
/home/denisl/pg/9.6.11/include/postgresql/server/postgres.h:388:39: note: in definition of macro ‘SET_4_BYTES’
#define SET_4_BYTES(value) (((Datum) (value)) & 0xffffffff)
^
src/message_fns.c:177:43: note: in expansion of macro ‘ObjectIdGetDatum’
textHeapTup = SearchSysCache(TYPEOID, ObjectIdGetDatum(TEXTOID), 0, 0, 0);
^
src/message_fns.c:181:30: error: expected ‘;’ before ‘GETSTRUCT’
typeTup = (Form_pg_type) GETSTRUCT(textHeapTup);
^
src/message_fns.c:183:30: error: invalid type argument of ‘->’ (have ‘int’)
typeTup->typlen, typeTup->typbyval, typeTup->typalign,
^
src/message_fns.c:183:47: error: invalid type argument of ‘->’ (have ‘int’)
typeTup->typlen, typeTup->typbyval, typeTup->typalign,
^
src/message_fns.c:183:66: error: invalid type argument of ‘->’ (have ‘int’)
typeTup->typlen, typeTup->typbyval, typeTup->typalign,
^

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

HI.
docker/plc_docker.cc: In static member function ‘static int PlcDocker::mem_stats(std::vector<std::__cxx11::basic_string >&, std::vector&)’:
docker/plc_docker.cc:225:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
gcc -I/usr/include/libxml2 -std=gnu99 -Iinclude -Iinclude/proto -Wall -Wextra -g3 -O0 -ggdb -fPIC -shared -o plc_coordinator.so plc_coordinator.o containers.o message_fns.o plc_configuration.o plc_docker_api.o plcontainer_udfs.o function_cache.o plc_typeio.o common/comm_connectivity.o common/comm_dummy_plc.o common/comm_messages.o proto/async_server.o proto/client.o proto/proto_utils.o proto/plcontainer.pb.o proto/plcontainer.grpc.pb.o docker/docker_client.o docker/plc_docker.o -L/usr/local/greenplum-db-6.7.0/lib -Wl,--as-needed -Wl,-rpath,'/usr/local/greenplum-db-6.7.0/lib',--enable-new-dtags -ljson-c -lxml2 -lcurl -L/usr/local/lib -lprotobuf -lgrpc++ -lgrpc -lgpr -Wl,--no-as-needed -lgrpc++_reflection -Wl,--as-needed -ldl
make[1]: Leaving directory '/tmp/plcontainer/src'
gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -fno-aggressive-loop-optimizations -Wno-unused-but-set-variable -Wno-address -Werror=implicit-fallthrough=3 -Wno-format-truncation -O3 -fargument-noalias-global -fno-omit-frame-pointer -g -std=gnu99 -Werror=uninitialized -Werror=implicit-function-declaration -fPIC -Werror -Wextra -Wall -Wno-sign-compare -I./src/include -I./src/include/proto -I/usr/include/libxml2 -I. -I./ -I/usr/local/greenplum-db-6.7.0/include/postgresql/server -I/usr/local/greenplum-db-6.7.0/include/postgresql/internal -D_GNU_SOURCE -I/usr/include/libxml2 -c -o src/plcontainer.o src/plcontainer.c
In file included from /usr/local/greenplum-db-6.7.0/include/postgresql/server/storage/smgr.h:20:0,
from /usr/local/greenplum-db-6.7.0/include/postgresql/server/storage/buf_internals.h:22,
from /usr/local/greenplum-db-6.7.0/include/postgresql/server/storage/bufmgr.h:20,
from /usr/local/greenplum-db-6.7.0/include/postgresql/server/storage/bufpage.h:25,
from /usr/local/greenplum-db-6.7.0/include/postgresql/server/nodes/tidbitmap.h:32,
from /usr/local/greenplum-db-6.7.0/include/postgresql/server/access/genam.h:19,
from /usr/local/greenplum-db-6.7.0/include/postgresql/server/nodes/execnodes.h:19,
from /usr/local/greenplum-db-6.7.0/include/postgresql/server/commands/trigger.h:16,
from src/plcontainer.c:16:
/usr/local/greenplum-db-6.7.0/include/postgresql/server/lib/ilist.h: In function ‘dlist_next_node’:
/usr/local/greenplum-db-6.7.0/include/postgresql/server/lib/ilist.h:448:29: error: unused parameter ‘head’ [-Werror=unused-parameter]
dlist_next_node(dlist_head *head, dlist_node *node)
^~~~
/usr/local/greenplum-db-6.7.0/include/postgresql/server/lib/ilist.h: In function ‘dlist_prev_node’:
/usr/local/greenplum-db-6.7.0/include/postgresql/server/lib/ilist.h:458:29: error: unused parameter ‘head’ [-Werror=unused-parameter]
dlist_prev_node(dlist_head *head, dlist_node *node)
^~~~
/usr/local/greenplum-db-6.7.0/include/postgresql/server/lib/ilist.h: In function ‘slist_next_node’:
/usr/local/greenplum-db-6.7.0/include/postgresql/server/lib/ilist.h:669:29: error: unused parameter ‘head’ [-Werror=unused-parameter]
slist_next_node(slist_head *head, slist_node *node)
^~~~
cc1: all warnings being treated as errors
: recipe for target 'src/plcontainer.o' failed
make: *** [src/plcontainer.o] Error 1