Bug 2247013 - borgbackup fails to build with Python 3.13: Missing <unistd.h> declaration
Summary: borgbackup fails to build with Python 3.13: Missing <unistd.h> declaration
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: borgbackup
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Felix Schwarz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2023-10-30 11:59 UTC by Karolina Surma
Modified: 2023-11-05 15:53 UTC (History)
4 users (show)

Fixed In Version: 1.2.6-3
Clone Of:
Environment:
Last Closed: 2023-11-05 15:53:25 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Karolina Surma 2023-10-30 11:59:00 UTC
borgbackup fails to build with Python 3.13.0a1.

  src/borg/_chunker.c: In function ‘chunker_fill’:
  src/borg/_chunker.c:175:13: error: implicit declaration of function ‘read’; did you mean ‘fread’? [-Werror=implicit-function-declaration]
    175 |         n = read(c->fh, c->data + c->position + c->remaining, n);
        |             ^~~~
        |             fread
  src/borg/_chunker.c:195:24: error: implicit declaration of function ‘getpagesize’ [-Werror=implicit-function-declaration]
    195 |             pagemask = getpagesize() - 1;
        |                        ^~~~~~~~~~~

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.)


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

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

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

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 Felix Schwarz 2023-11-05 11:27:59 UTC
I added a patch and rebuilt the package in rawhide. I guess you will rebuild the package automatically in copr. I'd appreciate any feedback on the rebuild status.

Comment 2 Miro Hrončok 2023-11-05 15:53:25 UTC
Thanks. It triggered automatically and was successful. https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/borgbackup/


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