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

Compiling error with Python 3.7.0-rc1 #1884

Closed
totaam opened this issue Jun 23, 2018 · 4 comments
Closed

Compiling error with Python 3.7.0-rc1 #1884

totaam opened this issue Jun 23, 2018 · 4 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Jun 23, 2018

Issue migrated from trac ticket # 1884

component: packaging | priority: major | resolution: fixed | keywords: fedora, python-3.7.0

2018-06-23 11:59:02: sagitter created the issue


Hi all.

On Fedora 29 (devel branch), Python-3.7.0-rc1,
GCC-8.1.1.

Recompiling xpra-2.3.1 i'm obtaining this error:

gcc -pthread -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -O2 -g -pipe -Wall
-Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
-D_GNU_SOURCE -fPIC -fwrapv -O2 -g -pipe -Wall -Werror=format-security
-Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions
-fstack-protector-strong -grecord-gcc-switches
-specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
-fPIC -Ixpra/buffers -I/usr/include/python3.7m -c xpra/buffers/buffers.c
-o build/temp.linux-x86_64-3.7/xpra/buffers/buffers.o -O3 -Wall -Werror
-fPIC -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2
-Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong
-grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1
-specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic
-fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
xpra/buffers/buffers.c: In function ‘_object_as_buffer’:
xpra/buffers/buffers.c:43:5: error: ‘PyObject_AsReadBuffer’ is
deprecated [-Werror=deprecated-declarations]
     return PyObject_AsReadBuffer(obj, buffer, buffer_len);
     ^~~~~~
In file included from /usr/include/python3.7m/Python.h:128,
                 from xpra/buffers/buffers.c:8:
/usr/include/python3.7m/abstract.h:489:17: note: declared here
 PyAPI_FUNC(int) PyObject_AsReadBuffer(PyObject *obj,
                 ^~~~~~~~~~~~~~~~~~~~~
xpra/buffers/buffers.c: In function ‘_object_as_write_buffer’:
xpra/buffers/buffers.c:56:5: error: ‘PyObject_AsWriteBuffer’ is
deprecated [-Werror=deprecated-declarations]
     return PyObject_AsWriteBuffer(obj, buffer, buffer_len);
     ^~~~~~
In file included from /usr/include/python3.7m/Python.h:128,
                 from xpra/buffers/buffers.c:8:
/usr/include/python3.7m/abstract.h:500:17: note: declared here
 PyAPI_FUNC(int) PyObject_AsWriteBuffer(PyObject *obj,
                 ^~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
error: command 'gcc' failed with exit status 1

Can you fix it please?
Full build log:
https://koji.fedoraproject.org/koji/getfile?taskID=27753977&volume=DEFAULT&name=build.log

@totaam
Copy link
Collaborator Author

totaam commented Jun 23, 2018

FYI: building with --without-strict should workaround this problem.

@totaam
Copy link
Collaborator Author

totaam commented Jun 23, 2018

2018-06-23 14:13:16: sagitter commented


FYI: building with --without-strict should workaround this problem.

Workaround confirmed.

@totaam
Copy link
Collaborator Author

totaam commented Jun 25, 2018

No rush to fix this, it might be easier to replace this code when we remove python2 support.

Here's what python 3.6 does to provide this function:

int PyObject_AsReadBuffer(PyObject *obj,
                          const void **buffer,
                          Py_ssize_t *buffer_len)
{
    Py_buffer view;

    if (obj ## NULL || buffer NULL || buffer_len == NULL) {
        null_error();
        return -1;
    }
    if (PyObject_GetBuffer(obj, &view, PyBUF_SIMPLE) != 0)
        return -1;

    -buffer = view.buf;
    -buffer_len = view.len;
    PyBuffer_Release(&view);
    return 0;
}

@totaam
Copy link
Collaborator Author

totaam commented Jul 10, 2018

The deprecation warnings and silenced with python 3.7 or later in r19908.

This will do for now, will follow up in #1878

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

No branches or pull requests

1 participant