Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 462306 - dev-python/virtualenv with dev-python/pypy - broken because of 1.9-scripts-location.patch
Summary: dev-python/virtualenv with dev-python/pypy - broken because of 1.9-scripts-lo...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Python Gentoo Team
URL:
Whiteboard:
Keywords:
: 469298 542446 553214 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-03-19 12:56 UTC by Guillaume Ayoub
Modified: 2015-11-28 08:45 UTC (History)
6 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
A new scripts-location patch that fixes virtualenv issue (2.3.1-scripts-location.patch,1.09 KB, patch)
2014-06-14 21:45 UTC, Yuriy Taraday
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Guillaume Ayoub 2013-03-19 12:56:08 UTC
The patch called "1.9-scripts-location.patch" breaks virtualenv with pypy. Virtualenv relies on $base to use the right bin folder.

Reproducible: Always

Steps to Reproduce:
1.Install pypy and virtualenv
2.Launch "virtualenv-2.7-pypy-2.0 test_folder" to create a new virtualenv
Actual Results:  
An error is raised:

Installing pip script to /usr/bin
error: /usr/bin/pip: Permission denied

Expected Results:  
The virtualenv is created

This bug is different from bug 445822. To test virtualenv with pypy on gentoo amd64, you also need to fix 445822 before thanks to this patch:
https://github.com/Kozea/virtualenv/commit/890db9b
Comment 1 Michal Petrucha 2013-04-13 00:06:33 UTC
The problem described in #445822 has been already fixed in master upstream.

Regarding this issue, I can confirm the same results as the reporter. Moreover, if you revert the patch, it is possible to create a virtualenv without any problems and also install packages inside the virtualenv. However, if you re-apply the patch after you create a virtualenv, it is no longer possible to install packages with runnable scripts inside the virtualenv, with the same symptoms -- distutils tries to install the script into /usr/bin instead of <venv_dir>/bin.

Steps to reproduce:

1. revert 1.9-scripts-location.patch by modifying line 90 of /usr/lib64/pypy2.0/lib-python/2.7/distutils/command/install.py
2. install a development version of virtualenv
3. virtualenv -p pypy-c2.0 test-venv
4. re-apply 1.9-scripts-location.patch by modifying line 90 of /usr/lib64/pypy2.0/lib-python/2.7/distutils/command/install.py
5. pip install sympy inside test-venv

The installation fails when attempting to install isympy into /usr/bin.
Comment 2 Dirkjan Ochtman (RETIRED) gentoo-dev 2013-07-24 08:06:34 UTC
Can you please try this with virtualenv 1.9.1-r1 and/or 1.10?

(And possibly also with newer pypy.)
Comment 3 Guillaume Ayoub 2013-07-24 11:03:12 UTC
Pypy 1.9 and 2.0 (1.9-r2 and 2.0.2 for latest ebuilds) apply 1.9-scripts-location.patch, and that breaks virtualenv for with pypy, nothing changed.

Note that bug 445822 is fixed in virtualenv 1.10.
Comment 4 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-07-29 10:17:11 UTC
*** Bug 469298 has been marked as a duplicate of this bug. ***
Comment 5 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-07-29 10:19:13 UTC
If we make pypy install paths similar to CPython's as suggested in bug 465546, this issue would be fixed, correct?
Comment 6 Yuriy Taraday 2014-06-14 21:45:09 UTC
Created attachment 378910 [details, diff]
A new scripts-location patch that fixes virtualenv issue

This patch detects if smth is being installed to a prefix and uses old (unmangled) install scheme for it.
Comment 7 Yuriy Taraday 2014-06-14 21:55:08 UTC
Oh, no, ignore that. It's a very well-hidden noop.
Comment 8 Juraj Variny 2014-08-20 19:50:14 UTC
(In reply to Yuriy Taraday from comment #7)
> Oh, no, ignore that. It's a very well-hidden noop.

How so? Your patch did help me (pypy-bin-2.3.1 is slightly different, merged it by hand).
Comment 9 Alex Orange 2015-03-15 13:56:26 UTC
*** Bug 542446 has been marked as a duplicate of this bug. ***
Comment 10 Alex Orange 2015-03-15 14:00:29 UTC
Still having this issue. Patch still works when I remember to apply it. Anyone know why this patch hasn't been put in yet?
Comment 11 Yuriy Taraday 2015-03-15 19:49:08 UTC
It really shouldn't work. I don't remember exactly why, but it should mess up things instead of fixing although it looks like it works. IIRC you'd never reach this 'if' with name == *_prefix or smth like that.
Comment 12 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-11-27 15:28:17 UTC
Ok, so I have a new idea. We could remove the Gentoo patch and instead pass all --install-* paths to setup.py install directly. Sadly, this may break some packages that override default paths for some fancy reason.
Comment 13 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-11-27 16:57:32 UTC
*** Bug 553214 has been marked as a duplicate of this bug. ***
Comment 14 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2015-11-27 19:53:56 UTC
I have committed new revisions of PyPy with a better path hack that would hopefully solve this. Long story short, now Gentoo hackery is only applied if package would normally be installed to /usr/lib*/pypy. If any other install_base is used (e.g. virtualenv), we leave the default PyPy subdirectories.

Please upgrade to 2.6.0-r1 (2.6.0-r2 in pypy-bin) or 4.0.1, and test.
Comment 15 Justin Lecher (RETIRED) gentoo-dev 2015-11-28 08:45:32 UTC
 9998  virtualenv -p pypy -v PANDAS
 9999  . PANDAS/bin/activate
10000  type pip
10001  type pypy
10002  pip install django
10003  type django-admin

is fine