#20437: Misinstallation of Python in Cygwin
-------------------------------------+-------------------------------------
       Reporter:  embray             |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-7.2
      Component:  porting: Cygwin    |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Erik Bray          |    Reviewers:
Report Upstream:  Reported           |  Work issues:
  upstream. No feedback yet.         |       Commit:
         Branch:  u/embray/cygwin-   |  71062f01ef52e723f780044ffd08b4f46520bd75
  python-install                     |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------
Changes (by embray):

 * status:  needs_work => needs_review
 * upstream:  Not yet reported upstream; Will do shortly. => Reported
     upstream. No feedback yet.


Old description:

> I've encountered yet another problem in my quest to get sage building on
> Cygwin.  I'm surprised this hasn't come up before though which makes me
> wonder if I'm doing something wrong.
>
> The DLL loader library, libpython2.7.dll.a, gets installed to
> `$(SAGE_LOCAL)/lib/python2.7/config/` which is not normally on the ld
> search path (similar on Python 3 I think).
>
> This means that when building extension modules `-lpython2.7` is actually
> linking against my system Python (in this case the Python that came with
> cygwin--also Python 2.7.10).  This is of course wrong, but isn't a
> problem for the majority of modules, including sage itself (at least it
> wasn't a problem for compiling).  It was actually PIL(low) where this
> fell apart because it used some `PyUnicode_` functions that were not
> found in my system libpython because it was compiled with `--enable-
> unicode=ucs2`, whereas Sage builds Python with `--enable-unicode=ucs4`.
>
> When installing Python, Sage should be making a symlink to
> `$(SAGE_LOCAL)/lib/python2.7/config/libpython2.7.dll.a` in
> `$(SAGE_LOCAL)/lib`.
>
> I'm leaning toward calling this an upstream bug--I don't understand why
> this isn't done automatically by Python's Makefile.  The relevant portion
> begins [https://hg.python.org/cpython/file/v2.7.10/Makefile.pre.in#l916
> here].  It seems that if a DLL is built it ''does not'' install a symlink
> to the loader library in lib/.
>
> For reference, Cygwin's own system package for Python installs this
> symlink manually...

New description:

 I've encountered yet another problem in my quest to get sage building on
 Cygwin.  I'm surprised this hasn't come up before though which makes me
 wonder if I'm doing something wrong.

 The DLL loader library, libpython2.7.dll.a, gets installed to
 `$(SAGE_LOCAL)/lib/python2.7/config/` which is not normally on the ld
 search path (similar on Python 3 I think).

 This means that when building extension modules `-lpython2.7` is actually
 linking against my system Python (in this case the Python that came with
 cygwin--also Python 2.7.10).  This is of course wrong, but isn't a problem
 for the majority of modules, including sage itself (at least it wasn't a
 problem for compiling).  It was actually PIL(low) where this fell apart
 because it used some `PyUnicode_` functions that were not found in my
 system libpython because it was compiled with `--enable-unicode=ucs2`,
 whereas Sage builds Python with `--enable-unicode=ucs4`.

 When installing Python, Sage should be making a symlink to
 `$(SAGE_LOCAL)/lib/python2.7/config/libpython2.7.dll.a` in
 `$(SAGE_LOCAL)/lib`.

 I'm leaning toward calling this an upstream bug--I don't understand why
 this isn't done automatically by Python's Makefile.  The relevant portion
 begins [https://hg.python.org/cpython/file/v2.7.10/Makefile.pre.in#l916
 here].  It seems that if a DLL is built it ''does not'' install a symlink
 to the loader library in lib/.  I've brought this up here:
 https://mail.python.org/pipermail/python-dev/2016-April/144315.html

 For reference, Cygwin's own system package for Python installs this
 symlink manually...  It seems odd not to do it by default.

--

--
Ticket URL: <http://trac.sagemath.org/ticket/20437#comment:12>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to