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
Run relocate-once.py with Sage's Python2 and with error checking #25668
Comments
comment:1
According to "j.c." on ask.sagemath.org, the solution to installing a binary with Ananconda installed is:
|
comment:2
this probably deserves the "critical" status, given the number of people trapped by the error message.. |
Changed keywords from none to Anaconda, RecursionError |
Commit: |
New commits:
|
Author: Samuel Lelièvre |
comment:6
This is catching all errors, not just a |
comment:7
And why does the if block |
comment:8
Replying to @jhpalmieri:
Exactly my thought too! The only reasonable explanation is that anaconda itself sets some |
comment:9
First, I think we should catch an error if Second, there are several problems in
That line is 61957 characters long (!), and I wonder if its length is causing problems. Certainly if I delete just that line, I no longer get the
|
comment:10
We really need a test machine where this error occurs to see what the value of |
comment:11
OK, so the problem is with |
comment:12
Replying to @jdemeyer:
You mean, there should be an error handler there? |
comment:13
By the way, I have now installed Anaconda on OS X, and it's easy enough to add or remove the bad parts in my PATH to test things. Others should feel free to do the same. |
comment:14
Is the problem just that the script is run with Python 3 instead of Python 2? |
comment:15
Replying to @jhpalmieri:
I'm just wondering who is displaying the message |
comment:16
If I run |
comment:17
Further debugging: if I put some echo statements in the |
comment:18
It looks something like the issue discussed in https://bugs.python.org/issue32758. |
comment:19
Replying to @jdemeyer:
Searching the web for [ "maximum recursion depth exceeded during compilation" ] It might indicate that the error has something to do with a call to This other result shows that the error can occur even just running |
comment:20
Replying to @slel:
Or more generally, just the Python parser. All the evidence points to Python crashing while parsing the |
comment:21
One obvious fix in Sage is to add error checking in the top-level # If this is a freshly-unpacked binary tarball then run the installer
# Note: relocate-once.py deletes itself upon successful completion
if [ -x "$SAGE_ROOT/relocate-once.py" ]; then
"$SAGE_ROOT/relocate-once.py"
fi |
comment:41
OS X – it is the only system I have easy access to. |
comment:42
shall we put this into "positive review" now ? |
comment:43
update milestone 8.3 -> 8.4 |
Reviewer: Jeroen Demeyer |
comment:45
Any progress on this? I would very much like it to get merged in 8.4, since it has been a common issue, at least on ask.sagemath.org. |
comment:47
Ping? |
comment:48
Volker, would you review this? |
comment:49
Maybe it works, but it seems a bit sketchy to use the Python in Sage to run relocate-once.py. I admit, I don't quite understand exactly what it is I think it would make more sense to modify |
comment:50
This is a rather fragile workaround, run Sage's python2 while the rpaths in the binary point to the wrong place and pray that none of those shared libraries end up being used by relocate-once. The thing that needs to be done eventually is making relocate-once python3 compatible, including not emitting very long chains of method calls. |
comment:51
A compromise would be to use the system Python 2 if we can find it (via something like Otherwise, this puts the ball in the court of the people who maintain the Sage binary distributions. I seem to have opened up sagemath/binary-pkg#16 6 months ago, but no progress yet. I don't have the time to figure out how |
comment:52
I'm fixing this at sagemath/binary-pkg#16 |
comment:53
I don't know if this has ever happened specifically with the relocate-once.py script, but I've also had problems in the past with Python 2.7 bytecode compiler crashing on extremely long expressions, particularly arithmetic expressions like In fact it was only a couple years ago I think that they fixed this to at least raise a |
comment:55
Replying to @vbraun:
Thanks! For this ticket, the only thing left to do is error-checking. Ready for review. New commits:
|
Changed reviewer from Jeroen Demeyer to Jeroen Demeyer, Volker Braun |
Changed branch from u/jhpalmieri/python2-relocate-once to |
Changed commit from |
comment:59
(Editing ticket description to reflect that the fix is not the one |
Running Sage for the first time after installing from binary under
Linux or macOS leads to running
relocate-once.py
.Before this ticket, when run by Python 3 (eg as installed by Anaconda),
it would lead to the following error.
which seems to come from Python3 choking on a very long line in
relocate-once.py
, because of the Python3 bug described asPython issue 32758.
See reports by Sage users at
Reported in "upstream" binary-pkg at binary-pkg issue 16 -- see the fix there.
After that fix, relocate-once.py can run with Python 3, and this ticket adds
error-checking after running relocate-once.py, with a meaningful error
in case of failure.
The tentative solution at one point was to make
relocate-once.py
be runwith Sage's Python2, whence the now-inaccurate ticket summary.
Upstream: Reported upstream. No feedback yet.
CC: @fchapoton @embray @jhpalmieri @saraedum @slel @vbraun
Component: distribution
Keywords: Anaconda, RecursionError
Author: John Palmieri
Branch:
abb2a89
Reviewer: Jeroen Demeyer, Volker Braun
Issue created by migration from https://trac.sagemath.org/ticket/25668
The text was updated successfully, but these errors were encountered: