Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] rdiff-backup is broken (again) (Read 1212 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

[SOLVED] rdiff-backup is broken (again)

Apparently, the last Python update killed rdiff-backup:
Code: [Select]
# rdiff-backup
Traceback (most recent call last):
  File "/usr/bin/rdiff-backup", line 19, in <module>
    import rdiff_backup.Main
ModuleNotFoundError: No module named 'rdiff_backup'
Seems like the package has to be updated?

Re: rdiff-backup is broken

Reply #1
This is from Omniverse … can I get the respective PKGBUILD file somewhere so that I can fix it manually for now?

I could build rdiff-backup from the AUR, but this is v2.2.5 – even Gentoo uses only v2.0.5 in the stable branch …

Re: rdiff-backup is broken

Reply #2
Okay, the PKGBUILD can also be used to build v2.0.5, but this requires some changes.

Apparently, rdiff-backup 2.0.5 can't be built with Python 3.11. Gentoo applies the following patch to make it work:
Code: [Select]
From 5e5cc54b5a633d3c6c0469283b2f26dbdde7908f Mon Sep 17 00:00:00 2001
From: Frank Crawford <[email protected]>
Date: Sun, 2 Jan 2022 18:44:57 +1100
Subject: [PATCH] Added patch for Python3.11 as per bpo-39573.

---
 src/_librsyncmodule.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/src/_librsyncmodule.c b/src/_librsyncmodule.c
index a46567fc4..158104d2e 100644
--- a/src/_librsyncmodule.c
+++ b/src/_librsyncmodule.c
@@ -25,6 +25,16 @@
 #include <librsync.h>
 #define RSM_JOB_BLOCKSIZE 65536
 
+/* ----------------------------------------------------------------------- *
+ * Update for Python 3.11 - Contributed by Victor Stinner in bpo-39573.
+ * Compatibility macro for older Python versions.
+ * ----------------------------------------------------------------------- */
+#if PY_VERSION_HEX < 0x030900A4 && !defined(Py_SET_TYPE)
+static inline void _Py_SET_TYPE(PyObject *ob, PyTypeObject *type)
+{ ob->ob_type = type; }
+#define Py_SET_TYPE(ob, type) _Py_SET_TYPE((PyObject*)(ob), type)
+#endif
+
 static PyObject *librsyncError;
 
 /* Sets python error string from result */
@@ -540,8 +550,9 @@ PyMODINIT_FUNC PyInit__librsync(void)
 {
   PyObject *m, *d;
 
-  Py_TYPE(&_librsync_SigMakerType) = &PyType_Type;
-  Py_TYPE(&_librsync_DeltaMakerType) = &PyType_Type;
+  /* Update for Python 3.11 - bpo-39573. */
+  Py_SET_TYPE(&_librsync_SigMakerType, &PyType_Type);
+  Py_SET_TYPE(&_librsync_DeltaMakerType, &PyType_Type);
   static struct PyModuleDef librsync_def = {
             PyModuleDef_HEAD_INIT, "_librsync", "RSync Lib", -1, _librsyncMethods, };
   m = PyModule_Create(&librsync_def);
Also, I simply commented out all the tests (seems like a lot has changed here, too).

This way, I could build a working rdiff-backup 2.0.5. I hope this helps and the package will be fixed soon …

Re: rdiff-backup is broken

Reply #3
Updated package rdiff-backup-2.2.5 is now available in the Omniverse repository.
Please test.

artist

Re: rdiff-backup is broken

Reply #4
Seems to work. Thanks for the update!

Re: rdiff-backup is broken

Reply #5
Updated package rdiff-backup-2.2.5 is now available in the Omniverse repository.
Please test.

artist
Hi again ;-)

The package works, but it seems to contain all kind of files which should not be packaged.

E.g. now, rdiff-backup collides with python-docutils:
Code: [Select]
# pacman -S python-docutils
resolving dependencies...
looking for conflicting packages...

Packages (1) python-docutils-1:0.20.1-1

Total Installed Size:  5.72 MiB

:: Proceed with installation? [Y/n]
(1/1) checking keys in keyring                               [################################] 100%
(1/1) checking package integrity                             [################################] 100%
(1/1) loading package files                                  [################################] 100%
(1/1) checking for file conflicts                            [################################] 100%
error: failed to commit transaction (conflicting files)
python-docutils: /usr/bin/docutils exists in filesystem (owned by rdiff-backup)
python-docutils: /usr/bin/rst2html.py exists in filesystem (owned by rdiff-backup)
python-docutils: /usr/bin/rst2html4.py exists in filesystem (owned by rdiff-backup)
python-docutils: /usr/bin/rst2html5.py exists in filesystem (owned by rdiff-backup)
python-docutils: /usr/bin/rst2latex.py exists in filesystem (owned by rdiff-backup)
python-docutils: /usr/bin/rst2man.py exists in filesystem (owned by rdiff-backup)
python-docutils: /usr/bin/rst2odt.py exists in filesystem (owned by rdiff-backup)
python-docutils: /usr/bin/rst2odt_prepstyles.py exists in filesystem (owned by rdiff-backup)
python-docutils: /usr/bin/rst2pseudoxml.py exists in filesystem (owned by rdiff-backup)
python-docutils: /usr/bin/rst2s5.py exists in filesystem (owned by rdiff-backup)
python-docutils: /usr/bin/rst2xetex.py exists in filesystem (owned by rdiff-backup)
python-docutils: /usr/bin/rst2xml.py exists in filesystem (owned by rdiff-backup)
python-docutils: /usr/bin/rstpep2html.py exists in filesystem (owned by rdiff-backup)
...
Interestingly, the package size also grew a bit: rdiff-backup-2.0.5-3-x86_64.pkg.tar.zst is 338K, and rdiff-backup-2.2.5-1-x86_64.pkg.tar.zst is 9,7M …

Re: rdiff-backup is broken (again)

Reply #6
The AUR package was a mess in my opinion, so I created this one from scratch. That's why I asked to test. ;-)

I'll check on how to omit the files that should not be included in the package.

artist

Re: rdiff-backup is broken (again)

Reply #7
Yeah of course! Thanks for working on this :-)

Re: rdiff-backup is broken (again)

Reply #8
rdiff-backup-2.2.5-2 is now available in the omniverse repo.

The only test I did were the install and the simplest backup (I never used it myself before).

Pls test.

artist

Re: rdiff-backup is broken (again)

Reply #9
Thanks for the update! Pacman complained about the signature being invalid, but a refresh fixed that.

Now, rdiff-backup doesn't collide anymore with any package installed on my systems. Also works, at least there were no problems with my backup scripts.

Seems I'm lucky this time and you fixed it! Thanks a lot :-)

You should really use rdiff-backup – it's by far the best incremental backup tool out there. I've been using it in production for years now. This is really an outstanding backup solution.

Re: rdiff-backup is broken (again)

Reply #10
Thx for the advice and positive feedback  :)

artist