pip install does not set element hook scripts +x

Bug #1266550 reported by James Slagle
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
diskimage-builder
Invalid
High
James Polley
tripleo
Invalid
High
James Polley

Bug Description

pip installing diskimage-builder adds the elements themselves under /usr/share/diskimage-builder/elements. However, the element hook scripts are not +x, so if you were to actually try and use the elements under that path, they would not work since diskimage-builder requires the scripts to be +x.

To reproduce:
$ sudo pip install diskimage-builder
$ ll /usr/share/diskimage-builder/elements/hwdiscovery/install.d/10-hwinfo
-rw-r--r--. 1 root root 93 Jan 6 13:01 /usr/share/diskimage-builder/elements/hwdiscovery/install.d/10-hwinfo

Note that python setup.py install from a dib git checkout does the right thing:
$ sudo python setup.py install
$ ll /usr/share/diskimage-builder/elements/hwdiscovery/install.d/10-hwinfo
-rwxrwxr-x. 1 root root 93 Jan 6 12:42 /usr/share/diskimage-builder/elements/hwdiscovery/install.d/10-hwinfo

So, it might be something specific to pip itself.

Revision history for this message
James Slagle (james-slagle) wrote :

Added this bug to tripleo as well because pip installing tripleo-image-elements has the same problem.

Note that if you download the tarballs from pypi, the +x bit is set correctly.

Changed in tripleo:
status: New → Triaged
importance: Undecided → High
Changed in diskimage-builder:
status: New → Triaged
importance: Undecided → High
James Polley (tchaypo)
Changed in diskimage-builder:
assignee: nobody → James Polley (tchaypo)
Changed in tripleo:
assignee: nobody → James Polley (tchaypo)
Revision history for this message
James Polley (tchaypo) wrote :

I've been unable to reproduce this using pip 1.5.4 on ubuntu trusty; but in my case, the elements were installed under/usr/local/share/diskimage-builder rather than /usr/share/diskimage-builder

I *have* been able to reproduce this with pip-1.0 on ubuntu-precise (although, again, /usr/local/share/diskimage-builder rather than /usr/share/diskimage-builder). I've also been able to reproduce with pip 1.3.1 on fedora19 - in this case, /usr/share/diskimage-builder.

Revision history for this message
James Polley (tchaypo) wrote :

I've found a few bugs that seem related:

https://github.com/pypa/pip/issues/1133
https://github.com/pypa/pip/issues/317

Both of these were reported solved in https://github.com/pypa/pip/pull/1146 which seems to have landed in pip 1.5 - which would explain why I can reproduce this in versions <1.5

Using the version of virtualenv from the ubuntu sources for precise (python-virtualenv (1.7.1.2-1)) I was able to create a virtualenv with pip 1.1, and can replicate the problem inside a virtualenv. I then upgraded with "pip install pip==1.4.1" and can still replicate the problem. I then upgraded with "pip install pip==1.5", then used "pip install --no-use-wheel diskimage-builder" to get around the old version of setuptools in the virtualenv - and confirmed that the scripts now get +x set.

So in short, I'm fairly convinced that this is caused by using pip <1.5

James Polley (tchaypo)
Changed in diskimage-builder:
status: Triaged → Invalid
Changed in tripleo:
status: Triaged → Invalid
Revision history for this message
James Polley (tchaypo) wrote :

I've set this to invalid because as far as I can tell it's not something we can fix in diskimage-builder or in tripleo; the resolution seems to be to get a newer version of pip.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.