All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gary Thomas <gary@mlbassoc.com>
To: Chris Larson <clarson@kergoth.com>
Cc: yocto <yocto@yoctoproject.org>
Subject: Re: How does python-native work?
Date: Wed, 23 Apr 2014 09:44:52 -0600	[thread overview]
Message-ID: <5357DFF4.2060305@mlbassoc.com> (raw)
In-Reply-To: <CABcZAN=n__L01vXz2Kup3C=Vej-qCXjzwOhY7HgNnsOq6xdfFw@mail.gmail.com>

On 2014-04-23 09:37, Chris Larson wrote:
>
> On Wed, Apr 23, 2014 at 7:57 AM, Gary Thomas <gary@mlbassoc.com <mailto:gary@mlbassoc.com>> wrote:
>
>     On 2014-04-23 08:21, Chris Larson wrote:
>
>         On Wed, Apr 23, 2014 at 7:15 AM, Gary Thomas <gary@mlbassoc.com <mailto:gary@mlbassoc.com> <mailto:gary@mlbassoc.com <mailto:gary@mlbassoc.com>>> wrote:
>
>              How is python-native supposed to work?  I can see that it's
>              built and installed in my tmp/sysroots/HOST but it's installed
>              in a sub-directory which is not found by normal means.
>
>
>         inherit pythonnative (or one of the classes that inherit it)
>
>
>     Thanks, I imported 'distutils' and that helped, but I still have problems with it.  Looking
>     at log.do_configure:
>        checking for python... /local/rpi_2014-04-10/tmp/__sysroots/x86_64-linux/usr/bin/__python-native/python
>        checking for python-config... /local/rpi_2014-04-10/tmp/__sysroots/x86_64-linux/usr/bin/__python-native/python-config
>        Traceback (most recent call last):
>          File "/local/rpi_2014-04-10/tmp/__sysroots/x86_64-linux/usr/bin/__python-native/python-config", line 6, in <module>
>            from distutils import sysconfig
>          File "/local/rpi_2014-04-10/tmp/__sysroots/x86_64-linux/usr/lib/__python2.7/distutils/sysconfig.__py", line 22, in <module>
>            PREFIX = os.path.normpath(sys.prefix).__replace( os.getenv("BUILD_SYS"), os.getenv("HOST_SYS") )
>        TypeError: expected a character buffer object
>
>     When I ran python-config before (original email), the results
>     were from outside the build environment, i.e. the command line
>     where I run 'bitbake'.  When do_configure() runs in my recipe,
>     the environment seems to be quite different.  If I try to run
>     python-config from devshell (for my recipe), it fails as above.
>
>
> First, it's a bit worrisome that you're inheriting a class for distutils when your build doesn't actually use distutils.. but beyond that, I don't think the classes inherited by
> distutils assume you'll be running python-config. Add this:
>
>      export BUILD_SYS
>      export HOST_SYS

I went back to only inheriting pythonnative (I was a bit
overzealous to follow your 'or a class that inherits it').

I found that I also needed:
   export STAGING_INCDIR
   export STAGING_LIBDIR

Perhaps pythonnative should imply those exports, as without
them, python-config is useless.

Anyway, now the recipe successfully builds the python interface!!

Thanks for the help

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


  reply	other threads:[~2014-04-23 15:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-04-23 14:15 How does python-native work? Gary Thomas
2014-04-23 14:21 ` Chris Larson
2014-04-23 14:57   ` Gary Thomas
2014-04-23 15:37     ` Chris Larson
2014-04-23 15:44       ` Gary Thomas [this message]
2014-04-23 15:51         ` Chris Larson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5357DFF4.2060305@mlbassoc.com \
    --to=gary@mlbassoc.com \
    --cc=clarson@kergoth.com \
    --cc=yocto@yoctoproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.