Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1889722 - pycairo fails to build with Python 3.10: undefined symbol: PyObject_AsWriteBuffer
Summary: pycairo fails to build with Python 3.10: undefined symbol: PyObject_AsWriteBu...
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: pycairo
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Kalev Lember
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1493325
Blocks: PYTHON3.10
TreeView+ depends on / blocked
 
Reported: 2020-10-20 13:05 UTC by Tomáš Hrnčiar
Modified: 2020-11-05 09:46 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-05 09:46:40 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2020-10-20 13:05:06 UTC
pycairo fails to build with Python 3.10.0a1.

This report is automated and not very verbose, but we'll try to get back here with details.

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/01713332-pycairo/

For all our attempts to build pycairo with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/pycairo/

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.10:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

As of Python3.10 PyObject_AsWriteBuffer will be removed see: https://docs.python.org/3.10/whatsnew/3.10.html#id4

Traceback (most recent call last):
  File "/builddir/build/BUILD/pycairo-1.18.2/setup.py", line 601, in <module>
    main()
  File "/builddir/build/BUILD/pycairo-1.18.2/setup.py", line 564, in main
    setup(
  File "/usr/lib/python3.10/site-packages/setuptools/__init__.py", line 153, in setup
    return distutils.core.setup(**attrs)
  File "/usr/lib64/python3.10/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/lib64/python3.10/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/lib64/python3.10/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/builddir/build/BUILD/pycairo-1.18.2/setup.py", line 259, in run
    cmd.run()
  File "/builddir/build/BUILD/pycairo-1.18.2/setup.py", line 193, in run
    import cairo
  File "/builddir/build/BUILD/pycairo-1.18.2/cairo/__init__.py", line 1, in <module>
    from ._cairo import *  # noqa: F401,F403
ImportError: /builddir/build/BUILD/pycairo-1.18.2/cairo/_cairo.cpython-310-x86_64-linux-gnu.so: undefined symbol: PyObject_AsWriteBuffer

Comment 1 Miro Hrončok 2020-10-23 08:12:57 UTC
https://docs.python.org/3.10/whatsnew/3.10.html#id4

PyObject_AsCharBuffer(), PyObject_AsReadBuffer(), PyObject_CheckReadBuffer(), and PyObject_AsWriteBuffer() are removed. Please migrate to new buffer protocol; PyObject_GetBuffer() and PyBuffer_Release().

https://bugs.python.org/issue41103

Comment 2 Kalev Lember 2020-10-23 09:04:05 UTC
Somewhat related, we're stuck on an older pycairo release right now because having to support python2.7 for gimp.

Comment 3 Miro Hrončok 2020-10-23 09:06:27 UTC
(In reply to Kalev Lember from comment #2)
> Somewhat related, we're stuck on an older pycairo release right now because
> having to support python2.7 for gimp.

Have you considered building Python 2 pycairo from a dedicated component?

Comment 4 Kalev Lember 2020-10-23 09:12:46 UTC
I think we may have to do that, yes. There's not a whole lot going on in cairo land so it's been fine so far :)

Comment 5 Kalev Lember 2020-11-05 09:46:40 UTC
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/build/1744609/ succeeded in the copr now that we updated pycairo to 1.20.0 so I think we can close this now.


Note You need to log in before you can comment on or make changes to this bug.