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
Bug 1890880 - breezy fails to build with Python 3.10: Py_REFCNT= needs to be replaced with Py_SET_REFCNT
Summary: breezy fails to build with Python 3.10: Py_REFCNT= needs to be replaced with ...
Alias: None
Product: Fedora
Classification: Fedora
Component: breezy
Version: rawhide
Hardware: Unspecified
OS: Unspecified
Target Milestone: ---
Assignee: Ondřej Pohořelský
QA Contact: Fedora Extras Quality Assurance
Depends On:
Blocks: PYTHON3.10
TreeView+ depends on / blocked
Reported: 2020-10-23 07:54 UTC by Tomáš Hrnčiar
Modified: 2020-11-24 09:45 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Last Closed: 2020-11-24 09:45:55 UTC
Type: Bug

Attachments (Terms of Use)

Description Tomáš Hrnčiar 2020-10-23 07:54:04 UTC
breezy fails to build with Python 3.10.0a1.

breezy/_static_tuple_c.c: In function ‘StaticTuple_Intern’:
breezy/_static_tuple_c.c:100:21: error: lvalue required as left operand of assignment
  100 |     Py_REFCNT(self) -= 1;
      |                     ^~
breezy/_static_tuple_c.c: In function ‘StaticTuple_dealloc’:
breezy/_static_tuple_c.c:119:25: error: lvalue required as left operand of assignment
  119 |         Py_REFCNT(self) = 2;
      |                         ^

  Cannot build extension "breezy._static_tuple_c".
  Use "build_ext --allow-python-fallback" to use slower python implementations instead.

error: command '/usr/bin/gcc' failed with exit code 1

For the build logs, see:

For all our attempts to build breezy with Python 3.10, see:

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:

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.

Comment 1 Miro Hrončok 2020-10-23 08:03:42 UTC

Since Py_REFCNT() is changed to the inline static function, Py_REFCNT(obj) = new_refcnt must be replaced with Py_SET_REFCNT(obj, new_refcnt): see Py_SET_REFCNT() (available since Python 3.9). For backward compatibility, this macro can be used:

#if PY_VERSION_HEX < 0x030900A4
#  define Py_SET_REFCNT(obj, refcnt) ((Py_REFCNT(obj) = (refcnt)), (void)0)

Comment 2 Miro Hrončok 2020-10-26 11:49:12 UTC
For the record, this is **not** fixed in breezy 3.1.0:

[breezy (3.1.0)]$ rg Py_REFCNT breezy-3.1.0
100:    Py_REFCNT(self) -= 1;
119:        Py_REFCNT(self) = 2;

Comment 3 Victor Stinner 2020-11-19 11:05:35 UTC
I reported the issue to breezy upstream:

Comment 4 Victor Stinner 2020-11-19 20:14:34 UTC
My fix got merged into the 3.1 branch:

Comment 5 Tomáš Hrnčiar 2020-11-20 07:37:05 UTC
Thank you for the patch Victor. I can confirm that breezy builds alright in our Copr:

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