64 bit install Python

Andrew Bartlett abartlet at samba.org
Tue Feb 1 15:20:53 MST 2011

On Tue, 2011-02-01 at 07:03 -0500, Stephen Gallagher wrote:
> Hash: SHA1
> On 01/31/2011 06:51 AM, Andrew Bartlett wrote:
> > On Sat, 2011-01-29 at 13:31 -0500, Scott Carradice wrote:
> >> When installing samba on a 64 bit machine ( Opensuse 11.3 ) the python
> >> portion seems to split up into lib and lib64.  Python seems to be able
> >> to use one directory so my fix so far is just to copy all of the lib64
> >> directory into the lib directory.  Is there a more correct solution at
> >> this time?
> > 
> > The issue is that installmisc.sh in Samba4 rewrites:
> > 
> > sys.path.insert(0, "bin/python")
> > into
> > sys.path.insert(0, "/usr/local/samba/lib/python2.7/site-packages")
> > 
> > This means that the 64 bit files are now not found on a fresh install.  
> > 
> > We need to fix installmisc.sh to be written in python itself, or for it
> > to be folded into the waf rules.  Then we can create a more sensible
> > pattern match for fixing the scripts, that doesn't rely on lowest common
> > denominator sed, and can insert both paths. 
> One approach that could also work would be to have installmisc.sh do the
> following:
> PYTHON_SITELIB=`python -c "from distutils.sysconfig import
> get_python_lib; print(get_python_lib())"`
> PYTHON_SITEARCH=`python -c "from distutils.sysconfig import
> get_python_lib; print(get_python_lib(1))"`
> And then pass sys.path.insert(0, "$PYTHON_SITELIB:%PYTHON_SITEARCH")
> (This is similar to how it's done in spec files for Red Hat and Fedora)
> This is also very portable, since we're asking python itself what path
> it's expecting to need.

Well, it's actually not installmisc.sh.  I spent a good part of the day
down that blind alley, before I realised the script wasn't called at

This is done just in waf rules.  The problem is that even when we set a
python path for both directories, python doesn't split a module between
two different paths - once the root of a module is found there, the rest
must be in the same directory, as far as my strace work shows. 

The problem with that is that the 'samba' module is part python, part C,
and so must be installed in the PYTHONARCHDIR only. 

Andrew Bartlett

Andrew Bartlett                                http://samba.org/~abartlet/
Authentication Developer, Samba Team           http://samba.org
Samba Developer, Cisco Inc.

More information about the samba-technical mailing list