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

pip does not preserve permissions when unpacking (Permission denied running ./configure) #317

Closed
duncf opened this Issue Jul 11, 2011 · 18 comments

Comments

Projects
None yet
@duncf

duncf commented Jul 11, 2011

"pip install ctypes" fails on Python 2.4 because pip does not properly apply the executable file permissions to ./source/libffi/configure when it unpacks the tarball (ctypes-1.0.2.tar.gz).

The ctypes setup.py executes this configure script directly, and this fails with permission denied. As a work around, it's possible to modify the ctypes setup.py to execute "sh /path/to/configure" instead of /path/to/configure

To reproduce this:

  • Build ctypes manually:
    • Download and unpack the ctypes tarball manually.
    • Note that source/libffi/configure has 755 permissions.
    • Run setup.py build manually. Note that it passes.
  • Let pip do the first step:
    • Do "pip install --no-install ctypes"
    • Verify that pip has unpacked /ctypes/source/libffi/configure with 644 permissions
    • Run setup.py build. Note that it fails.

This is related (but different) than issue #288, which specifically refers to how symlinks are handled when unpacking a tarball. I opened this issue to ensure that it didn't get lost.

I have not tested how permissions are handled with zip files.

@jezdez

This comment has been minimized.

Show comment
Hide comment
@jezdez

jezdez Jul 19, 2011

Contributor

I wonder if the untar_file function could be compared with setuptools' setuptools.archive_util.unpack_tarfile function. It seems to use a different function of the tarfile module, extractfile instead of _extract_member.

Contributor

jezdez commented Jul 19, 2011

I wonder if the untar_file function could be compared with setuptools' setuptools.archive_util.unpack_tarfile function. It seems to use a different function of the tarfile module, extractfile instead of _extract_member.

@nickpholden

This comment has been minimized.

Show comment
Hide comment
@nickpholden

nickpholden Oct 27, 2011

Is there a workaround for this, or a fix planned?

nickpholden commented Oct 27, 2011

Is there a workaround for this, or a fix planned?

@EspadaV8

This comment has been minimized.

Show comment
Hide comment
@EspadaV8

EspadaV8 Nov 14, 2011

@nickpholden

  1. pip install --no-install ctypes
  2. cd /path/from/pip/error (should end in something like build/ctypes/source/libffi/configure just remove the configure part)
  3. chmod +x configure
  4. pip install ctypes

Just tried it for myself and it seems to have worked.

EspadaV8 commented Nov 14, 2011

@nickpholden

  1. pip install --no-install ctypes
  2. cd /path/from/pip/error (should end in something like build/ctypes/source/libffi/configure just remove the configure part)
  3. chmod +x configure
  4. pip install ctypes

Just tried it for myself and it seems to have worked.

@macropin

This comment has been minimized.

Show comment
Hide comment
@macropin

macropin Mar 5, 2012

This is not just Python 2.4. I just ran into this twice with Python 2.6.

macropin commented Mar 5, 2012

This is not just Python 2.4. I just ran into this twice with Python 2.6.

@JLewis604

This comment has been minimized.

Show comment
Hide comment
@JLewis604

JLewis604 May 31, 2012

Issue can be resolved by simply changing folder permissions to that of the user you are installing with.

EX: chown -R [user] build/ctypes

This may cause additional issues, but it seemed to resolve a similar issue i was having with pyev

JLewis604 commented May 31, 2012

Issue can be resolved by simply changing folder permissions to that of the user you are installing with.

EX: chown -R [user] build/ctypes

This may cause additional issues, but it seemed to resolve a similar issue i was having with pyev

@kormoc

This comment has been minimized.

Show comment
Hide comment
@kormoc

kormoc Aug 13, 2012

I also ran into this with python 2.7.

kormoc commented Aug 13, 2012

I also ran into this with python 2.7.

@Karamorf

This comment has been minimized.

Show comment
Hide comment
@Karamorf

Karamorf Sep 28, 2012

Ran into this problem with Python 2.5 and pyev. Are you guys going to fix this? I shouldn't have to account for pip failing to do what its designed to do in my scripts. That is dumb.

Karamorf commented Sep 28, 2012

Ran into this problem with Python 2.5 and pyev. Are you guys going to fix this? I shouldn't have to account for pip failing to do what its designed to do in my scripts. That is dumb.

@tkell

This comment has been minimized.

Show comment
Hide comment
@tkell

tkell Oct 8, 2012

Having this problem with Python 2.7. If there's a fix, I'd love to hear about it.

tkell commented Oct 8, 2012

Having this problem with Python 2.7. If there's a fix, I'd love to hear about it.

@dholth

This comment has been minimized.

Show comment
Hide comment
Member

dholth commented Oct 9, 2012

@jenc88

This comment has been minimized.

Show comment
Hide comment
@jenc88

jenc88 Nov 20, 2012

Was trying to install ctypes in python 2.4 and EspadaV8's comment worked, thanks!

jenc88 commented Nov 20, 2012

Was trying to install ctypes in python 2.4 and EspadaV8's comment worked, thanks!

@ei-grad

This comment has been minimized.

Show comment
Hide comment
@ei-grad

ei-grad Jul 17, 2013

Very bad behaviour. Gived up to build a .deb package for Djblets with pip. Migrated to easy_install.

ei-grad commented Jul 17, 2013

Very bad behaviour. Gived up to build a .deb package for Djblets with pip. Migrated to easy_install.

@qwcode

This comment has been minimized.

Show comment
Hide comment
@qwcode

qwcode Aug 19, 2013

Contributor

for anyone following this, feel free to try the branch in #1146. hoping to include this in pip-1.4.2 shortly.

Contributor

qwcode commented Aug 19, 2013

for anyone following this, feel free to try the branch in #1146. hoping to include this in pip-1.4.2 shortly.

@qwcode

This comment has been minimized.

Show comment
Hide comment
@qwcode

qwcode Aug 20, 2013

Contributor

#1146 merged. closing this issue.

although the summary of this issue is about preserving permissions generally, the description and comments relate to preserving execute permissions, which #1146 handles.

Contributor

qwcode commented Aug 20, 2013

#1146 merged. closing this issue.

although the summary of this issue is about preserving permissions generally, the description and comments relate to preserving execute permissions, which #1146 handles.

@qwcode qwcode closed this Aug 20, 2013

@qwcode

This comment has been minimized.

Show comment
Hide comment
@qwcode

qwcode Aug 20, 2013

Contributor

set to be released in 1.4.2 patch release

Contributor

qwcode commented Aug 20, 2013

set to be released in 1.4.2 patch release

@msabramo

This comment has been minimized.

Show comment
Hide comment
@msabramo

msabramo Oct 29, 2013

Contributor

Any ETA on the 1.4.2 patch release?

(This issue is biting me with testing something that uses pyev in tox. Unfortunately, it will require a new version of pip AND then for tox to bundle the new version of pip in)

Contributor

msabramo commented Oct 29, 2013

Any ETA on the 1.4.2 patch release?

(This issue is biting me with testing something that uses pyev in tox. Unfortunately, it will require a new version of pip AND then for tox to bundle the new version of pip in)

@qwcode

This comment has been minimized.

Show comment
Hide comment
@qwcode

qwcode Oct 29, 2013

Contributor

with 1.5 betas due to come out in ~2wks, 1.4.2 is very unlikley at this point unless that gets delayed. sorry to mislead.

Contributor

qwcode commented Oct 29, 2013

with 1.5 betas due to come out in ~2wks, 1.4.2 is very unlikley at this point unless that gets delayed. sorry to mislead.

@remram44

This comment has been minimized.

Show comment
Hide comment
@remram44

remram44 May 30, 2014

Contributor

I ran into this today trying to install ctypes on Debian (pip is 1.5.5).

Running setup.py install for ctypes
    env: /home/remram44/vtenv/build/ctypes/source/libffi/configure: Permission denied
    Configuring static FFI library:
    cd build/temp.linux-i686-2.7/libffi && env CFLAGS='' '/home/remram44/vtenv/build/ctypes/source/libffi/configure'
    Failed

What is going on?

Contributor

remram44 commented May 30, 2014

I ran into this today trying to install ctypes on Debian (pip is 1.5.5).

Running setup.py install for ctypes
    env: /home/remram44/vtenv/build/ctypes/source/libffi/configure: Permission denied
    Configuring static FFI library:
    cd build/temp.linux-i686-2.7/libffi && env CFLAGS='' '/home/remram44/vtenv/build/ctypes/source/libffi/configure'
    Failed

What is going on?

@qwcode

This comment has been minimized.

Show comment
Hide comment
@qwcode

qwcode May 30, 2014

Contributor

I'm on ubuntu, and it works with 1.5.5 https://gist.github.com/qwcode/569afafab50e35bdd0d1

what's going on most likely is that '/home/remram44/vtenv/build/ctypes/source/libffi/configure' is not executable. as for why? not sure. be sure you're really using 1.5.5

Contributor

qwcode commented May 30, 2014

I'm on ubuntu, and it works with 1.5.5 https://gist.github.com/qwcode/569afafab50e35bdd0d1

what's going on most likely is that '/home/remram44/vtenv/build/ctypes/source/libffi/configure' is not executable. as for why? not sure. be sure you're really using 1.5.5

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