Skip to contentSkip to conversation

Revert "python3-ctypes: depend on ldconfig only if distro-feature set"

PATCH In review [email protected] 4 participants 16 messages Feb 20, 2025 – Mar 3, 2025 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Revert "python3-ctypes: depend on ldconfig only if distro-feature set"

From: Changqing Li <[email protected]>

In oe-core, function ldconfig_postinst_fragment use exist of /sbin/ldconfig to decide if ldconfig is runned to generate the cache, and function _run_ldconfig will run ldconfig to generate cache during generate rootfs. ldconfig.service is actually not used since we have generate ld.so.cache during do_rootfs, refer[1][2][3]. ldconfig dependency is necessary when ldconfig not in DISTRO_FEATURES.

The reverted commit causes regression when ldconfig not in DISTRO_FEATURES, before, without ldconfig in DISTRO_FEATURES, ctypes.util.find_library(name) can find the lib if it is installed, now, since ldconfig is not installed, ctypes.util.find_library(name) cannot find the lib even if it is installed.

Here is one usecase(gtk+3 lib is installed, ctypes.util.find_library
used to find the lib):
import wx.lib.wxcairo as wxcairo
File "/usr/lib/python3.13/site-packages/wx/lib/wxcairo/{}init{}.py", line 59, in <module>
from .wx_cairocffi import _ContextFromDC, _FontFaceFromFont
File "/usr/lib/python3.13/site-packages/wx/lib/wxcairo/wx_cairocffi.py", line 189, in <module>
gdkLib = _findGDKLib()
File "/usr/lib/python3.13/site-packages/wx/lib/wxcairo/wx_cairocffi.py", line 181, in _findGDKLib
return _findHelper([libname], 'gdk',
"Unable to find the GDK shared library")
File "/usr/lib/python3.13/site-packages/wx/lib/wxcairo/wx_cairocffi.py", line 170, in _findHelper
raise RuntimeError(msg)
RuntimeError: Unable to find the GDK shared library

[1] https://git.openembedded.org/openembedded-core/tree/meta/classes-global/package.bbclass#n394
[2] https://git.openembedded.org/openembedded-core/tree/meta/lib/oe/rootfs.py#n316
[3] https://github.com/systemd/systemd-stable/blob/v255-stable/units/ldconfig.service

---
 meta/recipes-devtools/python/python3_3.13.2.bb | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
meta/recipes-devtools/python/python3_3.13.2.bb +1 -3
index 52fac76c00..f64d67da89 100644
@@ -477,9 +477,7 @@ FILES:${PN}-man = "${datadir}/man"
 
 # See https://bugs.python.org/issue18748 and https://bugs.python.org/issue37395
 RDEPENDS:libpython3:append:libc-glibc = " libgcc"
-RDEPENDS:${PN}-ctypes:append:libc-glibc = "\
-    ${@bb.utils.contains('DISTRO_FEATURES', 'ldconfig', '${MLPREFIX}ldconfig', '', d)} \
-"
+RDEPENDS:${PN}-ctypes:append:libc-glibc = " ${MLPREFIX}ldconfig"
 RDEPENDS:${PN}-ptest = "\
     ${PN}-dev \
     ${PN}-modules \
Signature · 1 line
2.34.1
#1 lore raw
Quoted 29 lines · Changqing Li via lists.openembedded.org

From: Changqing Li <[email protected]>

In oe-core, function ldconfig_postinst_fragment use exist of /sbin/ldconfig to decide if ldconfig is runned to generate the cache, and function _run_ldconfig will run ldconfig to generate cache during generate rootfs. ldconfig.service is actually not used since we have generate ld.so.cache during do_rootfs, refer[1][2][3]. ldconfig dependency is necessary when ldconfig not in DISTRO_FEATURES.

The reverted commit causes regression when ldconfig not in DISTRO_FEATURES, before, without ldconfig in DISTRO_FEATURES, ctypes.util.find_library(name) can find the lib if it is installed, now, since ldconfig is not installed, ctypes.util.find_library(name) cannot find the lib even if it is installed.

Here is one usecase(gtk+3 lib is installed, ctypes.util.find_library
used to find the lib):
import wx.lib.wxcairo as wxcairo
File "/usr/lib/python3.13/site-packages/wx/lib/wxcairo/{}init{}.py", line 59, in <module>
from .wx_cairocffi import _ContextFromDC, _FontFaceFromFont
File "/usr/lib/python3.13/site-packages/wx/lib/wxcairo/wx_cairocffi.py", line 189, in <module>
gdkLib = _findGDKLib()
File "/usr/lib/python3.13/site-packages/wx/lib/wxcairo/wx_cairocffi.py", line 181, in _findGDKLib
return _findHelper([libname], 'gdk',
"Unable to find the GDK shared library")
File "/usr/lib/python3.13/site-packages/wx/lib/wxcairo/wx_cairocffi.py", line 170, in _findHelper
raise RuntimeError(msg)
RuntimeError: Unable to find the GDK shared library

Quoted 6 lines

[1] https://git.openembedded.org/openembedded-core/tree/meta/classes-global/package.bbclass#n394
[2] https://git.openembedded.org/openembedded-core/tree/meta/lib/oe/rootfs.py#n316
[3] https://github.com/systemd/systemd-stable/blob/v255-stable/units/ldconfig.service

---

Hi,

Thanks for your patch. However, I believe this is introducing some
regression: I've got some ptest failures on the autobuilder:

AssertionError:
Failed ptests:
{'python3': ['test_timerfd_TFD_TIMER_ABSTIME', 'python3']}

https://autobuilder.yoctoproject.org/valkyrie/#/builders/73/builds/992

You can get some more advanced about ptest failures in there:

https://valkyrie.yocto.io/pub/non-release/20250221-33/testresults/qemux86-64-ptest/core-image-ptest-python3/

Can you have a look at this issue please?

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#2 lore raw
Quoted 48 lines · Mathieu Dubois-Briand

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Quoted 29 lines · Changqing Li via lists.openembedded.org

From: Changqing Li<[email protected]>

In oe-core, function ldconfig_postinst_fragment use exist of /sbin/ldconfig to decide if ldconfig is runned to generate the cache, and function _run_ldconfig will run ldconfig to generate cache during generate rootfs. ldconfig.service is actually not used since we have generate ld.so.cache during do_rootfs, refer[1][2][3]. ldconfig dependency is necessary when ldconfig not in DISTRO_FEATURES.

The reverted commit causes regression when ldconfig not in DISTRO_FEATURES, before, without ldconfig in DISTRO_FEATURES, ctypes.util.find_library(name) can find the lib if it is installed, now, since ldconfig is not installed, ctypes.util.find_library(name) cannot find the lib even if it is installed.

Here is one usecase(gtk+3 lib is installed, ctypes.util.find_library
used to find the lib):
import wx.lib.wxcairo as wxcairo
File "/usr/lib/python3.13/site-packages/wx/lib/wxcairo/{}init{}.py", line 59, in <module>
from .wx_cairocffi import _ContextFromDC, _FontFaceFromFont
File "/usr/lib/python3.13/site-packages/wx/lib/wxcairo/wx_cairocffi.py", line 189, in <module>
gdkLib = _findGDKLib()
File "/usr/lib/python3.13/site-packages/wx/lib/wxcairo/wx_cairocffi.py", line 181, in _findGDKLib
return _findHelper([libname], 'gdk',
"Unable to find the GDK shared library")
File "/usr/lib/python3.13/site-packages/wx/lib/wxcairo/wx_cairocffi.py", line 170, in _findHelper
raise RuntimeError(msg)
RuntimeError: Unable to find the GDK shared library

Quoted 6 lines

[1]https://git.openembedded.org/openembedded-core/tree/meta/classes-global/package.bbclass#n394 [2]https://git.openembedded.org/openembedded-core/tree/meta/lib/oe/rootfs.py#n316 [3]https://github.com/systemd/systemd-stable/blob/v255-stable/units/ldconfig.service

---

Hi,

Thanks for your patch. However, I believe this is introducing some
regression: I've got some ptest failures on the autobuilder:

AssertionError:
Failed ptests:
{'python3': ['test_timerfd_TFD_TIMER_ABSTIME', 'python3']}

Quoted 7 lines

https://autobuilder.yoctoproject.org/valkyrie/#/builders/73/builds/992

You can get some more advanced about ptest failures in there:

https://valkyrie.yocto.io/pub/non-release/20250221-33/testresults/qemux86-64-ptest/core-image-ptest-python3/

Can you have a look at this issue please?

Sure. I will check this.

Regards

Changqing

Quoted 6 lines

--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 57 lines · Changqing Li via lists.openembedded.org
Quoted 54 lines · Mathieu Dubois-Briand

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Quoted 29 lines · Changqing Li via lists.openembedded.org

From: Changqing Li<[email protected]>

In oe-core, function ldconfig_postinst_fragment use exist of /sbin/ldconfig to decide if ldconfig is runned to generate the cache, and function _run_ldconfig will run ldconfig to generate cache during generate rootfs. ldconfig.service is actually not used since we have generate ld.so.cache during do_rootfs, refer[1][2][3]. ldconfig dependency is necessary when ldconfig not in DISTRO_FEATURES.

The reverted commit causes regression when ldconfig not in DISTRO_FEATURES, before, without ldconfig in DISTRO_FEATURES, ctypes.util.find_library(name) can find the lib if it is installed, now, since ldconfig is not installed, ctypes.util.find_library(name) cannot find the lib even if it is installed.

Here is one usecase(gtk+3 lib is installed, ctypes.util.find_library
used to find the lib):
import wx.lib.wxcairo as wxcairo
File "/usr/lib/python3.13/site-packages/wx/lib/wxcairo/{}init{}.py", line 59, in <module>
from .wx_cairocffi import _ContextFromDC, _FontFaceFromFont
File "/usr/lib/python3.13/site-packages/wx/lib/wxcairo/wx_cairocffi.py", line 189, in <module>
gdkLib = _findGDKLib()
File "/usr/lib/python3.13/site-packages/wx/lib/wxcairo/wx_cairocffi.py", line 181, in _findGDKLib
return _findHelper([libname], 'gdk',
"Unable to find the GDK shared library")
File "/usr/lib/python3.13/site-packages/wx/lib/wxcairo/wx_cairocffi.py", line 170, in _findHelper
raise RuntimeError(msg)
RuntimeError: Unable to find the GDK shared library

Quoted 6 lines

[1]https://git.openembedded.org/openembedded-core/tree/meta/classes-global/package.bbclass#n394 [2]https://git.openembedded.org/openembedded-core/tree/meta/lib/oe/rootfs.py#n316 [3]https://github.com/systemd/systemd-stable/blob/v255-stable/units/ldconfig.service

---

Hi,

Thanks for your patch. However, I believe this is introducing some
regression: I've got some ptest failures on the autobuilder:

AssertionError:
Failed ptests:
{'python3': ['test_timerfd_TFD_TIMER_ABSTIME', 'python3']}

https://autobuilder.yoctoproject.org/valkyrie/#/builders/73/builds/992

You can get some more advanced about ptest failures in there:

https://valkyrie.yocto.io/pub/non-release/20250221-33/testresults/qemux86-64-ptest/core-image-ptest-python3/

Quoted 8 lines
Quoted 1 line

Can you have a look at this issue please?

Sure. I will check this.

Regards

Changqing

Hi, Mathieu

I cannot reproduce this ptest failure on my host. No failure of test_timerfd_TFD_TIMER_ABSTIME in log.do_testimage. and the result is:

RESULTS - parselogs.ParseLogsTest.test_get_context: PASSED (0.00s) RESULTS - parselogs.ParseLogsTest.test_parselogs: PASSED (2.71s) RESULTS - ping.PingTest.test_ping: PASSED (0.02s) RESULTS - ssh.SSHTest.test_ssh: PASSED (0.56s) RESULTS - ptest.PtestRunnerTest.test_ptestrunner_expectsuccess: SKIPPED (0.00s) RESULTS - ptest.PtestRunnerTest.test_ptestrunner_expectfail: EXPECTEDFAIL (4455.53s) SUMMARY: core-image-ptest-python3 () - Ran 6 tests in 4458.839s core-image-ptest-python3 - OK - All required tests passed (successes=4, skipped=1, failures=0, errors=0) DEBUG: Python function do_testimage finished

And I checked https://valkyrie.yocto.io/pub/non-release/20250221-33/testresults/qemux86-64-ptest/core-image-ptest-python3/,

there is no AssertionError in log.do_testimage.2624139.20250221054435 <https://valkyrie.yocto.io/pub/non-release/20250221-33/testresults/qemux86-64-ptest/core-image-ptest-python3/log.do_testimage.2624139.20250221054435>.

So I checked test_timerfd_TFD_TIMER_ABSTIME, refer [1]. Seems like this is not related to my changes.

My commit changes RDEPENDS for package pthon3-ctype, and this is actually no influence for poky, since poky enable distro_feature ldconfig by default.

There are some similar timerfd issue in upstream python, I guess maybe this is an intermittent failure of python13

[1] https://github.com/python/cpython/blob/main/Lib/test/test_os.py#L4402

[2] https://github.com/python/cpython/issues/126112

Regards
Changqing

Quoted 14 lines
Quoted 5 lines

--
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#211834):https://lists.openembedded.org/g/openembedded-core/message/211834 Mute This Topic:https://lists.openembedded.org/mt/111283758/3616873
Group Owner:[email protected] Unsubscribe:https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#5 lore raw
Quoted 35 lines · Changqing Li

On 2/24/25 08:27, Changqing Li via lists.openembedded.org wrote:
Hi, Mathieu

I cannot reproduce this ptest failure on my host. No failure of test_timerfd_TFD_TIMER_ABSTIME in log.do_testimage. and the result is:

RESULTS - parselogs.ParseLogsTest.test_get_context: PASSED (0.00s) RESULTS - parselogs.ParseLogsTest.test_parselogs: PASSED (2.71s) RESULTS
- ping.PingTest.test_ping: PASSED (0.02s) RESULTS - ssh.SSHTest.test_ssh: PASSED (0.56s) RESULTS - ptest.PtestRunnerTest.test_ptestrunner_expectsuccess: SKIPPED (0.00s) RESULTS - ptest.PtestRunnerTest.test_ptestrunner_expectfail:
EXPECTEDFAIL (4455.53s) SUMMARY: core-image-ptest-python3 () - Ran 6 tests in 4458.839s core-image-ptest-python3 - OK - All required tests passed (successes=4, skipped=1, failures=0, errors=0) DEBUG: Python function do_testimage finished

And I checked
https://valkyrie.yocto.io/pub/non-release/20250221-33/testresults/qemux86-64-ptest/core-image-ptest-python3/,

there is no AssertionError in log.do_testimage.2624139.20250221054435
<https://valkyrie.yocto.io/pub/non-release/20250221-33/testresults/qemux86-64-ptest/core-image-ptest-python3/log.do_testimage.2624139.20250221054435>.

So I checked test_timerfd_TFD_TIMER_ABSTIME, refer [1]. Seems like this is not related to my changes.

My commit changes RDEPENDS for package pthon3-ctype, and this is actually no influence for poky, since poky enable distro_feature ldconfig by default.

There are some similar timerfd issue in upstream python, I guess maybe this is an intermittent failure of python13

Quoted 6 lines

[1] https://github.com/python/cpython/blob/main/Lib/test/test_os.py#L4402

[2] https://github.com/python/cpython/issues/126112

Regards
Changqing

Hi Changqing,

Thanks for testing. This might be a intermittent failure, but I believe we never saw this one before.

I will add back this patch in my branch and let's see how it goes!

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw
Quoted 43 lines · Mathieu Dubois-Briand via lists.openembedded.org
Quoted 35 lines · Changqing Li

On 2/24/25 08:27, Changqing Li via lists.openembedded.org wrote:
Hi, Mathieu

I cannot reproduce this ptest failure on my host. No failure of test_timerfd_TFD_TIMER_ABSTIME in log.do_testimage. and the result is:

RESULTS - parselogs.ParseLogsTest.test_get_context: PASSED (0.00s) RESULTS - parselogs.ParseLogsTest.test_parselogs: PASSED (2.71s) RESULTS
- ping.PingTest.test_ping: PASSED (0.02s) RESULTS - ssh.SSHTest.test_ssh: PASSED (0.56s) RESULTS - ptest.PtestRunnerTest.test_ptestrunner_expectsuccess: SKIPPED (0.00s) RESULTS - ptest.PtestRunnerTest.test_ptestrunner_expectfail:
EXPECTEDFAIL (4455.53s) SUMMARY: core-image-ptest-python3 () - Ran 6 tests in 4458.839s core-image-ptest-python3 - OK - All required tests passed (successes=4, skipped=1, failures=0, errors=0) DEBUG: Python function do_testimage finished

And I checked
https://valkyrie.yocto.io/pub/non-release/20250221-33/testresults/qemux86-64-ptest/core-image-ptest-python3/,

there is no AssertionError in log.do_testimage.2624139.20250221054435
<https://valkyrie.yocto.io/pub/non-release/20250221-33/testresults/qemux86-64-ptest/core-image-ptest-python3/log.do_testimage.2624139.20250221054435>.

So I checked test_timerfd_TFD_TIMER_ABSTIME, refer [1]. Seems like this is not related to my changes.

My commit changes RDEPENDS for package pthon3-ctype, and this is actually no influence for poky, since poky enable distro_feature ldconfig by default.

There are some similar timerfd issue in upstream python, I guess maybe this is an intermittent failure of python13

Quoted 6 lines

[1] https://github.com/python/cpython/blob/main/Lib/test/test_os.py#L4402

[2] https://github.com/python/cpython/issues/126112

Regards
Changqing

Quoted 6 lines

Hi Changqing,

Thanks for testing. This might be a intermittent failure, but I believe we never saw this one before.

I will add back this patch in my branch and let's see how it goes!

Hi Changqing,

I confirm I added this back and now it's working. So it might be some new AB-INT issue, nothing is wrong with your patch from the autobuilder perspective.

Thanks for your time.

Signature · 3 lines
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#8 lore raw
In reply to [email protected]

Changqing Li via lists.openembedded.org schrieb am Do 20. Feb, 11:57 (+0800):

Quoted 3 lines

The reverted commit causes regression when ldconfig not in DISTRO_FEATURES, before, without ldconfig in DISTRO_FEATURES, ctypes.util.find_library(name) can find the lib if it is installed,

Hello Changqing Li,

Did I understand correctly that gtk+3 was found before, indent of ldconfig was in der DISTRO_FEATURES? But after the change, if fails.

Where is libgdk installed? In /usr/lib or somewhere else?

Bye, Jörg

Signature · 6 lines
Navimatix GmbH           T: 03641 - 327 99 0
Tatzendpromenade 2       F: 03641 - 526 306
07745 Jena               www.navimatix.de

Geschäftsführer: Steffen Späthe, Jan Rommeley
Registergericht: Amtsgericht Jena, HRB 501480
#9 lore raw
Quoted 7 lines · Jörg Sommer

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Changqing Li via lists.openembedded.org schrieb am Do 20. Feb, 11:57 (+0800):

Quoted 3 lines

The reverted commit causes regression when ldconfig not in DISTRO_FEATURES, before, without ldconfig in DISTRO_FEATURES, ctypes.util.find_library(name) can find the lib if it is installed,

Quoted 6 lines

Hello Changqing Li,

Did I understand correctly that gtk+3 was found before, indent of ldconfig was in der DISTRO_FEATURES? But after the change, if fails.

Where is libgdk installed? In /usr/lib or somewhere else?

Hi,

libgtk is under /usr/lib. See:

root@qemux86-64:~# ldconfig -p | grep gtk-3

libgtk-3.so.0 (libc6,x86-64) => /usr/lib/libgtk-3.so.0

root@qemux86-64:~# python3

Python 3.13.2 (main, Feb 4 2025, 14:51:09) [GCC 14.2.0] on linux Type "help", "copyright", "credits" or "license" for more information.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

from ctypes.util import find_library

find_library('gtk-3')

 'libgtk-3.so.0'

For the case that ldconfig is NOT in DISTRO_FEATURES, gtk+3 can be found. After commit "python3-ctypes: depend on ldconfig only if distro-feature set" is merged,

ldconfig is not installed, so ctypes.util.find_library cannot found gtk+3.

//Changqing

Quoted 11 lines

Bye, Jörg

--
Navimatix GmbH T: 03641 - 327 99 0
Tatzendpromenade 2 F: 03641 - 526 306
07745 Jenawww.navimatix.de

Geschäftsführer: Steffen Späthe, Jan Rommeley
Registergericht: Amtsgericht Jena, HRB 501480

#10 lore raw

Changqing Li schrieb am Di 25. Feb, 10:02 (+0800):

Quoted 13 lines · Jörg Sommer
Quoted 12 lines

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Changqing Li via lists.openembedded.org schrieb am Do 20. Feb, 11:57 (+0800):

Quoted 3 lines

The reverted commit causes regression when ldconfig not in DISTRO_FEATURES, before, without ldconfig in DISTRO_FEATURES, ctypes.util.find_library(name) can find the lib if it is installed,

Hello Changqing Li,

Did I understand correctly that gtk+3 was found before, indent of ldconfig was in der DISTRO_FEATURES? But after the change, if fails.

Quoted 7 lines
Quoted 1 line

Where is libgdk installed? In /usr/lib or somewhere else?

libgtk is under /usr/lib. See:

root@qemux86-64:~# ldconfig -p | grep gtk-3

libgtk-3.so.0 (libc6,x86-64) => /usr/lib/libgtk-3.so.0

Interesting. I expected a subdirectory of lib.

Quoted 6 lines
root@qemux86-64:~# python3
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

from ctypes.util import find_library
find_library('gtk-3')

 'libgtk-3.so.0'

Thanks. That is a nice test case.

Quoted 5 lines

For the case that ldconfig is NOT in DISTRO_FEATURES, gtk+3 can be found. After commit "python3-ctypes: depend on ldconfig only if distro-feature set" is merged,

ldconfig is not installed, so ctypes.util.find_library cannot found gtk+3.

Yes, this was the contradiction: Even through you removed ldconfig from DISTRO_FEATURES, it got pulled in. I could not remove ldconfig (even through our system with python works fine without it).

Kind regards, Jörg

Signature · 6 lines
Navimatix GmbH           T: 03641 - 327 99 0
Tatzendpromenade 2       F: 03641 - 526 306
07745 Jena               www.navimatix.de

Geschäftsführer: Steffen Späthe, Jan Rommeley
Registergericht: Amtsgericht Jena, HRB 501480
#11 lore raw
In reply to Changqing Li

Changqing Li schrieb am Di 25. Feb, 10:02 (+0800):

Quoted 25 lines · Jörg Sommer
Quoted 7 lines

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Changqing Li via lists.openembedded.org schrieb am Do 20. Feb, 11:57 (+0800):

Quoted 3 lines

The reverted commit causes regression when ldconfig not in DISTRO_FEATURES, before, without ldconfig in DISTRO_FEATURES, ctypes.util.find_library(name) can find the lib if it is installed,

Quoted 6 lines

Hello Changqing Li,

Did I understand correctly that gtk+3 was found before, indent of ldconfig was in der DISTRO_FEATURES? But after the change, if fails.

Where is libgdk installed? In /usr/lib or somewhere else?

Hi,

libgtk is under /usr/lib. See:

root@qemux86-64:~# ldconfig -p | grep gtk-3

libgtk-3.so.0 (libc6,x86-64) => /usr/lib/libgtk-3.so.0

root@qemux86-64:~# python3
Quoted 8 lines

Python 3.13.2 (main, Feb 4 2025, 14:51:09) [GCC 14.2.0] on linux Type "help", "copyright", "credits" or "license" for more information.

Quoted 3 lines
Quoted 3 lines
Quoted 3 lines

from ctypes.util import find_library

find_library('gtk-3')

 'libgtk-3.so.0'

I have reverted your patch and this works:

```
root@qemux86-64:~# python3 -c 'from ctypes.util import find_library; print(find_library("m"))'
libm.so.6
root@qemux86-64:~# python3 -c 'from ctypes.util import find_library; print(find_library("gtk-3"))'
libgtk-3.so.0

root@qemux86-64:~# ldconfig --version
ldconfig (GNU libc) 2.41
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Andreas Jaeger.
```

Here are my settings from local.conf:

```
EXTRA_IMAGE_FEATURES += "\
    allow-empty-password allow-root-login empty-root-password \
    ssh-server-openssh tools-debug \
"

INIT_MANAGER = "systemd"
DISTRO_FEATURES:append = " usrmerge"
IMAGE_INSTALL:append = " conserver-ptest"
PACKAGECONFIG:append:pn-systemd = " coredump"

IMAGE_INSTALL:append = " python3-ctypes gtk+3"

MACHINE ??= "qemux86-64"
DISTRO ??= "poky"
```

I have used poky with 40b5f61a8f and the revert and meta-openembedded with 0b83551ff2.

Quoted 5 lines

For the case that ldconfig is NOT in DISTRO_FEATURES, gtk+3 can be found. After commit "python3-ctypes: depend on ldconfig only if distro-feature set" is merged,

ldconfig is not installed, so ctypes.util.find_library cannot found gtk+3.

You can also install ld or gcc. But if you prefer ldconfig, you should set this DISTRO_FEATURES. It's like x11 support, if you want it you have to set the feature.

Quoting https://docs.yoctoproject.org/ref-manual/features.html:

| ldconfig: Include support for ldconfig and ld.so.conf on the target.

@Mathieu: I think you should revert the commit 0df1318e5c, because it pulls in ldconfig even it is unselected in DISTRO_FEATURES. It leaves no way to build without ldconfig (what was the intend of my commit).

Kind regards, Jörg

Signature · 6 lines
Navimatix GmbH           T: 03641 - 327 99 0
Tatzendpromenade 2       F: 03641 - 526 306
07745 Jena               www.navimatix.de

Geschäftsführer: Steffen Späthe, Jan Rommeley
Registergericht: Amtsgericht Jena, HRB 501480
#12 lore raw
Quoted 69 lines · Jörg Sommer

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Changqing Li schrieb am Di 25. Feb, 10:02 (+0800):

Quoted 22 lines · Jörg Sommer
Quoted 7 lines

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Changqing Li via lists.openembedded.org schrieb am Do 20. Feb, 11:57 (+0800):

Quoted 3 lines

The reverted commit causes regression when ldconfig not in DISTRO_FEATURES, before, without ldconfig in DISTRO_FEATURES, ctypes.util.find_library(name) can find the lib if it is installed,

Quoted 6 lines

Hello Changqing Li,

Did I understand correctly that gtk+3 was found before, indent of ldconfig was in der DISTRO_FEATURES? But after the change, if fails.

Where is libgdk installed? In /usr/lib or somewhere else?

Hi,

libgtk is under /usr/lib. See:

root@qemux86-64:~# ldconfig -p | grep gtk-3

libgtk-3.so.0 (libc6,x86-64) => /usr/lib/libgtk-3.so.0

Quoted 8 lines
root@qemux86-64:~# python3

Python 3.13.2 (main, Feb 4 2025, 14:51:09) [GCC 14.2.0] on linux Type "help", "copyright", "credits" or "license" for more information.

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

from ctypes.util import find_library
find_library('gtk-3')

'libgtk-3.so.0'

I have reverted your patch and this works:

```
root@qemux86-64:~# python3 -c 'from ctypes.util import find_library; print(find_library("m"))'
libm.so.6
root@qemux86-64:~# python3 -c 'from ctypes.util import find_library; print(find_library("gtk-3"))'
libgtk-3.so.0

root@qemux86-64:~# ldconfig --version
ldconfig (GNU libc) 2.41
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Andreas Jaeger.
```

Here are my settings from local.conf:

```
EXTRA_IMAGE_FEATURES += "\
     allow-empty-password allow-root-login empty-root-password \
     ssh-server-openssh tools-debug \
"

INIT_MANAGER = "systemd"
DISTRO_FEATURES:append = " usrmerge"
IMAGE_INSTALL:append = " conserver-ptest"
PACKAGECONFIG:append:pn-systemd = " coredump"

IMAGE_INSTALL:append = " python3-ctypes gtk+3"

MACHINE ??= "qemux86-64"
DISTRO ??= "poky"
```
Quoted 2 lines

I have used poky with 40b5f61a8f and the revert and meta-openembedded with 0b83551ff2.

This works because poky have ldconfig in DISTRO_FEATURES by default, https://git.yoctoproject.org/poky/tree/meta/conf/bitbake.conf#n933

if remove ldconfig from DISTRO_FEATURES in local.conf, it will not work.

Quoted 8 lines
Quoted 5 lines

For the case that ldconfig is NOT in DISTRO_FEATURES, gtk+3 can be found. After commit "python3-ctypes: depend on ldconfig only if distro-feature set" is merged,

ldconfig is not installed, so ctypes.util.find_library cannot found gtk+3.

You can also install ld or gcc. But if you prefer ldconfig, you should set this DISTRO_FEATURES. It's like x11 support, if you want it you have to set the feature.

ctypes.util.find_library need ldconfig or ld or gcc to work. No matter what the DISTRO_FEATURES is, we should make a package at least work once it is installed.

python3-ctypes need rdepend at least one of ld, ldconfig, gcc, it should be a hard dependency.

certainly,it doesn't have to be ldconfig.  I am not sure depends on binutils or gcc it better, since binutils and gcc are more big packges.

Quoted 9 lines

Quotinghttps://docs.yoctoproject.org/ref-manual/features.html:

| ldconfig: Include support for ldconfig and ld.so.conf on the target.

@Mathieu: I think you should revert the commit 0df1318e5c, because it pulls in ldconfig even it is unselected in DISTRO_FEATURES. It leaves no way to build without ldconfig (what was the intend of my commit).

when ldconfig is disabled in DISTRO_FEATURES, if we don't want ldconfig be pulled in, how about just not install the package that depend on ldconfig, eg: python3-ctypes.

if revert my commit, and ldconfig is disabled in DISTRO_FEATURES, and python3-ctype is installed, ctypes.util.find_library will not work.

I tried with my commit in oe-core, and DISTRO_FEATURES_BACKFILL_CONSIDERED += "ldconfig" in local.conf:

boot core-image-minimal, ldconfig is not pulled.

root@qemux86-64:~# ldconfig --version -sh: ldconfig: command not found root@qemux86-64:~#

Regards

Changqing

Quoted 11 lines

Kind regards, Jörg

--
Navimatix GmbH T: 03641 - 327 99 0
Tatzendpromenade 2 F: 03641 - 526 306
07745 Jenawww.navimatix.de

Geschäftsführer: Steffen Späthe, Jan Rommeley
Registergericht: Amtsgericht Jena, HRB 501480

#13 lore raw

Changqing Li schrieb am Fr 28. Feb, 10:56 (+0800):

Quoted 34 lines · Jörg Sommer
Quoted 33 lines
```
root@qemux86-64:~# python3 -c 'from ctypes.util import find_library; print(find_library("m"))'
libm.so.6
root@qemux86-64:~# python3 -c 'from ctypes.util import find_library; print(find_library("gtk-3"))'
libgtk-3.so.0

root@qemux86-64:~# ldconfig --version
ldconfig (GNU libc) 2.41
Copyright (C) 2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Andreas Jaeger.
```

Here are my settings from local.conf:

```
EXTRA_IMAGE_FEATURES += "\
     allow-empty-password allow-root-login empty-root-password \
     ssh-server-openssh tools-debug \
"

INIT_MANAGER = "systemd"
DISTRO_FEATURES:append = " usrmerge"
IMAGE_INSTALL:append = " conserver-ptest"
PACKAGECONFIG:append:pn-systemd = " coredump"

IMAGE_INSTALL:append = " python3-ctypes gtk+3"

MACHINE ??= "qemux86-64"
DISTRO ??= "poky"
```
Quoted 7 lines
Quoted 2 lines

I have used poky with 40b5f61a8f and the revert and meta-openembedded with 0b83551ff2.

This works because poky have ldconfig in DISTRO_FEATURES by default,
https://git.yoctoproject.org/poky/tree/meta/conf/bitbake.conf#n933

if remove ldconfig from DISTRO_FEATURES in local.conf, it will not work.

But you can't remove ldconfig if you need it. Why do you remove it?

If you want the ldconfig feature of python3-ctype, you have to enable ldconfig. Or at least install the package.

Or should we downgrade the dependency to a recommendation?

Quoted 3 lines

ctypes.util.find_library need ldconfig or ld or gcc to work. No matter what the DISTRO_FEATURES is, we should make a package at least work once it is installed.

In our image python3-ctype works without ldconfig.

Quoted 5 lines
Quoted 5 lines

Quotinghttps://docs.yoctoproject.org/ref-manual/features.html:

| ldconfig: Include support for ldconfig and ld.so.conf on the target.

Quoted 7 lines
Quoted 3 lines

@Mathieu: I think you should revert the commit 0df1318e5c, because it pulls in ldconfig even it is unselected in DISTRO_FEATURES. It leaves no way to build without ldconfig (what was the intend of my commit).

when ldconfig is disabled in DISTRO_FEATURES, if we don't want ldconfig be pulled in, how about just not install the package that depend on ldconfig,
eg: python3-ctypes.

In our case python3-ctypes is a dependency of django.

Quoted 2 lines

if revert my commit, and ldconfig is disabled in DISTRO_FEATURES, and python3-ctype is installed, ctypes.util.find_library will not work.

But then you need ldconfig. Either install it with IMAGE_INSTALL or include it in DISTRO_FEATURES. I see this the same way like other DISTRO_FEATURES for example pam: if you want to use pam with e.g. systemd you have to include it in DISTRO_FEATURES.

Regards, Jörg

Signature · 6 lines
Navimatix GmbH           T: 03641 - 327 99 0
Tatzendpromenade 2       F: 03641 - 526 306
07745 Jena               www.navimatix.de

Geschäftsführer: Steffen Späthe, Jan Rommeley
Registergericht: Amtsgericht Jena, HRB 501480
#14 lore raw
Quoted 30 lines · Jörg Sommer

Changqing Li schrieb am Fr 28. Feb, 10:56 (+0800):

But you can't remove ldconfig if you need it. Why do you remove it?

If you want the ldconfig feature of python3-ctype, you have to enable ldconfig. Or at least install the package.

Or should we downgrade the dependency to a recommendation?

Quoted 3 lines

ctypes.util.find_library need ldconfig or ld or gcc to work. No matter what the DISTRO_FEATURES is, we should make a package at least work once it is installed.

In our image python3-ctype works without ldconfig.

Quoted 5 lines
Quoted 5 lines

Quotinghttps://docs.yoctoproject.org/ref-manual/features.html:

Quoted 1 line

ldconfig: Include support for ldconfig and ld.so.conf on the target.

Quoted 7 lines
Quoted 3 lines

@Mathieu: I think you should revert the commit 0df1318e5c, because it pulls in ldconfig even it is unselected in DISTRO_FEATURES. It leaves no way to build without ldconfig (what was the intend of my commit).

when ldconfig is disabled in DISTRO_FEATURES, if we don't want ldconfig be pulled in, how about just not install the package that depend on ldconfig,
eg: python3-ctypes.

In our case python3-ctypes is a dependency of django.

Quoted 7 lines
Quoted 2 lines

if revert my commit, and ldconfig is disabled in DISTRO_FEATURES, and python3-ctype is installed, ctypes.util.find_library will not work.

But then you need ldconfig. Either install it with IMAGE_INSTALL or include it in DISTRO_FEATURES. I see this the same way like other DISTRO_FEATURES for example pam: if you want to use pam with e.g. systemd you have to include it in DISTRO_FEATURES.

DISTRO_FEATURES are high level policy controls, not "this should be included or excluded" controls. For example "pam" controls whether the access control modules are configured/used, not whether libpam is or is not included.

For ldconfig, as I remember, the distro config was about whether to include "ldconfig" calls after installing libraries and whether to use the ld cache.

Packages being installed or not is an image level decision, not distro level.

In this case, perhaps we should drop the RDEPENDS to a RRECOMMENDS?

Cheers,

Richard

#15 lore raw

Richard Purdie schrieb am Fr 28. Feb, 10:20 (+0000):

Quoted 39 lines · Jörg Sommer
Quoted 30 lines

Changqing Li schrieb am Fr 28. Feb, 10:56 (+0800):

But you can't remove ldconfig if you need it. Why do you remove it?

If you want the ldconfig feature of python3-ctype, you have to enable ldconfig. Or at least install the package.

Or should we downgrade the dependency to a recommendation?

Quoted 3 lines

ctypes.util.find_library need ldconfig or ld or gcc to work. No matter what the DISTRO_FEATURES is, we should make a package at least work once it is installed.

In our image python3-ctype works without ldconfig.

Quoted 5 lines
Quoted 5 lines

Quotinghttps://docs.yoctoproject.org/ref-manual/features.html:

Quoted 1 line

ldconfig: Include support for ldconfig and ld.so.conf on the target.

Quoted 7 lines
Quoted 3 lines

@Mathieu: I think you should revert the commit 0df1318e5c, because it pulls in ldconfig even it is unselected in DISTRO_FEATURES. It leaves no way to build without ldconfig (what was the intend of my commit).

when ldconfig is disabled in DISTRO_FEATURES, if we don't want ldconfig be pulled in, how about just not install the package that depend on ldconfig,
eg: python3-ctypes.

In our case python3-ctypes is a dependency of django.

Quoted 7 lines
Quoted 2 lines

if revert my commit, and ldconfig is disabled in DISTRO_FEATURES, and python3-ctype is installed, ctypes.util.find_library will not work.

But then you need ldconfig. Either install it with IMAGE_INSTALL or include it in DISTRO_FEATURES. I see this the same way like other DISTRO_FEATURES for example pam: if you want to use pam with e.g. systemd you have to include it in DISTRO_FEATURES.

Quoted 4 lines

DISTRO_FEATURES are high level policy controls, not "this should be included or excluded" controls. For example "pam" controls whether the access control modules are configured/used, not whether libpam is or is not included.

But it controls if other packages (e.g. systemd) enable pam support or not. The same goes with ldconfig: Should ldconfig support in the packages be enabled (which would pull-in ldconfig as dependency).

Quoted 3 lines

For ldconfig, as I remember, the distro config was about whether to include "ldconfig" calls after installing libraries and whether to use the ld cache.

If the feature is only about enabling code in the postinst script, than we should find a better description of the feature

| ldconfig: Include support for ldconfig and ld.so.conf on the target.

https://docs.yoctoproject.org/ref-manual/features.html

Quoted 2 lines

Packages being installed or not is an image level decision, not distro level.

Yes, that's also my understanding. But enabling some features (e.g. x11 support) leads to recipes set DEPENDS on libs and this leads to the installation of some packages. So DISTRO_FEATURES influence indirectly what gets into the image.

Quoted 1 line

In this case, perhaps we should drop the RDEPENDS to a RRECOMMENDS?

This would be helpful to remove ldconfig, if django is installed.

But the main question is still open: Why should I want ldconfig and remove it from DISTRO_FEATURES? What is this use case?

Regards Jörg

Signature · 6 lines
Navimatix GmbH           T: 03641 - 327 99 0
Tatzendpromenade 2       F: 03641 - 526 306
07745 Jena               www.navimatix.de

Geschäftsführer: Steffen Späthe, Jan Rommeley
Registergericht: Amtsgericht Jena, HRB 501480
#16 lore raw
Quoted 10 lines · Jörg Sommer

Richard Purdie schrieb am Fr 28. Feb, 10:20 (+0000):

Quoted 4 lines

DISTRO_FEATURES are high level policy controls, not "this should be included or excluded" controls. For example "pam" controls whether the access control modules are configured/used, not whether libpam is or is not included.

But it controls if other packages (e.g. systemd) enable pam support or not. The same goes with ldconfig: Should ldconfig support in the packages be enabled (which would pull-in ldconfig as dependency).

Quoted 6 lines
Quoted 3 lines

For ldconfig, as I remember, the distro config was about whether to include "ldconfig" calls after installing libraries and whether to use the ld cache.

If the feature is only about enabling code in the postinst script, than we should find a better description of the feature

I think the description needs improving and I think we'd take patches to do that.

Quoted 11 lines
Quoted 1 line

ldconfig: Include support for ldconfig and ld.so.conf on the target.

https://docs.yoctoproject.org/ref-manual/features.html

Quoted 2 lines

Packages being installed or not is an image level decision, not distro level.

Yes, that's also my understanding. But enabling some features (e.g. x11 support) leads to recipes set DEPENDS on libs and this leads to the installation of some packages. So DISTRO_FEATURES influence indirectly what gets into the image.

The key word is indirectly. Where things have a hard dependency on something, they do include that dependency and it isn't conditional on a distro feature.

In this case, the usage is tangential to what the DISTRO_FEATURE was designed for (ld cache). I do agree ldconfig is optional so RRECOMMENDS seems better than a hard RDEPENDS though.

Quoted 6 lines
Quoted 1 line

In this case, perhaps we should drop the RDEPENDS to a RRECOMMENDS?

This would be helpful to remove ldconfig, if django is installed.

But the main question is still open: Why should I want ldconfig and remove it from DISTRO_FEATURES? What is this use case?

It is being used to control whether the ld cache is being used or not. That has to be done at a distro wide policy level. Whether ldconfig makes it into the image or not is an indirect effect.

We can control the inclusion of ldconfig for ctypes at a package/image level, it isn't a distro config level issue.

Cheers,

Richard

#17 lore raw
Quoted 30 lines · Richard Purdie

CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.

Quoted 9 lines · Jörg Sommer

Richard Purdie schrieb am Fr 28. Feb, 10:20 (+0000):

Quoted 4 lines

DISTRO_FEATURES are high level policy controls, not "this should be included or excluded" controls. For example "pam" controls whether the access control modules are configured/used, not whether libpam is or is not included.

But it controls if other packages (e.g. systemd) enable pam support or not. The same goes with ldconfig: Should ldconfig support in the packages be enabled (which would pull-in ldconfig as dependency).

Quoted 5 lines
Quoted 3 lines

For ldconfig, as I remember, the distro config was about whether to include "ldconfig" calls after installing libraries and whether to use the ld cache.

If the feature is only about enabling code in the postinst script, than we should find a better description of the feature

I think the description needs improving and I think we'd take patches to do that.

Quoted 9 lines
Quoted 1 line

ldconfig: Include support for ldconfig and ld.so.conf on the target.

https://docs.yoctoproject.org/ref-manual/features.html

Quoted 2 lines

Packages being installed or not is an image level decision, not distro level.

Yes, that's also my understanding. But enabling some features (e.g. x11 support) leads to recipes set DEPENDS on libs and this leads to the installation of some packages. So DISTRO_FEATURES influence indirectly what gets into the image.

Quoted 7 lines

The key word is indirectly. Where things have a hard dependency on something, they do include that dependency and it isn't conditional on a distro feature.

In this case, the usage is tangential to what the DISTRO_FEATURE was designed for (ld cache). I do agree ldconfig is optional so RRECOMMENDS seems better than a hard RDEPENDS though.

I will send a patch to update RDEPENDS -> RRECOMMENDS

Thanks

Changqing

Quoted 18 lines
Quoted 6 lines
Quoted 2 lines

In this case, perhaps we should drop the RDEPENDS to a RRECOMMENDS?

This would be helpful to remove ldconfig, if django is installed.

But the main question is still open: Why should I want ldconfig and remove it from DISTRO_FEATURES? What is this use case?

It is being used to control whether the ld cache is being used or not. That has to be done at a distro wide policy level. Whether ldconfig makes it into the image or not is an indirect effect.

We can control the inclusion of ldconfig for ctypes at a package/image level, it isn't a distro config level issue.

Cheers,

Richard