All the mail mirrored from lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Williams <patrick@stwcx.xyz>
To: Lean Sheng Tan <sheng.tan@9elements.com>
Cc: Ross Burton <Ross.Burton@arm.com>,
	"openembedded-core@lists.openembedded.org"
	<openembedded-core@lists.openembedded.org>,
	"Hansen, Alexander" <alexander.hansen@9elements.com>,
	John Chung <John.Chung@arm.com>
Subject: Re: [OE-core] btrfs-tools-native build python error
Date: Wed, 1 May 2024 16:27:30 -0500	[thread overview]
Message-ID: <ZjKzwmSpKmznOedr@heinlein.vulture-banana.ts.net> (raw)
In-Reply-To: <CAMWxwJ3ok_d17XnVEgSm3H3qeKK+7U3AQ4OuwNFXTo-jWjtHoQ@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 4012 bytes --]

On Thu, Apr 25, 2024 at 07:40:15PM +0200, Lean Sheng Tan wrote:
> >> > The error found when manually run bitbake btrfs-tools-native is as
> >> follows:
> >> >  checking for a Python interpreter with version >= 3.4... python3
> >> >  checking for python3...
> >> /home/apwillia/local/builds/lf-build-yosemite4/tmp/hosttools/python3
> >> >  checking for python3 version... 3.11
> >> >  checking for python3 platform... linux
> >> >  checking for GNU default python3 prefix... ${prefix}
> >> >  checking for GNU default python3 exec_prefix... ${exec_prefix}
> >> >  checking for python3 script directory (pythondir)...
> >> ${libdir}/python3.11/site-packages
> >> >  checking for python3 extension module directory (pyexecdir)...
> >> ${libdir}/python3.11/site-packages
> >> >  checking for python-3.11... no
> >> >  configure: error: Package requirements (python-3.11) were not met:
> >> >
> >> >  No package 'python-3.11' found
> >> >
> >> > To bypass this, we have to manually remove in OpenBMC with this tweak:
> >> > PACKAGECONFIG:remove:pn-btrfs-tools-native = "python"

I dug into this a bit more by starting from first principles.  Building
with an unchanged poky with the crops/poky docker container works.  Just
like you would expect, `PYTHON` gets set to `python3-native/python3`:

```
# $PYTHON [3 operations]
#   set /rundir/meta/conf/bitbake.conf:574
#     "${@sys.executable}"
#   set /rundir/meta/classes-recipe/python3native.bbclass:9
#     "${STAGING_BINDIR_NATIVE}/python3-native/python3"
```

So, I did the same thing in our OpenBMC tree:

```
# $PYTHON
#   set /home/apwillia/private/dev/openbmc/openbmc/meta/conf/bitbake.conf:574
#     "${@sys.executable}"
PYTHON="/usr/lib/python-exec/python3.11/python3"
```

Somehow, `python3native.bbclass` is never inherited (also checked the
`INCLUDE HISTORY`).

The `btrfs-tools_6.8.bb` uses the new-ish `inherit_defer`, so I did some
more change there to debug:

```
- inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python', 'setuptools3-base', '', d)}
+ inherit_defer ${@bb.utils.contains('PACKAGECONFIG', 'python', 'setuptools3-base', 'this_doesnt_exist' + d.getVar('PACKAGECONFIG').replace(' ', '/'), d)}
```

This resulted in:
```
ERROR: ParseError at /home/apwillia/private/dev/openbmc/openbmc/meta/recipes-devtools/btrfs-tools/btrfs-tools_6.8.bb:46: Could not inherit file classes/this_doesnt_exist/////programs/////convert//////////crypto-builtin//.bbclass
```

So... not only are we not getting the `setuptools3-base` side of the
`inherit_defer`, but `PACKAGECONFIG` doesn't even contain `python`.
Which is not true because:

```
# pre-expansion value:
#   "     programs     convert     python     crypto-builtin "
PACKAGECONFIG="     programs     convert     python     crypto-builtin "
```

What is going on here?  Well, this:

```
meta-phosphor/conf/distro/include/phosphor-pkg-tweaks.inc
6:# Disable python from btrfs-tools
7:PACKAGECONFIG:remove:pn-btrfs-tools = "python"
```

We explicitly remove `python` from the _target_ btrfs-tools
`PACKAGECONFIG`, because we don't want it on-device (since that pulls
python itself as a side-effect).  If I remove this _target_ setting
everything works fine for the native package:

```
# $PYTHON [3 operations]
#   set /home/apwillia/private/dev/openbmc/openbmc/meta/conf/bitbake.conf:574
#     "${@sys.executable}"
#   set /home/apwillia/private/dev/openbmc/openbmc/meta/classes-recipe/python3native.bbclass:9
#     "${STAGING_BINDIR_NATIVE}/python3-native/python3"
#   exported ast.py:52 [eval]
#     [export] "1"
# pre-expansion value:
#   "${STAGING_BINDIR_NATIVE}/python3-native/python3"
export PYTHON="/home/apwillia/local/builds/lf-build-yosemite4/tmp/work/x86_64-linux/btrfs-tools-native/6.8/recipe-sysroot-native/usr/bin/python3-native/python3"
```

It seems to me like `inherit_defer` is broken.  Why is the _target_
variable being used for a _native_ recipe?

-- 
Patrick Williams

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2024-05-01 21:27 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAMWxwJ0znPDyQAKAwv8PL9GwyCCEpW9+2SDmXsygNyK26_xF-A@mail.gmail.com>
2024-04-25 12:29 ` btrfs-tools-native build python error Lean Sheng Tan
2024-04-25 16:33   ` [OE-core] " Ross Burton
2024-04-25 16:45     ` Lean Sheng Tan
     [not found]     ` <17C993B983870D20.19690@lists.openembedded.org>
2024-04-25 17:40       ` Lean Sheng Tan
2024-05-01 21:27         ` Patrick Williams [this message]
2024-05-02  9:28           ` Alexander Kanavin
2024-05-02 12:52             ` Patrick Williams
2024-05-02 12:57               ` Alexander Kanavin
2024-05-02 13:01                 ` Alexander Kanavin
2024-05-02 13:06                 ` Patrick Williams
2024-05-02 13:34                   ` Alexander Kanavin
2024-05-02 13:39                     ` Patrick Williams
2024-05-02 13:50                       ` Richard Purdie
2024-05-02 13:34                 ` Patrick Williams

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=ZjKzwmSpKmznOedr@heinlein.vulture-banana.ts.net \
    --to=patrick@stwcx.xyz \
    --cc=John.Chung@arm.com \
    --cc=Ross.Burton@arm.com \
    --cc=alexander.hansen@9elements.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=sheng.tan@9elements.com \
    /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.