Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setup.py: fix import error reporting for cythonize import, see #8208 #8211

Conversation

ThomasWaldmann
Copy link
Member

Looks like borg's setup.py has hidden the real cause of a cythonize ImportError.

There are basically 2 cases:

  • either there is no Cython installed, then the import fails because the module can not be found, or
  • there is some issue within Cython and the import fails due to that.

It's important not to hide the real cause, especially if we run into case 2.

case 1 is kind of expected and frequent, case 2 is rare.

@codecov-commenter
Copy link

codecov-commenter commented May 12, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 82.54%. Comparing base (45038ea) to head (8470730).
Report is 1 commits behind head on 1.2-maint.

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@              Coverage Diff              @@
##           1.2-maint    #8211      +/-   ##
=============================================
- Coverage      82.55%   82.54%   -0.01%     
=============================================
  Files             38       38              
  Lines          10838    10838              
  Branches        2079     2079              
=============================================
- Hits            8947     8946       -1     
- Misses          1340     1341       +1     
  Partials         551      551              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

…ckup#8208

Looks like borg's setup.py has hidden the real cause of a cythonize ImportError.

There are basically 2 cases:
- either there is no Cython installed, then the import fails because the module can not be found, or
- there is some issue within Cython and the import fails due to that.

It's important not to hide the real cause, especially if we run into case 2.

case 1 is kind of expected and frequent, case 2 is rare.
That "failed to map segment from shared object" error msg is not
very helpful. Add a hint that the filesystem needs to be +exec
(== not noexec mounted, like it might be the case for /tmp on
some systems).
@ThomasWaldmann ThomasWaldmann force-pushed the fix-cythonize-import-error-reporting-1.2 branch from 2ae58dd to 8470730 Compare May 12, 2024 14:48
@ThomasWaldmann ThomasWaldmann merged commit 2574abb into borgbackup:1.2-maint May 12, 2024
11 checks passed
@ThomasWaldmann ThomasWaldmann deleted the fix-cythonize-import-error-reporting-1.2 branch May 12, 2024 16:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants