Opened 7 years ago

Closed 7 years ago

#13669 closed defect (fixed)

sage -gdb ImportError

Reported by: vbraun Owned by: leif
Priority: major Milestone: sage-5.6
Component: scripts Keywords:
Cc: jdemeyer Merged in: sage-5.6.beta2
Authors: Volker Braun Reviewers: Simon King
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by vbraun)

I get the following with sage-5.4.rc2:

[patchbot@volker-desktop sage-5.4.rc2]$ ./sage -gdb
----------------------------------------------------------------------
| Sage Version 5.4.rc2, Release Date: 2012-10-18                     |
| Type "notebook()" for the browser-based notebook interface.        |
| Type "help()" for help.                                            |
----------------------------------------------------------------------
**********************************************************************
*                                                                    *
* Warning: this is a prerelease version, and it may be unstable.     *
*                                                                    *
**********************************************************************
/mnt/storage2TB/patchbot/Sage/sage-5.4.rc2/local/bin/sage-ipython
GNU gdb (GDB) Fedora (7.4.50.20120120-52.fc17)
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /mnt/storage2TB/patchbot/Sage/sage-5.4.rc2/local/bin/python...done.
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Python 2.7.3 (default, Oct 30 2012, 10:13:41) 
[GCC 4.7.2 20120921 (Red Hat 4.7.2-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)

/mnt/storage2TB/patchbot/Sage/sage-5.4.rc2/local/lib/python2.7/site-packages/IPython/ipmaker.pyc in force_import(modname, force_reload)
     61         reload(sys.modules[modname])
     62     else:
---> 63         __import__(modname)
     64         
     65 

ImportError: No module named ipy_profile_sage
Error importing ipy_profile_sage - perhaps you should run %upgrade?
WARNING: Loading of ipy_profile_sage failed.

sage: 

Apply

Attachments (2)

trac_13669_bin_remove_sage-gdb.patch (532 bytes) - added by vbraun 7 years ago.
Initial patch
trac_13669_fix_sage_gdb.patch (555 bytes) - added by vbraun 7 years ago.
Updated patch

Download all attachments as: .zip

Change History (17)

comment:1 Changed 7 years ago by vbraun

  • Description modified (diff)

Changed 7 years ago by vbraun

Initial patch

comment:2 Changed 7 years ago by vbraun

  • Cc jdemeyer added
  • Description modified (diff)
  • Status changed from new to needs_review

The patch rewires sage -gdb to use local/bin/sage-ipython, so the behavior will match the standard sage behavior more closely.

comment:3 Changed 7 years ago by r.gaia.cs

The Patch Buildbot can't apply the patchs:

hg qimport http://trac.sagemath.org/sage_trac/raw-attachment/ticket/13669/trac_13669_fix_sage_gdb.patch
adding trac_13669_fix_sage_gdb.patch to series file
hg qpush
applying trac_13669_fix_sage_gdb.patch
unable to find 'spkg/bin/sage' for patching
1 out of 1 hunks FAILED -- saving rejects to file spkg/bin/sage.rej

As say in http://wiki.sagemath.org/buildbot,

Only the devel repository has branches, so the buildbot is unable to apply and try out patches to extcode/scripts/etc.

comment:4 Changed 7 years ago by SimonKing

What should be done to review the patches?

From looking at them, they seem good to me, but I am no expert for gdb. And I can confirm that "sage -gdb" now starts without error, in the sense of "I was able to do some non-trivial computation in an interactive session and quit Sage without gdb complaining".

But is that enough to constitute a positive review?

comment:5 Changed 7 years ago by vbraun

I don't think there is anything to review, nor does this have anything to do with gdb really. Its just about starting up Python in the same way with or without gdb. The old sage-gdb script was very hackish.

comment:6 Changed 7 years ago by SimonKing

./sage -t -gdb devel/sage/sage/rings/polynomial/multi_polynomial_ideal.py works as well.

Slight complaint: ./sage -gdb -t devel/sage/sage/rings/polynomial/multi_polynomial_ideal.py does not work.

Would it be possible to make the options -gdb and -t commute?

comment:7 Changed 7 years ago by vbraun

The option parsing in general should be overhauled and probably based on the argparse Python module. Right now its a pain to extend the way options work.

comment:8 Changed 7 years ago by ppurka

See #21

comment:9 Changed 7 years ago by SimonKing

So, here's your chance to fix a two-digit ticket...

comment:10 Changed 7 years ago by vbraun

Q: How many Sage contributors does it take to change a light bulb?

A: While looking at the broken light bulb we noticed some paint peeling on the wall, so we should probably re-do the foundation of the house first.

comment:11 Changed 7 years ago by SimonKing

The patches, when chosing to the right repositories, cleanly apply, and sage -gdb does start fine.

I'd say this is enough for a positive review.

comment:12 Changed 7 years ago by SimonKing

  • Reviewers set to Simon King
  • Status changed from needs_review to positive_review

comment:13 Changed 7 years ago by jdemeyer

  • Status changed from positive_review to needs_work

Please use proper quoting:

gdb -x "$SAGE_ROOT/local/bin/sage-gdb-commands" -args python "$SAGE_ROOT/local/bin/sage-ipython" "$@" -i

Changed 7 years ago by vbraun

Updated patch

comment:14 Changed 7 years ago by vbraun

  • Status changed from needs_work to positive_review

Done

comment:15 Changed 7 years ago by jdemeyer

  • Merged in set to sage-5.6.beta2
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.