diff --git a/setup.py b/setup.py index 253a050a1..edbccaefc 100644 --- a/setup.py +++ b/setup.py @@ -43,8 +43,10 @@ # if you can't satisfy the above requirement, these are versions that might # also work ok, IF you make sure to use the COMPILED version of msgpack-python, # NOT the PURE PYTHON fallback implementation: ==0.5.1, ==0.5.4 - # using any other version is not supported by borg development, feel free to - # do it on your own risk (and after own testing). + # + # Please note: + # using any other version is not supported by borg development and + # any feedback related to issues caused by this will be ignored. ] # note for package maintainers: if you package borgbackup for distribution, diff --git a/src/borg/archiver.py b/src/borg/archiver.py index 58ba05691..d598b4447 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -57,7 +57,7 @@ from .helpers import hardlinkable from .helpers import StableDict from .helpers import check_python, check_extension_modules -from .helpers import dir_is_tagged, is_slow_msgpack, yes, sysinfo +from .helpers import dir_is_tagged, is_slow_msgpack, is_supported_msgpack, yes, sysinfo from .helpers import log_multi from .helpers import signal_handler, raising_signal_handler, SigHup, SigTerm from .helpers import ErrorIgnoringTextIOWrapper @@ -4340,6 +4340,11 @@ def run(self, args): if args.show_version: logging.getLogger('borg.output.show-version').info('borgbackup version %s' % __version__) self.prerun_checks(logger) + if not is_supported_msgpack(): + logger.error("You do not have a supported msgpack[-python] version installed. Terminating.") + logger.error("This should never happen as specific, supported versions are required by our setup.py.") + logger.error("Do not contact borgbackup support about this.") + return set_ec(EXIT_ERROR) if is_slow_msgpack(): logger.warning("Using a pure-python msgpack! This will result in lower performance.") if args.debug_profile: diff --git a/src/borg/helpers.py b/src/borg/helpers.py index ae0ba7e1e..31946919c 100644 --- a/src/borg/helpers.py +++ b/src/borg/helpers.py @@ -1290,6 +1290,12 @@ def is_slow_msgpack(): return msgpack.Packer is msgpack.fallback.Packer +def is_supported_msgpack(): + # DO NOT CHANGE OR REMOVE! See also requirements and comments in setup.py. + return (0, 4, 6) <= msgpack.version <= (0, 5, 6) and \ + msgpack.version not in [(0, 5, 0), (0, 5, 2), (0, 5, 3), (0, 5, 5)] + + FALSISH = ('No', 'NO', 'no', 'N', 'n', '0', ) TRUISH = ('Yes', 'YES', 'yes', 'Y', 'y', '1', ) DEFAULTISH = ('Default', 'DEFAULT', 'default', 'D', 'd', '', )