Fix for Python library path problem

Gary E. Miller gem at rellim.com
Thu Sep 28 00:00:43 UTC 2017


Yo Fred!

On Wed, 27 Sep 2017 16:31:12 -0700 (PDT)
Fred Wright via devel <devel at ntpsec.org> wrote:

> On Wed, 27 Sep 2017, Gary E. Miller via devel wrote:
> > Fred Wright via devel <devel at ntpsec.org> wrote:  
> 
> >   It only matters  
> > > for Linux, since get_python_lib() returns FHS-compliant results on
> > > *BSD, and on OSX the paths are so completely different that FHS
> > > doesn't apply.  
> >
> > Uh, lost me.  macOS is very much FHS compliant.  
> 
> MacPro:~ fw$ /usr/bin/python -c 'from distutils import sysconfig;
> print(sysconfig.get_python_lib())' /Library/Python/2.7/site-packages

Nothing in FHS says an OS can't use directories not in the FHS.

What you neglected to show was where NTPsec installed itself?

By default, my NTPsec installed here:

-rw-r--r--  1 root  wheel  71992 Sep 27 16:01 /opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/ntp/packet.py

Which is a little odd, but no way in conflict with the FHS.

> Completely different scheme.

Check out your root directory.  It still has /bin, /dev, /etc, /opt,
/sbin, /usr, /var, and most of the other things you would expect.  And
they are used in the way the FHS would approve of.

So, I still fail to see an issue here.

> > When I run NTPsec on macOS I export PYTHONPATH.  
> 
> Should no longer be necessary, since Eric's patch doesn't affect my
> fix in the OSX case.

You really think I did not test it before my last reply?  I got NTPsec
pieces spread all over now on macOS since the last few changes.

> It does, however, screw up BSD.  E.g., on FreeBSD:
> 
> >>> sysconfig.get_python_lib()  
> '/usr/local/lib/python2.7/site-packages'
> >>> sysconfig.get_python_lib().replace('/usr', '/usr/local')  
> '/usr/local/local/lib/python2.7/site-packages'

I fail to see the problem there?  Or what you are trying to show?
Or why I should care?

> It needs a bit more restraint in patching the path.

Why would you even do that?  You totally lost me.

> > And AFAIK, NTPsec is now, once again, installing in the proper
> > location on all OS.  I no longer see an issue here.  
> 
> Well, *I* see an issue until setting PYTHONPATH is rendered
> unnecessary on all platforms, which is not yet the case.

Sigh, I hate to sound like a broken record, but we have all agreed
several times today that we would like to do without PYTHONPATH.  No
need to say it is a point of difference, it is not.

How about we work on that instead?

RGDS
GARY
---------------------------------------------------------------------------
Gary E. Miller Rellim 109 NW Wilmington Ave., Suite E, Bend, OR 97703
	gem at rellim.com  Tel:+1 541 382 8588

	    Veritas liberabit vos. -- Quid est veritas?
    "If you can’t measure it, you can’t improve it." - Lord Kelvin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ntpsec.org/pipermail/devel/attachments/20170927/c4c56215/attachment.bin>


More information about the devel mailing list