git: f10136accbd2 - main - archivers/py-borgbackup: use spawn for multiprocessing

From: Matthias Andree <mandree_at_FreeBSD.org>
Date: Sat, 01 Nov 2025 23:30:29 UTC
The branch main has been updated by mandree:

URL: https://cgit.FreeBSD.org/ports/commit/?id=f10136accbd217be1ae995c8fc41149406bce37e

commit f10136accbd217be1ae995c8fc41149406bce37e
Author:     Matthias Andree <mandree@FreeBSD.org>
AuthorDate: 2025-11-01 23:21:31 +0000
Commit:     Matthias Andree <mandree@FreeBSD.org>
CommitDate: 2025-11-01 23:29:59 +0000

    archivers/py-borgbackup: use spawn for multiprocessing
    
    borgbackup's setup.py fails with Python 3.14's new forkserver default
    (borgbackup predates the Python 3.14 release)
    
    Note "make test" is currently unavailable on Python 3.13 and 3.14
    becuase it expects py-sphinx, but the sphinx 5 version currently in
    ports uses imghr, which was removed in 3.13.
---
 archivers/py-borgbackup/files/patch-setup.py | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/archivers/py-borgbackup/files/patch-setup.py b/archivers/py-borgbackup/files/patch-setup.py
new file mode 100644
index 000000000000..4d44c2d92547
--- /dev/null
+++ b/archivers/py-borgbackup/files/patch-setup.py
@@ -0,0 +1,19 @@
+--- setup.py.orig	2025-04-18 19:16:24 UTC
++++ setup.py
+@@ -7,6 +7,8 @@ try:
+ 
+ try:
+     import multiprocessing
++    # Python 3.14 uses forkserver, which fails. Force spawn.
++    multiprocessing.set_start_method('spawn', force=True)
+ except ImportError:
+     multiprocessing = None
+ 
+@@ -233,5 +235,5 @@ def long_desc_from_readme():
+         long_description = re.compile(r"^\.\. highlight:: \w+$", re.M).sub("", long_description)
+         return long_description
+ 
+-
+-setup(cmdclass=cmdclass, ext_modules=ext_modules, long_description=long_desc_from_readme())
++if __name__ == '__main__':
++    setup(cmdclass=cmdclass, ext_modules=ext_modules, long_description=long_desc_from_readme())