python / cpython

The Python programming language
https://www.python.org
Other
62.42k stars 29.97k forks source link

Installation flaky with multiple installers, old versions #33429

Closed 36a699a8-3b7f-4e71-b274-880655ed5d64 closed 22 years ago

36a699a8-3b7f-4e71-b274-880655ed5d64 commented 23 years ago
BPO 220993
Nosy @mwhudson, @akuchling
Files
  • patch: Revised version of the patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields: ```python assignee = 'https://github.com/akuchling' closed_at = created_at = labels = ['library'] title = 'Installation flaky with multiple installers, old versions' updated_at = user = 'https://bugs.python.org/gward' ``` bugs.python.org fields: ```python activity = actor = 'akuchling' assignee = 'akuchling' closed = True closed_date = None closer = None components = ['Distutils'] creation = creator = 'gward' dependencies = [] files = ['6'] hgrepos = [] issue_num = 220993 keywords = [] message_count = 8.0 messages = ['2276', '2277', '2278', '2279', '2280', '2281', '2282', '2283'] nosy_count = 3.0 nosy_names = ['mwh', 'akuchling', 'gward'] pr_nums = [] priority = 'normal' resolution = 'accepted' stage = None status = 'closed' superseder = None type = None url = 'https://bugs.python.org/issue220993' versions = [] ```

    36a699a8-3b7f-4e71-b274-880655ed5d64 commented 23 years ago

    Installation tends to have problems when there are old installations present, especially when a different user is doing the new installation.

    In particular, it appears that the chmod() done in 'copy_file()' (as a result of the "install" command attempting to preserve the mode of files from the build tree) fails, because you can't chmod() a file owned by somebody else.

    Paul Dubois suggests that simply unlinking the target file before doing the copy should work. I think he's right, but need to think about it and test it a bit first.

    akuchling commented 23 years ago

    Logged In: YES user_id=11375

    I think unlinking first is the right thing to do, having just run into another problem that seems to be caused by this. Installing *.so files to an NFS partition messed up other people, I think because they had the *.so file loaded into memory and the kernel's VM got confused.
    (That's the theory, anyway.)

    Bumping up the priority as a reminder to myself...

    mwhudson commented 22 years ago

    Logged In: YES user_id=6656

    I'll have a look at this, as I've already assigned some installation related bugs to myself.

    akuchling commented 22 years ago

    Logged In: YES user_id=11375

    This bit David Binger today, so I finally dug in and fixed it. Patch attached for a sanity-check. (2.2 bugfix candidate)

    mwhudson commented 22 years ago

    Logged In: YES user_id=6656

    Um, may be being dense, but os.unlink raises os.error if you try to unlink a file that doesn't exist... so won't this blow up in a first-time install for instance?

    akuchling commented 22 years ago

    Logged In: YES user_id=11375

    Oops! Shows I only tried it with a repeated install... New patch uploaded, which only unlinks if os.path.exists(dst).

    mwhudson commented 22 years ago

    Logged In: YES user_id=6656

    That looks better. Check it in?

    akuchling commented 22 years ago

    Logged In: YES user_id=11375

    Checked in as rev. 1.12 of file_util.py.