[Python-Dev] [PEPs] Rebooting PEP 394 (aka Support the /usr/bin/python2 symlink upstream)

Ned Deily nad at acm.org
Wed Jul 20 09:56:29 CEST 2011


In article 
<CANaWP3zfhpaAGdgnuHd4diFFja2qMNkF+7WKW7qBY_F2vbyqhw at mail.gmail.com>,
 Kerrick Staley <mail at kerrickstaley.com> wrote:
> On Mon, Jul 18, 2011 at 3:03 AM, Ned Deily <nad at acm.org> wrote:
> > I think adding the requirement to mandate hard link vs soft link usage
> > is an unnecessary and unwarranted attempt at optimization.  For
> > instance, IIRC, the OS X installers don't use any hard links: that may
> > complicate the install, plus hard links on OS X HFS* file systems are a
> > bit of a kludge and not necessarily more efficient than symlinks.   It's
> > not a big deal but perhaps the wording should be changed to make a
> > suggestion about hard links vs syminks rather than mandate which should
> > be used.
> 
> Ah, OK. The wording's been changed so that symbolic links will be
> installed on Mac OS X and hard links elsewhere (although maybe
> symbolic links are also better on certain other platforms; I'm not
> sure).
> 
> I do think that specific instructions must be given (rather than just
> a suggestion) because it's indicating what must be done to CPython.
> The instructions *should* be as close as possible to what the
> installer already does, but I'm not entirely sure what the installer
> does by default, and the hard-link recommendation was based off a
> cursory inspection of my own system, so further input from yourself
> and the rest of python-dev would be appreciated.

Thanks for addressing the comments.  Unfortunately, I was relying too 
much on memory and I should have checked more carefully.  I see now 
that, within the framework bin directory for Python 3, the python3 -> 
python3.x link is, in fact, a hard link because it is being produced by 
the standard Makefile target "bininstall".  I was thinking more of the 
optional /usr/local/bin links which are all symlinks.  So, if the Python 
3 installer does is, there's no reason why Python 2 can't do it, I 
suppose.

But if you look at the Python 3 "bininstall" target (Makefile.pre.in 
starting around line 870 or so), you'll see that, for Python 3, symlinks 
are made for all the versioned files except "python3".  I'm not sure 
that there is a particular reason why a distinction was made;  IIRC, the 
other versioned links were added later in the cycle.  The other Python 3 
versioned links could probably be changed to hard links as well.  In the 
end, I don't think it makes a lot of difference.  But it would be better 
if Python 2 and Python 3 were consistent here.

My apologies for the confusion and extra work.

-- 
 Ned Deily,
 nad at acm.org



More information about the Python-Dev mailing list