summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTW <tw@waldmann-edv.de>2024-05-12 18:41:14 +0200
committerGitHub <noreply@github.com>2024-05-12 18:41:14 +0200
commit2574abb2cd01c778ce3996206fbc0b06fe01edbd (patch)
treec54809799effa48539fa357337fc21a59baeef1a
parent634ba8c244344ab2c44ef7567c1ab3f5b4336b83 (diff)
parent84707307f06d54d5574c71ed94a42bb02d9d1ee6 (diff)
Merge pull request #8211 from ThomasWaldmann/fix-cythonize-import-error-reporting-1.2
setup.py: fix import error reporting for cythonize import, see #8208
-rw-r--r--setup.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/setup.py b/setup.py
index dee8b0caa..f2da8f8a9 100644
--- a/setup.py
+++ b/setup.py
@@ -16,8 +16,13 @@ from setuptools.command.sdist import sdist
try:
from Cython.Build import cythonize
-except ImportError:
+ cythonize_import_error_msg = None
+except ImportError as exc:
+ # either there is no Cython installed or there is some issue with it.
cythonize = None
+ cythonize_import_error_msg = "ImportError: " + str(exc)
+ if "failed to map segment from shared object" in cythonize_import_error_msg:
+ cythonize_import_error_msg += " Check if the borg build uses a +exec filesystem."
sys.path += [os.path.dirname(__file__)]
import setup_checksums
@@ -134,7 +139,9 @@ else:
cython_c_files = [fn.replace('.pyx', '.c') for fn in cython_sources]
if not on_rtd and not all(os.path.exists(path) for path in cython_c_files):
- raise ImportError('The GIT version of Borg needs Cython. Install Cython or use a released version.')
+ raise ImportError("The GIT version of Borg needs a working Cython. " +
+ "Install or fix Cython or use a released borg version. " +
+ "Importing cythonize failed with: " + cythonize_import_error_msg)
def rm(file):