Bug 15723

Summary: Rust based pydantic-core .so file fails to load on target when libstd-rs build with DEBUG_BUILD
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Ernst Persson <ernstp>
Component: devtools / tool chainAssignee: Ernst Persson <ernstp>
Status: NEEDINFO --- QA Contact:
Severity: normal    
Priority: Medium CC: deepesh.varatharajan, meta.mr.watcher, meta.watcher, randy.macleod, sundeep.kokkonda, yoann.congal
Version: 5.0.9   
Target Milestone: 6.2   
Hardware: Other   
OS: arm   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: Don't know

Description Ernst Persson 2025-01-21 15:14:33 UTC
Setup:
Yocto Scarthgap 5.0.7
MACHINE=qemuarm
DEBUG_BUILD = "1"
# Actually all you need is just DEBUG_BUILD:pn-libstd-rs = "1"
Add meta-openembedded with meta-oe and meta-python.

bitbake python3-pydantic-core

What happens:
objdump -TC tmp/work/cortexa*-neon-poky-linux-gnueabi/python3-pydantic-core/*/image/usr/lib/python3.12/site-packages/pydantic_core/_pydantic_core.cpython-312-arm-linux-gnueabihf.so  | grep panic
00000000      D  *UND*	00000000  Base        core::panicking::panic

On target it looks like this:
File "/usr/lib/python3.12/site-packages/pydantic_core/__init__.py", line 6, in <module>
    from ._pydantic_core import (
ImportError: /usr/lib/python3.12/site-packages/pydantic_core/_pydantic_core.cpython-312-arm-linux-gnueabihf.so: undefined symbol: _ZN4core9panicking5panic17h3dccdbb9a3027529E

It's absolutely related to https://patchwork.yoctoproject.org/project/oe-core/patch/20211206054504.61115-1-pgowda.cve@gmail.com/#298 , though it's not exactly the same either...
Comment 1 Randy MacLeod 2025-01-23 15:45:53 UTC
Ernst, Thanks for the bug report.
Sundeep will have someone take a look eventually.
Comment 2 Ernst Persson 2025-01-24 11:07:45 UTC
Simply updating pydantic-core with Scarthgap did not solve it.

I tried to reproduce it on master now but could not reproduce it there however.
Comment 3 Randy MacLeod 2025-05-15 18:45:46 UTC
Is this still a problem?
Comment 4 Ernst Persson 2025-05-16 10:31:07 UTC
Yes, still happens on Scarthgap.
Comment 5 Randy MacLeod 2026-02-10 16:24:53 UTC
Deepesh, Is there an upstream Rust bug to track and focus work on this issue?
Comment 6 Deepesh Varatharajan 2026-10-14 05:49:05 UTC
Hi,

I tested with the latest Scarthgap sources, adding meta-oe and meta-python on top of oe-core.

In local.conf:

MACHINE = "qemuarm"
DEBUG_BUILD:pn-libstd-rs = "1"

Then ran bitbake python3-pydantic-core and could not reproduce the issue.

Ernst, are you still experiencing this issue, or can we close it?
Comment 7 Randy MacLeod 2026-10-14 15:04:22 UTC
Ernest, See Deepesh's question please.

Deepesh, please use "Need Info" state. 
We track that for no response so  issues don't get forgotten.