-
-
Notifications
You must be signed in to change notification settings - Fork 729
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
Conversation
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") |
There was a problem hiding this comment.
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...)
There was a problem hiding this comment.
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 ReportAll modified and coverable lines are covered by tests ✅
❗ 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. |
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. |
Proposal for issue #8208