Opened 6 years ago

Last modified 6 years ago

#21441 closed defect

Old installed version of Cython is used — at Version 7

Reported by: jdemeyer Owned by:
Priority: blocker Milestone: sage-7.4
Component: build Keywords:
Cc: embray Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by jdemeyer)

On a machine which had an older version of Cython installed but which was upgraded recently after #20218 was merged:

$ ls -ld local/lib/python/site-packages/Cython*
drwxrwxr-x 12 jdemeyer jdemeyer 4096 Sep  6 21:23 local/lib/python/site-packages/Cython
drwxrwxr-x  5 jdemeyer jdemeyer 4096 Sep  6 21:22 local/lib/python/site-packages/Cython-0.23.3-py2.7-linux-i686.egg
drwxrwxr-x  2 jdemeyer jdemeyer 4096 Sep  6 21:14 local/lib/python/site-packages/Cython-0.24.1-py2.7.egg-info

Despite Cython-0.24.1 being available, the older version 0.23.3 is still used by default. This causes breakage when building the Sage library.

>>> import Cython
>>> Cython.__version__
'0.23.3'
>>> import sys
>>> [x for x in sys.path if 'Cython' in x]
['/home/jdemeyer/sage-git/local/lib/python2.7/site-packages/Cython-0.23.3-py2.7-linux-i686.egg']

The problem is not limited to Cython, the same happens for other packages too.

This is a blocker ticket since it breaks upgrades from older Sage versions.

Steps to reproduce:

  1. ./sage --sh -c 'easy_install cython==0.23.3' # Install an older version of Cython.
  1. ./sage -f cython # Rebuild the Cython in Sage. This should uninstall the old version but it doesn't.

Change History (7)

comment:1 Changed 6 years ago by jdemeyer

  • Description modified (diff)
  • Summary changed from Old version of Cython might be used to Old installed version of Cython is used

comment:2 Changed 6 years ago by jdemeyer

  • Description modified (diff)

comment:3 Changed 6 years ago by jdemeyer

  • Description modified (diff)

comment:4 Changed 6 years ago by jdemeyer

  • Description modified (diff)

comment:5 Changed 6 years ago by embray

Wow, I see the issue. When you use pip with the --ignore-installed option it also does not uninstall existing versions of the package (at the very least if it's an old .egg). I would say that's undocumented behavior.

comment:6 follow-up: Changed 6 years ago by embray

I think the easiest thing to do for now would be to make PIP_INSTALL point to a little wrapper function that also forcibly calls pip uninstall. That will also make ./sage -f work properly since it will force reinstall of the package even if the same version was already installed.

comment:7 in reply to: ↑ 6 Changed 6 years ago by jdemeyer

  • Description modified (diff)

Replying to embray:

I think the easiest thing to do for now would be to make PIP_INSTALL point to a little wrapper function that also forcibly calls pip uninstall.

That is not entirely trivial because you need to figure out which package to uninstall. You cannot do pip uninstall ., you need something like pip uninstall $PKGNAME.

Other than that, I like the idea. We could probably drop the --ignore-installed --no-deps options too.

Note: See TracTickets for help on using tickets.