#13341: GAP's spkg-install fails on recent Cygwin
-------------------------------------+--------------------------------------
       Reporter:  jpflori            |         Owner:  tbd         
           Type:  defect             |        Status:  needs_review
       Priority:  major              |     Milestone:  sage-5.3    
      Component:  cygwin             |    Resolution:              
       Keywords:  cygwin gap spkg    |   Work issues:              
Report Upstream:  N/A                |     Reviewers:              
        Authors:  Jean-Pierre Flori  |     Merged in:              
   Dependencies:                     |      Stopgaps:              
-------------------------------------+--------------------------------------

Comment (by leif):

 Rather than expressing hope, how about testing for the presence of `gap`?
 ;-)

 You could also just use `ln -sf ...` ("force"), which doesn't fail if the
 source (second parameter) already exists, i.e., with `-f` a new link is
 created regardless.  No idea how that behaves on Cygwin with "virtual"
 files; it may create a cycle (symbolic link from 'gap.exe' to itself), or
 fail in other ways, then hopefully raising an error...

 (Note that `ln -s <non-existent-1> <non-existent-2>` does '''not''' fail,
 but instead creates a "dead" symbolic link [although not sure about that
 on Cygwin, since we use `touch` to create a dummy target].  So you may
 also have to check whether the target, `gap.exe`, really exists, i.e., the
 "build" so far succeeded, here meaning `mkdir`, `cd` and `touch` worked...
 :-) )


 If you don't want to use the "force" option, you could instead do
 {{{
 #!sh
         mkdir -p bin/i686-pc-cygwin-gcc &&
         cd bin/i686-pc-cygwin-gcc &&
         touch gap.exe &&
         (test -f gap || ln -s gap.exe gap)   # Probably don't use '-x'
                                              # since 'gap.exe' is yet a
 dummy.

         if [[ $? -ne 0 ]]; then
            # *Something* really went wrong...
            ...
            exit 1
 }}}

 But perhaps it's better to at least slightly untangle the command chain:
 {{{
 #!sh
         mkdir -p bin/i686-pc-cygwin-gcc &&
         cd bin/i686-pc-cygwin-gcc &&
         touch gap.exe

         if [[ $? -ne 0 ]]; then
             # Some serious error...
             ...
             exit 1
         fi

         # We may need a link from 'gap' to 'gap.exe', since the former
 later gets
         # stripped by GAP.
         # On newer Cygwins, 'gap' is automatically "translated" to
 'gap.exe',
         # such that 'ln' (without '-f') would fail (and we don't have to
 create the
         # link on these systems anyway, since 'strip gap' there works
 without it).
         if [[ ! -f gap ]]; then
             ln -s gap.exe gap
             # May check exit status here, since the above should never
 fail.
         fi
 }}}

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13341#comment:2>
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