($INBOX_DIR/description missing)
 help / color / mirror / Atom feed
* Remove Python dependency from target package only
@ 2024-01-21 18:57 Sebert, Holger.ext
  2024-01-21 22:51 ` [yocto] " Richard Purdie
  0 siblings, 1 reply; 7+ messages in thread
From: Sebert, Holger.ext @ 2024-01-21 18:57 UTC (permalink / raw
  To: yocto@lists.yoctoproject.org

Hi,

I am trying to remove the Python dependency in libxml2 for the target.
For the libxml2-native package it shall still be available, however.

I have put this into my local.conf:

    PACKAGECONFIG:remove:pn-libxml2 = "python"

When I build core-image-full-cmdline I get the following error from
the libxml2-native package:

| configure: error: Package requirements (python-3.8) were not met:
|
| No package 'python-3.8' found
|
| Consider adjusting the PKG_CONFIG_PATH environment variable if you
| installed software in a non-standard prefix.
|
| Alternatively, you may set the environment variables PYTHON_CFLAGS
| and PYTHON_LIBS to avoid the need to call pkg-config.
| See the pkg-config man page for more details.
| NOTE: The following config.log files may provide further information.
| NOTE: /home/hosebert.ext/data/poky-python-getvar/build/tmp/work/x86_64-linux/libxml2-native/2.11.5/build/config.log
| ERROR: configure failed
| WARNING: /home/hosebert.ext/data/poky-python-getvar/build/tmp/work/x86_64-linux/libxml2-native/2.11.5/temp/run.do_configure.453112:287 exit 1 from 'exit 1'
| WARNING: Backtrace (BB generated script):
|       #1: bbfatal_log, /home/hosebert.ext/data/poky-python-getvar/build/tmp/work/x86_64-linux/libxml2-native/2.11.5/temp/run.do_configure.453112, line 287
|       #2: oe_runconf, /home/hosebert.ext/data/poky-python-getvar/build/tmp/work/x86_64-linux/libxml2-native/2.11.5/temp/run.do_configure.453112, line 263
|       #3: autotools_do_configure, /home/hosebert.ext/data/poky-python-getvar/build/tmp/work/x86_64-linux/libxml2-native/2.11.5/temp/run.do_configure.453112, line 233
|       #4: do_configure, /home/hosebert.ext/data/poky-python-getvar/build/tmp/work/x86_64-linux/libxml2-native/2.11.5/temp/run.do_configure.453112, line 153
|       #5: main, /home/hosebert.ext/data/poky-python-getvar/build/tmp/work/x86_64-linux/libxml2-native/2.11.5/temp/run.do_configure.453112, line 291
ERROR: Task (virtual:native:/home/hosebert.ext/data/poky-python-getvar/meta/recipes-core/libxml/libxml2_2.11.5.bb:do_configure) failed with exit code '1'

So it seems libxml2-native cannot find Python anymore!

When investigating the problem, I found the following using
bitbake-getvar:

$ bitbake-getvar -r libxml2-native PYTHON
#
# $PYTHON
#   set /home/hosebert.ext/data/poky-python-getvar/meta/conf/bitbake.conf:575
#     "${@sys.executable}"
PYTHON="/usr/bin/python3"

So libxml2-native is trying to use my host's Python installation and
not the one in build/tmp/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/bin/python3-native/python3
as it should be?

On a pristine Poky system bitbake-getvar gives the following:

$ bitbake-getvar -r libxml2-native PYTHON
#
# $PYTHON [3 operations]
#   set /home/hosebert.ext/data/poky-python-getvar/meta/conf/bitbake.conf:575
#     "${@sys.executable}"
#   set /home/hosebert.ext/data/poky-python-getvar/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/hosebert.ext/data/poky-python-getvar/build/tmp/work/x86_64-linux/libxml2-native/2.11.5/recipe-sysroot-native/usr/bin/python3-native/python3"

So, what is the proper way of removing Python from a target package?

Best,
Holger


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] Remove Python dependency from target package only
  2024-01-21 18:57 Remove Python dependency from target package only Sebert, Holger.ext
@ 2024-01-21 22:51 ` Richard Purdie
  2024-01-22 13:33   ` Sebert, Holger.ext
  0 siblings, 1 reply; 7+ messages in thread
From: Richard Purdie @ 2024-01-21 22:51 UTC (permalink / raw
  To: yocto, holger.sebert.ext

On Sun, 2024-01-21 at 18:57 +0000, Sebert, Holger.ext wrote:
> Hi,
> 
> I am trying to remove the Python dependency in libxml2 for the target.
> For the libxml2-native package it shall still be available, however.
> 
> I have put this into my local.conf:
> 
>     PACKAGECONFIG:remove:pn-libxml2 = "python"

Try:

PACKAGECONFIG:remove:class-target:pn-libxml2 = "python"

Cheers,

Richard


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] Remove Python dependency from target package only
  2024-01-21 22:51 ` [yocto] " Richard Purdie
@ 2024-01-22 13:33   ` Sebert, Holger.ext
  2024-01-22 13:40     ` Quentin Schulz
  0 siblings, 1 reply; 7+ messages in thread
From: Sebert, Holger.ext @ 2024-01-22 13:33 UTC (permalink / raw
  To: Richard Purdie, yocto@lists.yoctoproject.org

Hi Richard,

Von: Richard Purdie <richard.purdie@linuxfoundation.org>
> Try:
> 
> PACKAGECONFIG:remove:class-target:pn-libxml2 = "python"
> 

Tried it, but same error appears (“Python not found” in libxml2-native).

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] Remove Python dependency from target package only
  2024-01-22 13:33   ` Sebert, Holger.ext
@ 2024-01-22 13:40     ` Quentin Schulz
  2024-01-22 13:47       ` Alexander Kanavin
  2024-01-23 21:58       ` AW: " Sebert, Holger.ext
  0 siblings, 2 replies; 7+ messages in thread
From: Quentin Schulz @ 2024-01-22 13:40 UTC (permalink / raw
  To: yocto, holger.sebert.ext, Richard Purdie

Hi Holger,

On 1/22/24 14:33, Sebert, Holger.ext via lists.yoctoproject.org wrote:
> [You don't often get email from holger.sebert.ext=karlstorz.com@lists.yoctoproject.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> 
> Hi Richard,
> 
> Von: Richard Purdie <richard.purdie@linuxfoundation.org>
>> Try:
>>
>> PACKAGECONFIG:remove:class-target:pn-libxml2 = "python"
>>
> 
> Tried it, but same error appears (“Python not found” in libxml2-native).
> 

What does
bitbake-getvar -r libxml2-native PACKAGECONFIG
and
bitbake-getvar -r libxml2 PACKAGECONFIG

return?

I'm not entirely sure if the former will work since bitbake-getvar 
expects a recipe and libxml2 isn't reaaaaally a recipe on its own.

If the former doesn't work, we need to check for 
PACKAGECONFIG:class-native and PACKAGECONFIG:class-target in 
bitbake-getvar -r libxml2 PACKAGECONFIG to debug this further.

Cheers,
Quentin


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [yocto] Remove Python dependency from target package only
  2024-01-22 13:40     ` Quentin Schulz
@ 2024-01-22 13:47       ` Alexander Kanavin
  2024-01-23 21:58       ` AW: " Sebert, Holger.ext
  1 sibling, 0 replies; 7+ messages in thread
From: Alexander Kanavin @ 2024-01-22 13:47 UTC (permalink / raw
  To: yocto, quentin.schulz; +Cc: holger.sebert.ext, Richard Purdie

I would suggest not trying to figure out PACKAGECONFIGs just yet, but
rather go to the source of the error: inspect ${T}/log.do_configure
and ${T}/run.do_configure. Are options to enable/disable python passed
in? If yes, then something in PACKAGECONFIG settings doesn't quite
work. If no, then libxml somehow needs python at build time even
without those options, and this should be looked at separately by
checking in libxml source code what the failing check for python
actually does, and is it guarded by any options.


Alex

On Mon, 22 Jan 2024 at 14:40, Quentin Schulz via
lists.yoctoproject.org
<quentin.schulz=theobroma-systems.com@lists.yoctoproject.org> wrote:
>
> Hi Holger,
>
> On 1/22/24 14:33, Sebert, Holger.ext via lists.yoctoproject.org wrote:
> > [You don't often get email from holger.sebert.ext=karlstorz.com@lists.yoctoproject.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> >
> > Hi Richard,
> >
> > Von: Richard Purdie <richard.purdie@linuxfoundation.org>
> >> Try:
> >>
> >> PACKAGECONFIG:remove:class-target:pn-libxml2 = "python"
> >>
> >
> > Tried it, but same error appears (“Python not found” in libxml2-native).
> >
>
> What does
> bitbake-getvar -r libxml2-native PACKAGECONFIG
> and
> bitbake-getvar -r libxml2 PACKAGECONFIG
>
> return?
>
> I'm not entirely sure if the former will work since bitbake-getvar
> expects a recipe and libxml2 isn't reaaaaally a recipe on its own.
>
> If the former doesn't work, we need to check for
> PACKAGECONFIG:class-native and PACKAGECONFIG:class-target in
> bitbake-getvar -r libxml2 PACKAGECONFIG to debug this further.
>
> Cheers,
> Quentin
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#62220): https://lists.yoctoproject.org/g/yocto/message/62220
> Mute This Topic: https://lists.yoctoproject.org/mt/103871920/1686489
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>


^ permalink raw reply	[flat|nested] 7+ messages in thread

* AW:  Re: [yocto] Remove Python dependency from target package only
  2024-01-22 13:40     ` Quentin Schulz
  2024-01-22 13:47       ` Alexander Kanavin
@ 2024-01-23 21:58       ` Sebert, Holger.ext
  2024-01-23 22:05         ` Richard Purdie
  1 sibling, 1 reply; 7+ messages in thread
From: Sebert, Holger.ext @ 2024-01-23 21:58 UTC (permalink / raw
  To: Quentin Schulz, yocto@lists.yoctoproject.org, Richard Purdie

Hi Quentin,

________________________________________
Von: Quentin Schulz <quentin.schulz@theobroma-systems.com>

> What does
> bitbake-getvar -r libxml2-native PACKAGECONFIG
> and
> bitbake-getvar -r libxml2 PACKAGECONFIG
> 
> return?

Here is the output of the respective commands:

$ bitbake-getvar -r libxml2-native PACKAGECONFIG
#
# $PACKAGECONFIG [6 operations]
#   :append[pn-qemu-system-native] /home/hosebert.ext/data/poky-python-getvar/build/conf/local.conf:251
#     " sdl"
#   :remove[class-target:pn-libxml2] /home/hosebert.ext/data/poky-python-getvar/build/conf/local.conf:292
#     "python"
#   set /home/hosebert.ext/data/poky-python-getvar/meta/conf/documentation.conf:320
#     [doc] "This variable provides a means of enabling or disabling features of a recipe on a per-recipe basis."
#   set /home/hosebert.ext/data/poky-python-getvar/meta/recipes-core/libxml/libxml2_2.11.5.bb:32
#     [_defaultval] "python     ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} "
#   set /home/hosebert.ext/data/poky-python-getvar/meta/recipes-core/libxml/libxml2_2.11.5.bb:33
#     [python] "--with-python=${PYTHON},--without-python,python3"
#   set /home/hosebert.ext/data/poky-python-getvar/meta/recipes-core/libxml/libxml2_2.11.5.bb:34
#     [ipv6] "--enable-ipv6,--disable-ipv6,"
# pre-expansion value:
#   "python     ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} "
PACKAGECONFIG="python     ipv6 "

$ bitbake-getvar -r libxml2 PACKAGECONFIG
#
# $PACKAGECONFIG [6 operations]
#   :append[pn-qemu-system-native] /home/hosebert.ext/data/poky-python-getvar/build/conf/local.conf:251
#     " sdl"
#   :remove[class-target:pn-libxml2] /home/hosebert.ext/data/poky-python-getvar/build/conf/local.conf:292
#     "python"
#   set /home/hosebert.ext/data/poky-python-getvar/meta/conf/documentation.conf:320
#     [doc] "This variable provides a means of enabling or disabling features of a recipe on a per-recipe basis."
#   set /home/hosebert.ext/data/poky-python-getvar/meta/recipes-core/libxml/libxml2_2.11.5.bb:32
#     [_defaultval] "python     ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} "
#   set /home/hosebert.ext/data/poky-python-getvar/meta/recipes-core/libxml/libxml2_2.11.5.bb:33
#     [python] "--with-python=${PYTHON},--without-python,python3"
#   set /home/hosebert.ext/data/poky-python-getvar/meta/recipes-core/libxml/libxml2_2.11.5.bb:34
#     [ipv6] "--enable-ipv6,--disable-ipv6,"
# pre-expansion value:
#   "python     ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} "
PACKAGECONFIG="     ipv6 "

So ... PACKAGECONFIG seems o.k. Notice, however, that the value of the PYTHON variable is incorrect:

$ bitbake-getvar -r libxml2-native PYTHON
#
# $PYTHON
#   set /home/hosebert.ext/data/poky-python-getvar/meta/conf/bitbake.conf:575
#     "${@sys.executable}"
PYTHON="/usr/bin/python3"

It points to the host's Python installation and not the one in Yocto!

Best,
Holger

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: AW:  Re: [yocto] Remove Python dependency from target package only
  2024-01-23 21:58       ` AW: " Sebert, Holger.ext
@ 2024-01-23 22:05         ` Richard Purdie
  0 siblings, 0 replies; 7+ messages in thread
From: Richard Purdie @ 2024-01-23 22:05 UTC (permalink / raw
  To: Sebert, Holger.ext, Quentin Schulz, yocto@lists.yoctoproject.org

On Tue, 2024-01-23 at 21:58 +0000, Sebert, Holger.ext wrote:
> Hi Quentin,
> 
> ________________________________________
> Von: Quentin Schulz <quentin.schulz@theobroma-systems.com>
> 
> > What does
> > bitbake-getvar -r libxml2-native PACKAGECONFIG
> > and
> > bitbake-getvar -r libxml2 PACKAGECONFIG
> > 
> > return?
> 
> Here is the output of the respective commands:
> 
> $ bitbake-getvar -r libxml2-native PACKAGECONFIG
> #
> # $PACKAGECONFIG [6 operations]
> #   :append[pn-qemu-system-native] /home/hosebert.ext/data/poky-python-getvar/build/conf/local.conf:251
> #     " sdl"
> #   :remove[class-target:pn-libxml2] /home/hosebert.ext/data/poky-python-getvar/build/conf/local.conf:292
> #     "python"
> #   set /home/hosebert.ext/data/poky-python-getvar/meta/conf/documentation.conf:320
> #     [doc] "This variable provides a means of enabling or disabling features of a recipe on a per-recipe basis."
> #   set /home/hosebert.ext/data/poky-python-getvar/meta/recipes-core/libxml/libxml2_2.11.5.bb:32
> #     [_defaultval] "python     ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} "
> #   set /home/hosebert.ext/data/poky-python-getvar/meta/recipes-core/libxml/libxml2_2.11.5.bb:33
> #     [python] "--with-python=${PYTHON},--without-python,python3"
> #   set /home/hosebert.ext/data/poky-python-getvar/meta/recipes-core/libxml/libxml2_2.11.5.bb:34
> #     [ipv6] "--enable-ipv6,--disable-ipv6,"
> # pre-expansion value:
> #   "python     ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} "
> PACKAGECONFIG="python     ipv6 "
> 
> $ bitbake-getvar -r libxml2 PACKAGECONFIG
> #
> # $PACKAGECONFIG [6 operations]
> #   :append[pn-qemu-system-native] /home/hosebert.ext/data/poky-python-getvar/build/conf/local.conf:251
> #     " sdl"
> #   :remove[class-target:pn-libxml2] /home/hosebert.ext/data/poky-python-getvar/build/conf/local.conf:292
> #     "python"
> #   set /home/hosebert.ext/data/poky-python-getvar/meta/conf/documentation.conf:320
> #     [doc] "This variable provides a means of enabling or disabling features of a recipe on a per-recipe basis."
> #   set /home/hosebert.ext/data/poky-python-getvar/meta/recipes-core/libxml/libxml2_2.11.5.bb:32
> #     [_defaultval] "python     ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} "
> #   set /home/hosebert.ext/data/poky-python-getvar/meta/recipes-core/libxml/libxml2_2.11.5.bb:33
> #     [python] "--with-python=${PYTHON},--without-python,python3"
> #   set /home/hosebert.ext/data/poky-python-getvar/meta/recipes-core/libxml/libxml2_2.11.5.bb:34
> #     [ipv6] "--enable-ipv6,--disable-ipv6,"
> # pre-expansion value:
> #   "python     ${@bb.utils.filter('DISTRO_FEATURES', 'ipv6', d)} "
> PACKAGECONFIG="     ipv6 "
> 
> So ... PACKAGECONFIG seems o.k. Notice, however, that the value of the PYTHON variable is incorrect:
> 
> $ bitbake-getvar -r libxml2-native PYTHON
> #
> # $PYTHON
> #   set /home/hosebert.ext/data/poky-python-getvar/meta/conf/bitbake.conf:575
> #     "${@sys.executable}"
> PYTHON="/usr/bin/python3"
> 
> It points to the host's Python installation and not the one in Yocto!

I suspect this is related to:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=15361

and there is an explanation of what is happening there. I'm not
entirely happy about the behaviour of class- overrides and
inherit_defer but I'm not sure what to do about it.

Cheers,

Richard




^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-01-23 22:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-21 18:57 Remove Python dependency from target package only Sebert, Holger.ext
2024-01-21 22:51 ` [yocto] " Richard Purdie
2024-01-22 13:33   ` Sebert, Holger.ext
2024-01-22 13:40     ` Quentin Schulz
2024-01-22 13:47       ` Alexander Kanavin
2024-01-23 21:58       ` AW: " Sebert, Holger.ext
2024-01-23 22:05         ` Richard Purdie

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).