Re: [OE-core] [PATCH] cargo-c: fix debug symbols containing TMPDIR references

Frédéric Martinsons
2025-10-08T17:43:53Z

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

Do you think it is cargo-c specific? Or all recipes which inherits cargo
class must have that?

Le mer. 8 oct. 2025, 15:01, Yash Shinde via lists.openembedded.org
<Yash.Shinde=windriver.com@lists.openembedded.org> a écrit :

> From: Yash Shinde <Yash.Shinde@windriver.com>
>
> When building cargo-c with DEBUG mode, QA checks fail due to
> absolute paths from the build environment (TMPDIR) being embedded into
> the debug symbols/binaries. This causes issues such as:
>
> ERROR: do_package_qa: File /usr/bin/.debug/cargo-capi contains reference
> to TMPDIR [buildpaths]
> ERROR: do_package_qa: File /usr/bin/.debug/cargo-cinstall contains
> reference to TMPDIR [buildpaths]
> ERROR: do_package_qa: File /usr/bin/.debug/cargo-cbuild contains
> reference to TMPDIR [buildpaths]
> ERROR: do_package_qa: File /usr/bin/.debug/cargo-ctest contains
> reference to TMPDIR [buildpaths]
>
> To fix this, pass an additional -ffile-prefix-map option to
> DEBUG_PREFIX_MAP to
> ensure that paths under `${CARGO_HOME}` are remapped to
> `${TARGET_DBGSRC_DIR}`.
> This ensures debug info is reproducible and does not leak host-specific
> paths.
>
> Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
> ---
> meta/recipes-devtools/rust/cargo-c_0.10.16+cargo-0.91.0.bb | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/meta/recipes-devtools/rust/cargo-c_0.10.16+cargo-0.91.0.bb
> b/meta/recipes-devtools/rust/cargo-c_0.10.16+cargo-0.91.0.bb
> index fd15f02da9..5ef68e13c2 100644
> --- a/meta/recipes-devtools/rust/cargo-c_0.10.16+cargo-0.91.0.bb
> +++ b/meta/recipes-devtools/rust/cargo-c_0.10.16+cargo-0.91.0.bb
> @@ -12,6 +12,8 @@ SRC_URI = "crate://crates.io/cargo-c/${PV};name=cargo-c
> <http://crates.io/cargo-c/$%7BPV%7D;name=cargo-c> \
> SRC_URI[cargo-c.sha256sum] =
> "17d431789b050b0fcf678455dfd5ceb7e5b45cd806140f8fe03b16b995d6cbff"
> S = "${CARGO_VENDORING_DIRECTORY}/cargo-c-${PV}"
>
> +DEBUG_PREFIX_MAP += "-ffile-prefix-map=${CARGO_HOME}=${TARGET_DBGSRC_DIR}"
> +
> inherit cargo cargo-update-recipe-crates pkgconfig
>
> DEPENDS = "openssl curl"
> --
> 2.49.0
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#224581):
> https://lists.openembedded.org/g/openembedded-core/message/224581
> Mute This Topic: https://lists.openembedded.org/mt/115653303/6213388
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> frederic.martinsons@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>

[-- Attachment #2: Type: text/html, Size: 4291 bytes --]