Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GAP's spkg-install fails on recent Cygwin #13341

Closed
jpflori opened this issue Aug 5, 2012 · 18 comments
Closed

GAP's spkg-install fails on recent Cygwin #13341

jpflori opened this issue Aug 5, 2012 · 18 comments

Comments

@jpflori
Copy link

jpflori commented Aug 5, 2012

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

CC: @dimpase

Component: porting: Cygwin

Keywords: cygwin gap spkg

Author: Jean-Pierre Flori, Leif Leonhardy

Reviewer: Dmitrii Pasechnik

Merged: sage-5.3.rc1

Issue created by migration from https://trac.sagemath.org/ticket/13341

@jpflori jpflori added this to the sage-5.3 milestone Aug 5, 2012
@jpflori
Copy link
Author

jpflori commented Aug 5, 2012

Attachment: spkg.diff.gz

Spkg diff, for review only.

@jpflori

This comment has been minimized.

@jpflori
Copy link
Author

jpflori commented Aug 5, 2012

Author: Jean-Pierre Flori

@nexttime
Copy link
Mannequin

nexttime mannequin commented Aug 5, 2012

comment:2

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

@nexttime nexttime mannequin changed the title Gap spkg fails on recent Cygwin GAP's spkg-install fails on recent Cygwin Aug 5, 2012
@jpflori
Copy link
Author

jpflori commented Aug 5, 2012

comment:3

Replying to @nexttime:

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.

@jpflori
Copy link
Author

jpflori commented Aug 5, 2012

Work Issues: use better script

@jpflori
Copy link
Author

jpflori commented Aug 5, 2012

comment:5

Spkg updated.

@jpflori
Copy link
Author

jpflori commented Aug 5, 2012

Changed work issues from use better script to none

@jpflori
Copy link
Author

jpflori commented Aug 5, 2012

Changed author from Jean-Pierre Flori to Jean-Pierre Flori, Leif Leonhardy

@jpflori
Copy link
Author

jpflori commented Aug 5, 2012

Attachment: spkg.2.diff.gz

spkg diff, for review only

@jpflori
Copy link
Author

jpflori commented Aug 5, 2012

comment:6

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

@jpflori
Copy link
Author

jpflori commented Aug 5, 2012

comment:7

This should be fixed now.

@jpflori
Copy link
Author

jpflori commented Aug 20, 2012

comment:8

Anyone reviewing this?

@dimpase
Copy link
Member

dimpase commented Aug 20, 2012

comment:9

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.

@dimpase
Copy link
Member

dimpase commented Aug 20, 2012

comment:10

All good, as far as I see.

@jdemeyer
Copy link

Reviewer: Dmitrii Pasechnik

@jdemeyer jdemeyer removed this from the sage-5.3 milestone Aug 22, 2012
@jdemeyer jdemeyer added this to the sage-5.4 milestone Aug 22, 2012
@jdemeyer
Copy link

Merged: sage-5.3.rc1

@jdemeyer

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants