Opened 7 years ago

Closed 7 years ago

#13867 closed enhancement (fixed)

Remove debugging output from Python command line

Reported by: jpflori Owned by: tbd
Priority: major Milestone: sage-5.7
Component: packages: standard Keywords: python spkg debug
Cc: burcin, vbraun, SimonKing Merged in: sage-5.7.beta4
Authors: Volker Braun Reviewers: Jean-Pierre Flori
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by vbraun)

The extra debugging output "[number of refs]" before each command line prompt breaks the pynad build. the problem is that the test used by the AX_PYTHON_DEVEL autoconf macro to check for distutils fails when Python is built with pydebug.

Also, breaks the Sage test suite.

I'm just removing this extra output. Its not that useful, really, since object counts in Sage are always pretty large and widely fluctuating with stuff like coercion running in the background. It also doesn't offer any extra info over gc.get_count().

Install http://www.stp.dias.ie/~vbraun/Sage/spkg/python-2.7.3.p5.spkg

Attachments (1)

python-p5.patch (1.6 KB) - added by vbraun 7 years ago.
diff for review only

Download all attachments as: .zip

Change History (28)

comment:1 Changed 7 years ago by vbraun

I'm thinking we should just patch Python to not print out extra crap. Otherwise we have basically no hope of running the Sage doctests, no?

comment:2 Changed 7 years ago by jpflori

Good point. And that should be even easier.

comment:3 Changed 7 years ago by jpflori

In fact I do not really agree, especially now that I've checked that the crappy additional Python output does not pertub the doctest framework (surely because its spit on stderr and not stdout).

comment:4 Changed 7 years ago by vbraun

Surely the sage pexpect interface to itself will not work. Or various checks in sage.tests.cmdline that check that stderr is empty.

comment:5 Changed 7 years ago by vbraun

  • Authors set to Volker Braun
  • Description modified (diff)
  • Keywords python added; pynac removed
  • Status changed from new to needs_review
  • Summary changed from Fix Pynac spkg so that it builds on top of a debug build of python to Remove debugging output from Python command line

I'm taking over this ticket to patch up python

comment:6 Changed 7 years ago by vbraun

  • Description modified (diff)

comment:7 Changed 7 years ago by SimonKing

Just to be on the safe side: To use this one with SAGE_DEBUG=yes on top of an existing Sage install, one needs to install this new python spkg, then (re-)install the new cython spkg from #13832, and then sage -ba, right?

comment:8 Changed 7 years ago by vbraun

to get a working Sage you also need a patch to the Sage library (will post here soon) and a fixed Singular spkg... stay tuned ;-)

comment:9 Changed 7 years ago by vbraun

Patch to the Sage library is at #13868

comment:10 follow-up: Changed 7 years ago by SimonKing

We now have an abundance of tickets needed to make SAGE_DEBUG work. Shouldn't there be a meta-ticket, listing all relevant single-purpose tickets (#13876, #13867, #13868, #13832, #13864, and what else)?

comment:11 Changed 7 years ago by vbraun

#13864 is now the meta-ticket.

comment:12 in reply to: ↑ 10 ; follow-up: Changed 7 years ago by SimonKing

Replying to SimonKing:

We now have an abundance of tickets needed to make SAGE_DEBUG work. Shouldn't there be a meta-ticket, listing all relevant single-purpose tickets (#13876, #13867, #13868, #13832, #13864, and what else)?

FWIW: I created a metaticket at #13877.

comment:13 in reply to: ↑ 12 Changed 7 years ago by SimonKing

Replying to SimonKing:

Replying to SimonKing:

We now have an abundance of tickets needed to make SAGE_DEBUG work. Shouldn't there be a meta-ticket, listing all relevant single-purpose tickets (#13876, #13867, #13868, #13832, #13864, and what else)?

FWIW: I created a metaticket at #13877.

OK, forget about that, Volker was faster with his change to #13864.

comment:14 Changed 7 years ago by jdemeyer

In spkg-install, are you sure you don't mean CFLAGS and/or CXXFLAGS instead CPPFLAGS? Because CPPFLAGS normally means "C preprocessor flags".

comment:15 Changed 7 years ago by jdemeyer

  • Dependencies set to #13864

comment:16 Changed 7 years ago by jdemeyer

  • Dependencies #13864 deleted

comment:17 follow-up: Changed 7 years ago by vbraun

The spkg-install already used CPPFLAGS before I edited it, so I stuck with it. It does get picked up on the gcc command line, fwiw.

comment:18 Changed 7 years ago by jdemeyer

  • Status changed from needs_review to needs_work

Yes, it does use CPPFLAGS for its intended purpose. The -I option is related to preprocessing and belongs in $CPPFLAGS. Flags like -g or -O0 do not.

Note that adding -I$SAGE_LOCAL/include to CPPFLAGS is actually unneeded since that path gets picked up automatically because of the $CPATH environment variable. So you might as well remove

CPPFLAGS="-I$SAGE_LOCAL/include $CPPFLAGS"
export CPPFLAGS

comment:19 in reply to: ↑ 17 Changed 7 years ago by jdemeyer

Replying to vbraun:

The spkg-install already used CPPFLAGS before I edited it

It also uses CFLAGS by the way:

export CFLAGS="$CFLAGS `testcflags.sh -fwrapv`"

comment:20 Changed 7 years ago by jpflori

I'm ok with the solution Volker proposes, we don't need that "extra" output, but I still think that Pynac should be able to deal with a vanilla Python debug build. So I'm just posting that here so that Burcin can take notice (I'll post on pynac-devel as well).

Changed 7 years ago by vbraun

diff for review only

comment:21 Changed 7 years ago by vbraun

I've removed the superfluous CPPFLAGS. Also --with-pydebug implies -O0 -g so we don't have to set it by hand.

comment:22 Changed 7 years ago by vbraun

  • Status changed from needs_work to needs_review

comment:23 Changed 7 years ago by SimonKing

I use the package successfully with SAGE_DEBUG=yes.

Some criticism: SPKG.txt contains a section "Patches", but the new patch disable_print_refs_debug.patch is not mentioned.

The content of environment variables is sometimes tested like

if ["x$SAGE_DEBUG"="xyes"]; then

if I am not mistaken, but here it is

if ["$SAGE_DEBUG"="yes"]; then

Is that a problem?

comment:24 Changed 7 years ago by vbraun

I've added a line documenting the disable_print_refs_debug.patch

The xyes thing is a historical artifact.

comment:25 Changed 7 years ago by jpflori

  • Reviewers set to Jean-Pierre Flori
  • Status changed from needs_review to positive_review

Looks good.

If you really wants me to rant, I'd say:

  • first, there is a useless line at the end of the new patch for some emacs generated tmp file.
  • or even less problematic, you could remove the historical artifacts from spkg-install while you're at it.

comment:26 Changed 7 years ago by jdemeyer

Server down :-(

comment:27 Changed 7 years ago by jdemeyer

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