Skip to content

Fix build with newer compilers on FreeBSD#125

Merged
jwp merged 2 commits intopython-postgres:masterfrom
rhurlin:master
May 2, 2023
Merged

Fix build with newer compilers on FreeBSD#125
jwp merged 2 commits intopython-postgres:masterfrom
rhurlin:master

Conversation

@rhurlin
Copy link
Contributor

@rhurlin rhurlin commented May 1, 2023

On FreeBSD current the installation process of databases/py-postgresql is broken [1]. optimized.cpython-39.so is not built most likely because due to compiler errors:

    In file included from postgresql/port/_optimized/module.c:43:
    postgresql/port/_optimized/buffer.c:590:2: error: incompatible pointer to integer conversion initializing 'Py_ssize_t' (aka 'long') with an expression of type 'void *' [-Wint-conversion]
            NULL,                                                                   /* tp_print */
            ^~~~
    /usr/include/sys/_null.h:34:14: note: expanded from macro 'NULL'
                    ^~~~~~~~~~~

The same happens with postgresql/port/_optimized/wirestate.c:251:2 and is reported on FreeBSD's Bugzilla [2].

The patch tries to solve the problem by setting the value of NULL to 0 for the argument tp_print. This seems to work as expected, hopefully without regressions.

[1] https://portsfallout.com/fallout?port=databases%2Fpy-postgresql&maintainer=&env=main-amd64-default&category=&flavor=
[2] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=271165

@jwp jwp merged commit 1cd1b44 into python-postgres:master May 2, 2023
@jwp
Copy link
Contributor

jwp commented May 2, 2023

That is indeed the fix. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants