Skip to content

Fix build with newer compilers on FreeBSD #125

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

Merged
merged 2 commits into from
May 2, 2023

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