-
-
Notifications
You must be signed in to change notification settings - Fork 526
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
runsnake command broken #14414
Comments
comment:1
Thanks for investigating this. Please someone go ahead and make a patch! Cheers, |
comment:3
Attachment: trac-14414.patch.gz Here is a patch, just as suggested. |
comment:4
--PING-- I just ran into this again. Can someone review this? |
Commit: |
Author: Frederic Chapoton |
Branch: public/ticket/14414 |
New commits:
|
comment:6
For me runsnake runs with and without the patch, so I am probably not the right reviewer. But I did convert the patch to a git branch in order to play with it. |
Changed author from Frederic Chapoton to Frédéric Chapoton |
comment:9
I can't get runsnake to work either with or without this patch.
No window appears in reasonable time. Is this any related? |
comment:10
Replying to @darijgr:
Is perhaps the version of your SquareMap mismatched with runsnake? When I installed |
comment:11
Thanks for the instructions! I fear this will disappoint you, but I can now run the snake both with and without this branch... |
comment:12
Replying to @darijgr:
:-) That means that your native python An alternative is to try and figure out how to install runsnake for sage's python (i.e., make an spkg out of it) but that seems like a hopelessly complicated solution relative to relying on system-provided runsnake. That said, fedora still only offers python-SquareMap-1.0.1, which is insufficient for the runsnake they offer. But at least the beast that is wxPython is available on the system Python by default ... |
comment:15
Replying to @nbruin:
I would appreciate to have that alternative. I tried (system-wide)
So, |
comment:16
Replying to @simon-king-jena:
If you google "suse runsnake" you'll get RPM hits, so at least third parties have packaged it for opensuse. I wouldn't go and install random rpms from the web, but for instance this page lists the requirements of the rpm. With a bit of luck THOSE can be satisfied by yast (the main one probably being python-wxWidgets) so that from that point your easily installed runsnake might work. Packaging a runsnake for sage's python would involve recompiling sage's python with wx support. That sounds painful. |
comment:17
Replying to @nbruin:
Thank you! |
comment:18
Replying to @simon-king-jena:
"Missing bit" in the sense of "runsnake can be installed with easy_install, even though it is not known to yast". |
comment:20
What's the reason anyway that the system Python is used? Why not just use Sage's Python, like every other optional package? |
comment:21
In any case, the commands |
comment:22
I just tried to install runsnake in my Sage Python and it went flawlessly. For
For runsnake, I used
(all this in a Sage shell of course) Perhaps it used to be more complicated or it is highly system-dependent, but I don't see the problem... |
comment:23
Replying to @jdemeyer:
If failed for me in the configuration process:
Runsnake as packaged by Fedora works well for me (apart from the fact that So, installing and building runsnake in the sage python seems a convenient solution for some people, but the building requirements are so heavy (the wxPython source tarball is 58Mb, and it requires all kinds of bells and whistles to be present on the host system that are not otherwise required for sage) that supporting a system runsnake should definitely be an option (and it's not hard to do). The last couple of times I've just resorted to saving the profile data using "%prun -D <command" and opening it with the system runsnake afterwards (the pathnames allow the system runsnake to display all relevant source, so it doesn't need to run in the same python as where the profile comes from). So something along these lines would probably give the best of both worlds:
This is assuming that the runsnake script itself addresses the python it wants by full name, which installed scripts usually do. We definitely need to reset the PYTHON variables, since those will be referring to sage-specific python modules, which may be incompatible with the system python. And we also do not want the sage libraries get in the way. optional: catch if running the command led to an error condition and then print some message what the possible avenues are for getting runsnake installed. |
comment:24
I like your proposal from the last comment, but some comments: You never need And like I said before, use Instead of
|
comment:25
To elaborate on
But really, the |
comment:26
Replying to @jdemeyer:
Yes, I know that as a general rule, pythonistas seem to promote it, but one shouldn't apply this blindly. The problem is that checking that it's hard to write and "except" class that guarantees it only catches the particular OSError resulting from the relevant file not existing. A priori, there may be loads of reasons why os.system might return an OSError, and I only want to try something else if I think it's good to be aware that |
comment:27
Replying to @nbruin:
You mean I would say it's highly unlikely that
I completely disagree with this, see previous comment. |
comment:28
Replying to @jdemeyer:
OK, executable lookup indeed ignores non-executable files that occur earlier in the path, so we should too. Strictly speaking the check should be
to emulate normal PATH behaviour (where lookup skips directories with the relevant name). Also, there's a comment on |
comment:29
Replying to @nbruin:
That's true, but I would think it's unlikely that people run Sage as suid. But it's certainly odd that there is no system call to check whether a file is executable for the current user. |
This comment has been minimized.
This comment has been minimized.
comment:30
See also #17735 that was primarily about docs, checks and preparsing for |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:32
OK, the current branch implements the proposed strategy edit: D'oh. sage wasn't waiting for the runsnake process to complete before, and there's no reason to change that. Should be fixed now (just call Popen rather than call) |
Dependencies: #9386 |
Changed author from Frédéric Chapoton to Nils Bruin |
Branch pushed to git repo; I updated commit sha1. This was a forced push. New commits:
|
comment:34
does not apply |
#11287 introduced a
runsnake
command that tries to executerunsnake
using the system python. However, it does so withoutsage-native-execute
and without clearingPYTHONHOME
andPYTHONPATH
, so it has very little chance of ever working. It already comes a little closer by doingin
sage/misc/dev_tools.py
(that makes the commandrunsnake
work on my computer).You can't really expect the system python to work properly when the environment variables point to libraries for other python installs. See also #9386, #10286, #17735.
Depends on #9386
CC: @sagetrac-sage-combinat @saliola @anneschilling @novoselt @nathanncohen
Component: performance
Author: Nils Bruin
Branch/Commit: public/ticket/14414 @
8a8a7ce
Issue created by migration from https://trac.sagemath.org/ticket/14414
The text was updated successfully, but these errors were encountered: