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

On Linux test /tmp exec capacity, cythonize needs it #8209

Closed
wants to merge 1 commit into from

Conversation

m33m33
Copy link

@m33m33 m33m33 commented May 12, 2024

Proposal for issue #8208

Comment on lines +32 to +43
def is_noexec(mount_point):
with open('/proc/mounts', 'r') as mounts_file:
for line in mounts_file:
fields = line.split()
if len(fields) >= 5 and fields[1] == mount_point:
options = fields[3].split(',')
if 'noexec' in options:
return True
return False

if platform.system() == 'Linux' and is_noexec('/tmp'):
print("Warning: /tmp is mounted with noexec capacity, cythonize may fail")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is problematic:

  • it is rather platform specific and might still fail on other platforms due to similar reasons
  • the temp dir could be set to something else than /tmp
  • the cython build dir could be elsewhere than /tmp and thus the warning may confuse users (it says "may", so it is correct though, but still...)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed (I just don't know any better way to do it)

@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.24%. Comparing base (caba23f) to head (9c8aede).
Report is 18 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    #8209      +/-   ##
=============================================
- Coverage      82.41%   82.24%   -0.17%     
=============================================
  Files             38       38              
  Lines          10838    10838              
  Branches        2079     2079              
=============================================
- Hits            8932     8914      -18     
- Misses          1350     1365      +15     
- Partials         556      559       +3     

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

@ThomasWaldmann
Copy link
Member

Thanks for discovering this issue and debugging it!

borg hiding the original exception message was a real bug, based on the wrong assumption that only a missing cython install can trigger that import error.

But I guess I rather won't like to have code like in this PR in setup.py (borg supports misc. Linuxes, misc. BSDs, macOS, misc. OpenSolaris dists and even more or less Windows, so having platform specific code in setup.py catching such issues would really make it much bigger and much more complicated).

So, let's rather try to have a helpful error msg, see #8210.

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

3 participants