Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#13341 closed defect (fixed)

GAP's spkg-install fails on recent Cygwin

Reported by: jpflori Owned by: tbd
Priority: major Milestone: sage-5.3
Component: porting: Cygwin Keywords: cygwin gap spkg
Cc: dimpase Merged in: sage-5.3.rc1
Authors: Jean-Pierre Flori, Leif Leonhardy Reviewers: Dmitrii Pasechnik
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by jdemeyer)

The ln trick to symlink gap and gap.exe which used to be needed now fails and stop the installation.

Use spkg at http://boxen.math.washington.edu/home/jdemeyer/spkg/gap-4.4.12.p8.spkg

Attachments (2)

spkg.diff (1.8 KB) - added by jpflori 7 years ago.
Spkg diff, for review only.
spkg.2.diff (2.3 KB) - added by jpflori 7 years ago.
spkg diff, for review only

Download all attachments as: .zip

Change History (16)

Changed 7 years ago by jpflori

Spkg diff, for review only.

comment:1 Changed 7 years ago by jpflori

  • Authors set to Jean-Pierre Flori
  • Description modified (diff)
  • Status changed from new to needs_review

comment:2 follow-up: Changed 7 years ago by leif

  • Summary changed from Gap spkg fails on recent Cygwin to GAP's spkg-install fails on recent Cygwin

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

        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:

        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

comment:3 in reply to: ↑ 2 Changed 7 years ago by jpflori

Replying to leif:

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

Good point, let's do something more sensible. I prefer your two second solutions. Maybe more the last one, although I'm not sure the first exit code test is really needed. But ok it does not hurt.

comment:4 Changed 7 years ago by jpflori

  • Status changed from needs_review to needs_work
  • Work issues set to use better script

comment:5 Changed 7 years ago by jpflori

  • Authors changed from Jean-Pierre Flori to Jean-Pierre Flori, Leif Leonhardy
  • Status changed from needs_work to needs_review
  • Work issues use better script deleted

Spkg updated.

Changed 7 years ago by jpflori

spkg diff, for review only

comment:6 Changed 7 years ago by jpflori

Mmm something got broken in the last spkg, please disregard it.

comment:7 Changed 7 years ago by jpflori

This should be fixed now.

Last edited 7 years ago by jpflori (previous) (diff)

comment:8 follow-up: Changed 7 years ago by jpflori

  • Cc dimpase added

Anyone reviewing this?

comment:9 in reply to: ↑ 8 Changed 7 years ago by dimpase

Replying to jpflori:

Anyone reviewing this?

I'll test that it builds on CYGWIN, and that ./sage -gap works. That's the best I can do on the current Win7 system I have access to.

comment:10 Changed 7 years ago by dimpase

  • Status changed from needs_review to positive_review

All good, as far as I see.

comment:11 Changed 7 years ago by jdemeyer

  • Milestone changed from sage-5.3 to sage-5.4
  • Reviewers set to Dmitrii Pasechnik

comment:12 Changed 7 years ago by jdemeyer

  • Merged in set to sage-5.3.rc1
  • Resolution set to fixed
  • Status changed from positive_review to closed

comment:13 Changed 7 years ago by jdemeyer

  • Milestone changed from sage-5.4 to sage-5.3

comment:14 Changed 7 years ago by jdemeyer

  • Description modified (diff)
Note: See TracTickets for help on using tickets.