[oe] [RFC] set PYTHONPATH inside distutils-base.bbclass instead of distutils.bbclass

Koen Kooi k.kooi at student.utwente.nl
Mon Feb 15 10:13:51 UTC 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I had a problem with building python-pygobject-native last week which
was due to this bit in m4/python.m4

if test -x "$PYTHON-config"; then
PYTHON_INCLUDES=`$PYTHON-config --includes 2>/dev/null`
else
PYTHON_INCLUDES="-I${py_prefix}/include/python${PYTHON_VERSION}"
if test "$py_prefix" != "$py_exec_prefix"; then
  PYTHON_INCLUDES="$PYTHON_INCLUDES
- -I${py_exec_prefix}/include/python${PYTHON_VERSION}"
>fi
fi

$PYTHON-config exists in staging and needs HOST_SYS, BUILDSYS,
STAGING_LIBDIR and STAGING_INCDIR exported to work.

But after instrumenting python.m4 a bit I get this when running
python-config:

Traceback (most recent call last):
  File "/OE/angstrom-dev/staging/x86_64-linux/usr/bin/python-config",
line 26, in <module>
    pyver = sysconfig.get_config_var('VERSION')
  File "/usr/lib/python2.5/distutils/sysconfig.py", line 541, in
get_config_var
    return get_config_vars().get(name)
  File "/usr/lib/python2.5/distutils/sysconfig.py", line 499, in
get_config_vars
    func()
  File "/usr/lib/python2.5/distutils/sysconfig.py", line 351, in _init_posix
    filename = get_makefile_filename()
  File "/usr/lib/python2.5/distutils/sysconfig.py", line 210, in
get_makefile_filename
    return os.path.join(lib_dir, "config" + (sys.pydebug and "_d" or
""), "Makefile")AttributeError: 'module' object has no attribute 'pydebug'

Which means it's using the distutils on my buildhost instead of the
proper one in staging.

OE is doing this:

export
PYTHONPATH=/OE/bitbake:/OE/bitbake/lib:/OE/bitbake-git/bin:/usr/lib/python2.5:/usr/lib/python2.5/plat-linux2:/usr/lib/python2.5/lib-tk:/usr/lib/python2.5/lib-dynload:/usr/local/lib/python2.5/site-packages:/usr/lib/python2.5/site-packages:/usr/lib/python2.5/site-packages/Numeric:/usr/lib/python2.5/site-packages/PIL:/usr/lib/pymodules/python2.5:/usr/lib/pymodules/python2.5/gtk-2.0

So I added this to the recipe:

do_configure_prepend() {
       unset PYTHONPATH
}

And everything started working again.

So my question is:

Can we set PYTHONPATH inside distutils-base.bbclass instead of
distutils.bbclass or just plain unset it?

regards,

Koen



-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Darwin)

iD8DBQFLeR5fMkyGM64RGpERApuWAJ4zzAKv7lVLPc9JIVJaBvul/ZGN2ACgmBH7
zA6ShA0i6mutv5+rCEncno8=
=48js
-----END PGP SIGNATURE-----





More information about the Openembedded-devel mailing list