Bug 2245885 - rdiff-backup fails to build with Python 3.13: Missing <unistd.h> declaration
Summary: rdiff-backup fails to build with Python 3.13: Missing <unistd.h> declaration
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: rdiff-backup
Version: 40
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Frank Crawford
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2023-10-24 13:21 UTC by Karolina Surma
Modified: 2025-05-16 07:46 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2025-05-16 07:46:01 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2023-10-24 13:21:11 UTC
rdiff-backup fails to build with Python 3.13.0a1.

src/_librsyncmodule.c: In function ‘_librsync_new_patchmaker’:
src/_librsyncmodule.c:407:16: error: implicit declaration of function ‘dup’ [-Werror=implicit-function-declaration]
  407 |   int dup_fd = dup(python_fd);
      |                ^~~

According to https://docs.python.org/3.13/whatsnew/3.13.html:

Python.h no longer includes the <unistd.h> standard header file.
If needed, it should now be included explicitly.
For example, it provides the functions: read(), write(), close(), isatty(), lseek(), getpid(), getcwd(), sysconf() and getpagesize().
As a consequence, _POSIX_SEMAPHORES and _POSIX_THREADS macros are no longer defined by Python.h.
The HAVE_UNISTD_H and HAVE_PTHREAD_H macros defined by Python.h can be used to decide if <unistd.h> and <pthread.h> header files can be included.
(Contributed by Victor Stinner in gh-108765.)

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/06546852-rdiff-backup/

For all our attempts to build rdiff-backup with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/rdiff-backup/

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.13:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
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 Frank Crawford 2023-10-25 10:31:48 UTC
Thanks.  I'll push this upstream.  Obviously they don't currently support Python 3.13, but will be keen to ensure it is taken care of in the medium term.

Comment 2 Frank Crawford 2023-11-19 05:54:29 UTC
@ksurma I am intrigued, I looked at this today and see that the latest build in your Python 3.13 copr for rdiff-backup looks to have succeeded with no changes to the code.

Any idea why it is now working, as upstream has proposed a simple patch to fix it, that I was going to test?

Comment 3 Miro Hrončok 2023-11-19 07:32:25 UTC
Sorry for the confusion. We have updated Python to a git snapshot and the removal of the header include was reverted: https://github.com/python/cpython/pull/112046


Adding the include upstream is still the right thing to do. This might still be removed form a future Python release: https://github.com/python/cpython/pull/112046#issuecomment-1812561214

Comment 4 Frank Crawford 2023-11-19 08:15:12 UTC
Miro, not a problem, this happens with pre-release software.

Comment 5 Aoife Moloney 2024-02-15 23:01:35 UTC
This bug appears to have been reported against 'rawhide' during the Fedora Linux 40 development cycle.
Changing version to 40.

Comment 6 Aoife Moloney 2025-04-25 10:09:20 UTC
This message is a reminder that Fedora Linux 40 is nearing its end of life.
Fedora will stop maintaining and issuing updates for Fedora Linux 40 on 2025-05-13.
It is Fedora's policy to close all bug reports from releases that are no longer
maintained. At that time this bug will be closed as EOL if it remains open with a
'version' of '40'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, change the 'version' 
to a later Fedora Linux version. Note that the version field may be hidden.
Click the "Show advanced fields" button if you do not see it.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora Linux 40 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora Linux, you are encouraged to change the 'version' to a later version
prior to this bug being closed.

Comment 7 Aoife Moloney 2025-05-16 07:46:01 UTC
Fedora Linux 40 entered end-of-life (EOL) status on 2025-05-13.

Fedora Linux 40 is no longer maintained, which means that it
will not receive any further security or bug fix updates. As a result we
are closing this bug.

If you can reproduce this bug against a currently maintained version of Fedora Linux
please feel free to reopen this bug against that version. Note that the version
field may be hidden. Click the "Show advanced fields" button if you do not see
the version field.

If you are unable to reopen this bug, please file a new report against an
active release.

Thank you for reporting this bug and we are sorry it could not be fixed.


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