Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build error CentOS 7 PG_INT64_TYPE #520

Closed
b-harper opened this issue Mar 2, 2017 · 8 comments
Closed

build error CentOS 7 PG_INT64_TYPE #520

b-harper opened this issue Mar 2, 2017 · 8 comments

Comments

@b-harper
Copy link

@b-harper b-harper commented Mar 2, 2017

I am attempting to build psycopg2 2.7 for Python 3.6 on CentOS 7 and are getting the following error:

...
gcc -pthread -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -fPIC -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.7 (dt dec pq3 ext)" -DPG_VERSION_NUM=90218 -I/usr/include/python3.6m -I. -I/usr/include -I/usr/include/pgsql/server -c psycopg/psycopgmodule.c -o build/temp.linux-x86_64-3.6/psycopg/psycopgmodule.o -Wdeclaration-after-statement
In file included from ./psycopg/replication_cursor.h:30:0,
                 from psycopg/psycopgmodule.c:32:
./psycopg/libpq_support.h:31:32: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'XLogRecPtr'
 typedef unsigned PG_INT64_TYPE XLogRecPtr;
                                ^
In file included from psycopg/psycopgmodule.c:32:0:
./psycopg/replication_cursor.h:47:5: error: unknown type name 'XLogRecPtr'
     XLogRecPtr  write_lsn;        /* LSNs for replication feedback messages */
...

Note, CentOS 7 uses Postgresql 9.2.18. From what I can tell, PG_INT64_TYPE was introduced in Postgresql 9.3. Is Postgresql 9.2.X supported? Any recommendations on a patch file to work around this?

@dvarrazzo
Copy link
Member

@dvarrazzo dvarrazzo commented Mar 2, 2017

I would have said PG 9.1 should have worked as well. It doesn't seem the case. Taking a look...

@dvarrazzo
Copy link
Member

@dvarrazzo dvarrazzo commented Mar 2, 2017

uint64_t should work as well. Am I right, @a1exsh ?

dvarrazzo added a commit that referenced this issue Mar 2, 2017
Building with 9.2 reported failing on CentOS 7 in issue #520.

This commit is expected to fail build in Travis CI.
dvarrazzo added a commit that referenced this issue Mar 2, 2017
Only defined in Postgres 9.3

Should close #520, but let's wait for the CI response (build on Windows
etc.)
@b-harper
Copy link
Author

@b-harper b-harper commented Mar 2, 2017

Hey @dvarrazzo,

Thanks for the timely update. Adding your libpq_support.h patch, I was able able to build RPMs. Do you think a 2.7.1 release will be coming soon, or should I proceed with building 2.7 with the patch?

@dvarrazzo
Copy link
Member

@dvarrazzo dvarrazzo commented Mar 2, 2017

There are a few bugs already open and fixed with 2.7: a 2.7.1 may come out in a few days/one week.

@b-harper
Copy link
Author

@b-harper b-harper commented Mar 2, 2017

@dvarrazzo,

Thanks for the additional information. I think we will just wait for 2.7.1.

@dvarrazzo
Copy link
Member

@dvarrazzo dvarrazzo commented Mar 2, 2017

Hey @b-harper sorry to bother you, I was wondering if you can give me some RPM advice in bug #518. I've mentioned you there but I'm not sure you get a notification as you haven't participated to that issue. Thank you very much!

@b-harper
Copy link
Author

@b-harper b-harper commented Mar 2, 2017

I got email notification about being mentioned on #518 and will reply.

@dvarrazzo dvarrazzo closed this in 26bd5df Mar 2, 2017
dvarrazzo added a commit that referenced this issue Mar 2, 2017
Building with 9.2 reported failing on CentOS 7 in issue #520.

I would leave this commit in a branch aside for the moment, because this
is useful but it cannot replace building with more modern libpq, because
some features are not compiled in and some tests skipped.
@a1exsh
Copy link
Contributor

@a1exsh a1exsh commented Mar 3, 2017

@dvarrazzo I'm late to the party, but the fix looks fine. There are uses of int64_t already in the same file anyway.

dvarrazzo added a commit that referenced this issue Mar 11, 2017
Building with 9.2 reported failing on CentOS 7 in issue #520.

I would leave this commit in a branch aside for the moment, because this
is useful but it cannot replace building with more modern libpq, because
some features are not compiled in and some tests skipped.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants