#10138: Doctest failure in trace.py with 64-bit OS X build
-----------------------+----------------------------------------------------
   Reporter:  mpatel   |       Owner:  mvngu     
       Type:  defect   |      Status:  new       
   Priority:  major    |   Milestone:  sage-4.6.1
  Component:  doctest  |    Keywords:            
     Author:           |    Upstream:  N/A       
   Reviewer:           |      Merged:            
Work_issues:           |  
-----------------------+----------------------------------------------------

Comment(by leif):

 Replying to [comment:4 mpatel]:
 > I think we seeing this now because we merged
 {{{
 #!diff
 -. $SAGE_ROOT/local/bin/sage-env   1>/dev/null 2>/dev/null
 +# TODO: Perhaps test for existence of "$SAGE_ROOT"/local/bin/sage-env
 first...
 +#       (to catch a specific simple error earlier)

 +# Do NOT redirect stderr and stdout to /dev/null,
 +# since sage-env might print important error messages:
 +. "$SAGE_ROOT"/local/bin/sage-env
 }}}
 > at #9644.

 Yep. We've noticed the odd message earlier (you also get it when you start
 '''anything''' by running `./sage ...`, i.e. even if you don't want to
 build anything.)

 Simple fix: Redirect all output to `stderr`, and don't redirect `stderr`
 to `/dev/null` when sourcing `sage-check-64` in `sage-env` (if at all).

 Note that previously one would never have seen that message, even when it
 ''was'' perhaps important.

 On the other hand, I see no reason for having it ''there'' (`sage-env`):
 {{{
 #!sh
 ...
 if [ "$SAGE64" != "yes" -a "$SAGE64" != "no" ]; then
     echo "The environment variable SAGE64 (=$SAGE64) must be either unset,
 yes or no."
     exit 1
 fi

 # In case SAGE64 has been set to yes before re-inject it into the
 environment
 # This is only done on OSX and Solaris since those are the only real multi
 lib
 # arches we support. Eventually Linux PPC on the PS3 might need to be
 added here
 source $SAGE_LOCAL/bin/sage-check-64 2> /dev/null
 export SAGE64
 ...
 }}}
 `sage-check-64`:
 {{{
 #!sh
 ...
 if [ "$SAGE64" = "yes" ]; then
     CHECKFILE="no"
     if [ `uname` = "SunOS" ]; then
         echo "Building Sage on Solaris in 64-bit mode"
         CHECKFILE="yes"
     fi
     if [ `uname` = "Darwin" ]; then
         echo "Building Sage on OS X in 64-bit mode"
         CHECKFILE="yes"
     fi
     if [ $CHECKFILE = "yes" ]; then
         if ! [ -d "$SAGE_LOCAL"/lib ]; then
             echo "Creating SAGE_LOCAL/lib since it does not exist"
             mkdir "$SAGE_LOCAL"/lib
         fi
         echo "Creating SAGE_LOCAL/lib/sage-64.txt since it does not exist"
         touch "$SAGE_LOCAL"/lib/sage-64.txt
     fi
 fi

 # Check if SAGE_LOCAL/lib/sage-64.txt exists. If it does on Solaris and
 OSX
 # force the setting of SAGE64

 if [ -a "$SAGE_LOCAL"/lib/sage-64.txt ]; then
     echo "Detected SAGE64 flag"
     if [ `uname` = "SunOS" ]; then
         echo "Building Sage on Solaris in 64-bit mode"
         SAGE64="yes"; export SAGE64
     fi
     if [ `uname` = "Darwin" ]; then
         echo "Building Sage on OS X in 64-bit mode"
         SAGE64="yes"; export SAGE64
     fi
 fi
 }}}

 So in principle, `sage-check-64` shouldn't be sourced from `sage-env`, but
 only by those scripts actually building something (and/or perhaps `sage-
 sage` if it calls such a script).

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/10138#comment:6>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.

Reply via email to