citusdata/pg_shard

1.2.1 build error against PostgreSQL 9.4

devrimgunduz opened this issue · 5 comments

Hi,

I'm getting this while trying to build pg_shard against PG 9.4.4, on Fedora 22:

gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Wendif-labels -Wmissing-format-attribute -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -DLINUX_OOM_ADJ=0 -fpic -std=c99 -Wall -Wextra -Werror -Wno-unused-parameter -Iinclude -I/usr/pgsql-9.5/include -Itest/include -I. -I./ -I/usr/pgsql-9.5/include/server -I/usr/pgsql-9.5/include/internal -D_GNU_SOURCE -I/usr/include/libxml2 -I/usr/include -c -o test/src/create_shards.o test/src/create_shards.c
cp sql/pg_shard.sql sql/pg_shard--1.2.sql
test/src/fake_fdw.c: In function 'FakeGetForeignPlan':
test/src/fake_fdw.c:108:9: error: too few arguments to function 'make_foreignscan'
return make_foreignscan(tlist, scan_clauses, scan_relid, NIL, NIL);
^
In file included from test/src/fake_fdw.c:29:0:
/usr/pgsql-9.5/include/server/optimizer/planmain.h:46:21: note: declared here
extern ForeignScan make_foreignscan(List *qptlist, List *qpqual,
^
test/src/fake_fdw.c:109:1: error: control reaches end of non-void function [-Werror=return-type]
}
^
cc1: all warnings being treated as errors
: recipe for target 'test/src/fake_fdw.o' failed
make[1]: *
* [test/src/fake_fdw.o] Error 1
make[1]: *** Waiting for unfinished jobs....
src/generate_ddl_commands.c: In function 'TableDDLCommandList':
src/generate_ddl_commands.c:131:19: error: implicit declaration of function 'pg_get_constraintdef_string' [-Werror=implicit-function-declaration]
statementDef = pg_get_constraintdef_string(constraintId);
^
src/generate_ddl_commands.c:131:17: error: assignment makes pointer from integer without a cast [-Werror=int-conversion]
statementDef = pg_get_constraintdef_string(constraintId);
^
src/generate_ddl_commands.c:135:19: error: implicit declaration of function 'pg_get_indexdef_string' [-Werror=implicit-function-declaration]
statementDef = pg_get_indexdef_string(indexId);
^
src/generate_ddl_commands.c:135:17: error: assignment makes pointer from integer without a cast [-Werror=int-conversion]
statementDef = pg_get_indexdef_string(indexId);
^
src/generate_ddl_commands.c: In function 'pg_shard_get_tableschemadef_string':
src/generate_ddl_commands.c:263:22: error: implicit declaration of function 'deparse_context_for' [-Werror=implicit-function-declaration]
defaultContext = deparse_context_for(relationName, tableRelationId);
^
src/generate_ddl_commands.c:263:20: error: assignment makes pointer from integer without a cast [-Werror=int-conversion]
defaultContext = deparse_context_for(relationName, tableRelationId);
^
src/generate_ddl_commands.c:266:21: error: implicit declaration of function 'deparse_expression' [-Werror=implicit-function-declaration]
defaultString = deparse_expression(defaultNode, defaultContext,
^
src/generate_ddl_commands.c:266:19: error: assignment makes pointer from integer without a cast [-Werror=int-conversion]
defaultString = deparse_expression(defaultNode, defaultContext,
^
src/generate_ddl_commands.c:310:16: error: assignment makes pointer from integer without a cast [-Werror=int-conversion]
checkContext = deparse_context_for(relationName, tableRelationId);
^
src/generate_ddl_commands.c:313:15: error: assignment makes pointer from integer without a cast [-Werror=int-conversion]
checkString = deparse_expression(checkNode, checkContext, false, false);
^
cc1: all warnings being treated as errors
: recipe for target 'src/generate_ddl_commands.o' failed
make[1]: *** [src/generate_ddl_commands.o] Error 1
src/extend_ddl_commands.c: In function 'DeparseCreateStmt':
src/extend_ddl_commands.c:608:28: error: implicit declaration of function 'deparse_context_for' [-Werror=implicit-function-declaration]
List defaultContext = deparse_context_for(masterRelationName,
^
src/extend_ddl_commands.c:608:28: error: initialization makes pointer from integer without a cast [-Werror=int-conversion]
src/extend_ddl_commands.c:610:32: error: implicit declaration of function 'deparse_expression' [-Werror=implicit-function-declaration]
char *defaultValueString = deparse_expression(plannedExpression,
^
src/extend_ddl_commands.c:610:32: error: initialization makes pointer from integer without a cast [-Werror=int-conversion]
src/extend_ddl_commands.c:655:16: error: assignment makes pointer from integer without a cast [-Werror=int-conversion]
checkContext = deparse_context_for(masterRelationName, masterRelationId);
^
src/extend_ddl_commands.c:656:15: error: assignment makes pointer from integer without a cast [-Werror=int-conversion]
checkString = deparse_expression(plannedExpression, checkContext, false, false);
^
src/extend_ddl_commands.c: In function 'DeparseIndexStmt':
src/extend_ddl_commands.c:787:24: error: initialization makes pointer from integer without a cast [-Werror=int-conversion]
List *exprContext = deparse_context_for(masterRelationName, masterRelationId);
^
src/extend_ddl_commands.c:788:23: error: initialization makes pointer from integer without a cast [-Werror=int-conversion]
char *exprString = deparse_expression(expression, exprContext, false, false);
^
cc1: all warnings being treated as errors
: recipe for target 'src/extend_ddl_commands.o' failed
make[1]: *
* [src/extend_ddl_commands.o] Error 1
make[1]: Leaving directory '/home/devrim/Documents/Devrim/Projects/repo/pgrpms/rpm/redhat/9.5/pg_shard/F-22/pg_shard-1.2.1'
error: Bad exit status from /var/tmp/rpm-tmp.0V0npJ (%build)

RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.0V0npJ (%build)
../../../common/Makefile.global:84: recipe for target 'nopreprpm' failed

Regards, Devrim

Hi @devrimgunduz,

Currently I don't have access to a fedora machine. But, I tested pg_shard 1.2.1 on Postgres 9.4.4 on Red Hat Enterprise Linux Server release 7.1 (Maipo). Everything seems good (compile & regression tests)

Then, I realized that your compile command seems to include 9.5 libraries such as the following:

  • -I/usr/pgsql-9.5/include

Could this be the source of the problem? Else, I'll try to simulate exactly your environment.

Thanks!

@onderkalaci Could we try this out on EC2 and see if that solves the problem?

Hey @ozgune @devrimgunduz

I successfully compiled pg_shard 1.2.1 (and 1.2.2) against Postgres 9.4.4 on Fedora 22.

Hi,

Sorry for the delay -- right, the title should be 9.5, not 9.4. Sorry about that.

Regards, Devrim

Closing, too. We could backport 9.5 compatibility to the 1.2 line later, but as 1.2.1 was released three days before the first 9.5 alpha, and as 9.5 isn't even released yet, I don't expect that particular tag to successfully build against 9.5 (as noted in #142).

We did add 9.5 compatibility in in #137, so develop should build successfully against 9.5. And we build against the latest 9.5 release in Travis now (every commit to develop and all PRs). Right now that means alpha 2, but we'll upgrade to the newest releases right after they come out (I hear a beta is upcoming).

Finally, if this is about the Red Hat-flavor-linux issue, @onderkalaci fixed that in #148.

Feel free to open a new issue if I've misinterpreted the core issue of this or #142.