diff mbox series

[2/3] perf: make scripting depend on setuptools3

Message ID ce66ad3692d01831e5f41f27702c01744a8708c5.1664904217.git.bruce.ashfield@gmail.com
State New
Headers show
Series [1/3] linux-yocto-dev: bump to v6.0+ | expand

Commit Message

Bruce Ashfield Oct. 4, 2022, 5:27 p.m. UTC
From: Bruce Ashfield <bruce.ashfield@gmail.com>

It looks like this should have been an error for a while, but it
only started showing up in my 6.x linux-yocto-dev testing.

Without the inherit of setuptool3, we get a module missing error
during configure and the build obviously fails.

Tested against 5.x and 6.x kernels.

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
---
 meta/recipes-kernel/perf/perf.bb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Ross Burton Oct. 6, 2022, 11:28 a.m. UTC | #1
On 4 Oct 2022, at 18:27, Bruce Ashfield via lists.openembedded.org <bruce.ashfield=gmail.com@lists.openembedded.org> wrote:
> -inherit ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'python3targetconfig', '', d)}
> +inherit ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'python3targetconfig setuptools3', '', d)}

For reasons, setuptools3-base does this:

RDEPENDS:${PN}:append:class-target = " ${PYTHON_PN}-core”

So buildhistory-diff says:

packages/qemuarm64-poky-linux/perf/perf: RDEPENDS: added "python3-core”

I’m guessing that isn’t what you meant.

Might be easier to :remove that RDEPENDS than faff around recreating the right dependencies.

Ross
Bruce Ashfield Oct. 6, 2022, 12:38 p.m. UTC | #2
On Thu, Oct 6, 2022 at 7:29 AM Ross Burton <Ross.Burton@arm.com> wrote:
>
> On 4 Oct 2022, at 18:27, Bruce Ashfield via lists.openembedded.org <bruce.ashfield=gmail.com@lists.openembedded.org> wrote:
> > -inherit ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'python3targetconfig', '', d)}
> > +inherit ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'python3targetconfig setuptools3', '', d)}
>
> For reasons, setuptools3-base does this:
>
> RDEPENDS:${PN}:append:class-target = " ${PYTHON_PN}-core”
>
> So buildhistory-diff says:
>
> packages/qemuarm64-poky-linux/perf/perf: RDEPENDS: added "python3-core”
>
> I’m guessing that isn’t what you meant.
>

We do need the python support on the target when perf is installed.
Isn't that what python-core provides ?

While it maybe wasn't a RDEPENDS before, it really should have been
(if python-core does provide the runtime bits for target execution).


> Might be easier to :remove that RDEPENDS than faff around recreating the right dependencies.

I can definitely do that, but I just want to understand if we do .. or
don't want python3-core appearing now.

Bruce

>
> Ross
Ross Burton Oct. 6, 2022, 1:13 p.m. UTC | #3
On 6 Oct 2022, at 13:38, Bruce Ashfield <bruce.ashfield@gmail.com> wrote:
> 
> On Thu, Oct 6, 2022 at 7:29 AM Ross Burton <Ross.Burton@arm.com> wrote:
>> 
>> On 4 Oct 2022, at 18:27, Bruce Ashfield via lists.openembedded.org <bruce.ashfield=gmail.com@lists.openembedded.org> wrote:
>>> -inherit ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'python3targetconfig', '', d)}
>>> +inherit ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'python3targetconfig setuptools3', '', d)}
>> 
>> For reasons, setuptools3-base does this:
>> 
>> RDEPENDS:${PN}:append:class-target = " ${PYTHON_PN}-core”
>> 
>> So buildhistory-diff says:
>> 
>> packages/qemuarm64-poky-linux/perf/perf: RDEPENDS: added "python3-core”
>> 
>> I’m guessing that isn’t what you meant.
>> 
> 
> We do need the python support on the target when perf is installed.
> Isn't that what python-core provides ?
> 
> While it maybe wasn't a RDEPENDS before, it really should have been
> (if python-core does provide the runtime bits for target execution).

Sure, but there’s a perf-python package that contains all of the python stuff, right? So the RDEPENDS should be there (and is already).

Ross
Bruce Ashfield Oct. 6, 2022, 1:29 p.m. UTC | #4
On Thu, Oct 6, 2022 at 9:13 AM Ross Burton <Ross.Burton@arm.com> wrote:
>
> On 6 Oct 2022, at 13:38, Bruce Ashfield <bruce.ashfield@gmail.com> wrote:
> >
> > On Thu, Oct 6, 2022 at 7:29 AM Ross Burton <Ross.Burton@arm.com> wrote:
> >>
> >> On 4 Oct 2022, at 18:27, Bruce Ashfield via lists.openembedded.org <bruce.ashfield=gmail.com@lists.openembedded.org> wrote:
> >>> -inherit ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'python3targetconfig', '', d)}
> >>> +inherit ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'python3targetconfig setuptools3', '', d)}
> >>
> >> For reasons, setuptools3-base does this:
> >>
> >> RDEPENDS:${PN}:append:class-target = " ${PYTHON_PN}-core”
> >>
> >> So buildhistory-diff says:
> >>
> >> packages/qemuarm64-poky-linux/perf/perf: RDEPENDS: added "python3-core”
> >>
> >> I’m guessing that isn’t what you meant.
> >>
> >
> > We do need the python support on the target when perf is installed.
> > Isn't that what python-core provides ?
> >
> > While it maybe wasn't a RDEPENDS before, it really should have been
> > (if python-core does provide the runtime bits for target execution).
>
> Sure, but there’s a perf-python package that contains all of the python stuff, right? So the RDEPENDS should be there (and is already).

Indeed, that's why it would have worked before.

I'm not particularly concerned if the extra RDEPENDS arrives with
this, since if it is acceptable for other packages inheriting the
setuptools (I thought it was build support only!), it really should be
ok for perf as well. In particular since perf is debug/optional. Or am
I missing something there ?

Bruce

>
> Ross
>
>
Ross Burton Oct. 6, 2022, 1:43 p.m. UTC | #5
On 6 Oct 2022, at 14:29, Bruce Ashfield <bruce.ashfield@gmail.com> wrote:
> I'm not particularly concerned if the extra RDEPENDS arrives with
> this, since if it is acceptable for other packages inheriting the
> setuptools (I thought it was build support only!), it really should be
> ok for perf as well. In particular since perf is debug/optional. Or am
> I missing something there ?

With this change the base perf package will always runtime-depend on python3, even if perf-python isn’t installed.  That sounds suboptimal.

Ross
Bruce Ashfield Oct. 6, 2022, 2:01 p.m. UTC | #6
On Thu, Oct 6, 2022 at 9:43 AM Ross Burton <Ross.Burton@arm.com> wrote:
>
> On 6 Oct 2022, at 14:29, Bruce Ashfield <bruce.ashfield@gmail.com> wrote:
> > I'm not particularly concerned if the extra RDEPENDS arrives with
> > this, since if it is acceptable for other packages inheriting the
> > setuptools (I thought it was build support only!), it really should be
> > ok for perf as well. In particular since perf is debug/optional. Or am
> > I missing something there ?
>
> With this change the base perf package will always runtime-depend on python3, even if perf-python isn’t installed.  That sounds suboptimal.
>

But is triggered on the 'scripting' packageconfig, which does mean we
want the support, so it is at least somewhat conditional .. but yes, I
agree that once we've built and packaged, it does make sense to keep
the python dependencies in the dedicated package.

Let me re-work this and do the remove of the RDEPENDS and send a v2.

Bruce


Bruce

> Ross



--
- Thou shalt not follow the NULL pointer, for chaos and madness await
thee at its end
- "Use the force Harry" - Gandalf, Star Trek II
Peter Kjellerstedt Oct. 7, 2022, 3 p.m. UTC | #7
> -----Original Message-----
> From: openembedded-core@lists.openembedded.org <openembedded-
> core@lists.openembedded.org> On Behalf Of Bruce Ashfield
> Sent: den 6 oktober 2022 16:02
> To: Ross Burton <Ross.Burton@arm.com>
> Cc: Richard Purdie <richard.purdie@linuxfoundation.org>; openembedded-
> core@lists.openembedded.org
> Subject: Re: [OE-core] [PATCH 2/3] perf: make scripting depend on
> setuptools3
> 
> On Thu, Oct 6, 2022 at 9:43 AM Ross Burton <Ross.Burton@arm.com> wrote:
> >
> > On 6 Oct 2022, at 14:29, Bruce Ashfield <bruce.ashfield@gmail.com> wrote:
> > > I'm not particularly concerned if the extra RDEPENDS arrives with
> > > this, since if it is acceptable for other packages inheriting the
> > > setuptools (I thought it was build support only!), it really should be
> > > ok for perf as well. In particular since perf is debug/optional. Or am
> > > I missing something there ?
> >
> > With this change the base perf package will always runtime-depend on
> > python3, even if perf-python isn’t installed.  That sounds suboptimal.
> >
> 
> But is triggered on the 'scripting' packageconfig, which does mean we
> want the support, so it is at least somewhat conditional .. but yes, I
> agree that once we've built and packaged, it does make sense to keep
> the python dependencies in the dedicated package.
> 
> Let me re-work this and do the remove of the RDEPENDS and send a v2.
> 
> Bruce
> 
> > Ross

To me it sounds as what setuptools3-base.bbclass really should to is 
something like:

FOOBAR ??= "${PN}"
RDEPENDS:${FOOBAR}:append:class-target = " ${PYTHON_PN}-core"
...
FILES:${FOOBAR} += "${libdir}/* ${libdir}/${PYTHON_DIR}/*"

so that the typical Python only recipes continue to just inherit 
setuptools3, but recipes that produce other packages than the 
Python package can do something like:

FOOBAR = "${PYTHON_PN}-${PN}"

Unfortunately this does not work as it results in a gazillion 
warnings like:

WARNING: .../meta-oe/recipes-support/libiio/libiio_git.bb: Variable key FILES:${PN}-${PYTHON_PN} (${PYTHON_SITEPACKAGES_DIR}) replaces original key FILES:libiio-python3 ( ${libdir}/* ${libdir}/${PYTHON_DIR}/*).
WARNING: .../meta-oe/recipes-support/libiio/libiio_git.bb: Variable key RDEPENDS:${PN}-${PYTHON_PN} (${PN} ${PYTHON_PN}-ctypes ${PYTHON_PN}-stringold ${PYTHON_PN}-core) replaces original key RDEPENDS:libiio-python3 ( ${PYTHON_PN}-core).

(I chose libiio as it is an example of another recipes that currently 
does RDEPENDS:${PN}:remove = "${PYTHON_PN}-core" to counteract what 
setuptools3-base.bbclass does).

:(

//Peter
Khem Raj Oct. 11, 2022, 2:57 a.m. UTC | #8
On Fri, Oct 7, 2022 at 8:00 AM Peter Kjellerstedt
<peter.kjellerstedt@axis.com> wrote:
>
> > -----Original Message-----
> > From: openembedded-core@lists.openembedded.org <openembedded-
> > core@lists.openembedded.org> On Behalf Of Bruce Ashfield
> > Sent: den 6 oktober 2022 16:02
> > To: Ross Burton <Ross.Burton@arm.com>
> > Cc: Richard Purdie <richard.purdie@linuxfoundation.org>; openembedded-
> > core@lists.openembedded.org
> > Subject: Re: [OE-core] [PATCH 2/3] perf: make scripting depend on
> > setuptools3
> >
> > On Thu, Oct 6, 2022 at 9:43 AM Ross Burton <Ross.Burton@arm.com> wrote:
> > >
> > > On 6 Oct 2022, at 14:29, Bruce Ashfield <bruce.ashfield@gmail.com> wrote:
> > > > I'm not particularly concerned if the extra RDEPENDS arrives with
> > > > this, since if it is acceptable for other packages inheriting the
> > > > setuptools (I thought it was build support only!), it really should be
> > > > ok for perf as well. In particular since perf is debug/optional. Or am
> > > > I missing something there ?
> > >
> > > With this change the base perf package will always runtime-depend on
> > > python3, even if perf-python isn’t installed.  That sounds suboptimal.
> > >
> >
> > But is triggered on the 'scripting' packageconfig, which does mean we
> > want the support, so it is at least somewhat conditional .. but yes, I
> > agree that once we've built and packaged, it does make sense to keep
> > the python dependencies in the dedicated package.
> >
> > Let me re-work this and do the remove of the RDEPENDS and send a v2.
> >
> > Bruce
> >
> > > Ross
>
> To me it sounds as what setuptools3-base.bbclass really should to is
> something like:
>
> FOOBAR ??= "${PN}"
> RDEPENDS:${FOOBAR}:append:class-target = " ${PYTHON_PN}-core"
> ...
> FILES:${FOOBAR} += "${libdir}/* ${libdir}/${PYTHON_DIR}/*"
>
> so that the typical Python only recipes continue to just inherit
> setuptools3, but recipes that produce other packages than the
> Python package can do something like:
>
> FOOBAR = "${PYTHON_PN}-${PN}"
>
> Unfortunately this does not work as it results in a gazillion
> warnings like:
>
> WARNING: .../meta-oe/recipes-support/libiio/libiio_git.bb: Variable key FILES:${PN}-${PYTHON_PN} (${PYTHON_SITEPACKAGES_DIR}) replaces original key FILES:libiio-python3 ( ${libdir}/* ${libdir}/${PYTHON_DIR}/*).
> WARNING: .../meta-oe/recipes-support/libiio/libiio_git.bb: Variable key RDEPENDS:${PN}-${PYTHON_PN} (${PN} ${PYTHON_PN}-ctypes ${PYTHON_PN}-stringold ${PYTHON_PN}-core) replaces original key RDEPENDS:libiio-python3 ( ${PYTHON_PN}-core).
>
> (I chose libiio as it is an example of another recipes that currently
> does RDEPENDS:${PN}:remove = "${PYTHON_PN}-core" to counteract what
> setuptools3-base.bbclass does).
>

Ran into this today too. I think you dont need all the bells and
whistles of setuptools3 class. Adding

DEPENDS += "python3-setuptools-native"

should get the job done.

> :(
>
> //Peter
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#171527): https://lists.openembedded.org/g/openembedded-core/message/171527
> Mute This Topic: https://lists.openembedded.org/mt/94118767/1997914
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [raj.khem@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Bruce Ashfield Oct. 11, 2022, 11:54 a.m. UTC | #9
On Mon, Oct 10, 2022 at 10:57 PM Khem Raj <raj.khem@gmail.com> wrote:

> On Fri, Oct 7, 2022 at 8:00 AM Peter Kjellerstedt
> <peter.kjellerstedt@axis.com> wrote:
> >
> > > -----Original Message-----
> > > From: openembedded-core@lists.openembedded.org <openembedded-
> > > core@lists.openembedded.org> On Behalf Of Bruce Ashfield
> > > Sent: den 6 oktober 2022 16:02
> > > To: Ross Burton <Ross.Burton@arm.com>
> > > Cc: Richard Purdie <richard.purdie@linuxfoundation.org>; openembedded-
> > > core@lists.openembedded.org
> > > Subject: Re: [OE-core] [PATCH 2/3] perf: make scripting depend on
> > > setuptools3
> > >
> > > On Thu, Oct 6, 2022 at 9:43 AM Ross Burton <Ross.Burton@arm.com>
> wrote:
> > > >
> > > > On 6 Oct 2022, at 14:29, Bruce Ashfield <bruce.ashfield@gmail.com>
> wrote:
> > > > > I'm not particularly concerned if the extra RDEPENDS arrives with
> > > > > this, since if it is acceptable for other packages inheriting the
> > > > > setuptools (I thought it was build support only!), it really
> should be
> > > > > ok for perf as well. In particular since perf is debug/optional.
> Or am
> > > > > I missing something there ?
> > > >
> > > > With this change the base perf package will always runtime-depend on
> > > > python3, even if perf-python isn’t installed.  That sounds
> suboptimal.
> > > >
> > >
> > > But is triggered on the 'scripting' packageconfig, which does mean we
> > > want the support, so it is at least somewhat conditional .. but yes, I
> > > agree that once we've built and packaged, it does make sense to keep
> > > the python dependencies in the dedicated package.
> > >
> > > Let me re-work this and do the remove of the RDEPENDS and send a v2.
> > >
> > > Bruce
> > >
> > > > Ross
> >
> > To me it sounds as what setuptools3-base.bbclass really should to is
> > something like:
> >
> > FOOBAR ??= "${PN}"
> > RDEPENDS:${FOOBAR}:append:class-target = " ${PYTHON_PN}-core"
> > ...
> > FILES:${FOOBAR} += "${libdir}/* ${libdir}/${PYTHON_DIR}/*"
> >
> > so that the typical Python only recipes continue to just inherit
> > setuptools3, but recipes that produce other packages than the
> > Python package can do something like:
> >
> > FOOBAR = "${PYTHON_PN}-${PN}"
> >
> > Unfortunately this does not work as it results in a gazillion
> > warnings like:
> >
> > WARNING: .../meta-oe/recipes-support/libiio/libiio_git.bb: Variable key
> FILES:${PN}-${PYTHON_PN} (${PYTHON_SITEPACKAGES_DIR}) replaces original key
> FILES:libiio-python3 ( ${libdir}/* ${libdir}/${PYTHON_DIR}/*).
> > WARNING: .../meta-oe/recipes-support/libiio/libiio_git.bb: Variable key
> RDEPENDS:${PN}-${PYTHON_PN} (${PN} ${PYTHON_PN}-ctypes
> ${PYTHON_PN}-stringold ${PYTHON_PN}-core) replaces original key
> RDEPENDS:libiio-python3 ( ${PYTHON_PN}-core).
> >
> > (I chose libiio as it is an example of another recipes that currently
> > does RDEPENDS:${PN}:remove = "${PYTHON_PN}-core" to counteract what
> > setuptools3-base.bbclass does).
> >
>
> Ran into this today too. I think you dont need all the bells and
> whistles of setuptools3 class. Adding
>
> DEPENDS += "python3-setuptools-native"
>
> should get the job done.
>

Aha. I read this after your patch email.

Worth trying this, it may clear up the AB issue we are seeing!

Bruce



>
> > :(
> >
> > //Peter
> >
> >
> > -=-=-=-=-=-=-=-=-=-=-=-
> > Links: You receive all messages sent to this group.
> > View/Reply Online (#171527):
> https://lists.openembedded.org/g/openembedded-core/message/171527
> > Mute This Topic: https://lists.openembedded.org/mt/94118767/1997914
> > Group Owner: openembedded-core+owner@lists.openembedded.org
> > Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> raj.khem@gmail.com]
> > -=-=-=-=-=-=-=-=-=-=-=-
> >
>
diff mbox series

Patch

diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index 31bc04635d..2591171eca 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -48,7 +48,7 @@  PROVIDES = "virtual/perf"
 inherit linux-kernel-base kernel-arch manpages
 
 # needed for building the tools/perf Python bindings
-inherit ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'python3targetconfig', '', d)}
+inherit ${@bb.utils.contains('PACKAGECONFIG', 'scripting', 'python3targetconfig setuptools3', '', d)}
 inherit python3-dir
 export PYTHON_SITEPACKAGES_DIR