Skip to contentSkip to conversation

cargo-c: fix debug symbols containing TMPDIR references

PATCH In review [email protected] 2 participants 4 messages Oct 8, 2025 – Oct 9, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cargo-c: fix debug symbols containing TMPDIR references

From: Yash Shinde <[email protected]>

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.

---
 meta/recipes-devtools/rust/cargo-c_0.10.16+cargo-0.91.0.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-devtools/rust/cargo-c_0.10.16+cargo-0.91.0.bb +2 -0
index fd15f02da9..5ef68e13c2 100644
@@ -12,6 +12,8 @@ SRC_URI = "crate://crates.io/cargo-c/${PV};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"
Signature · 1 line
2.49.0
#1 lore raw

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

Quoted 58 lines · Yash Shinde via lists.openembedded.org

From: Yash Shinde <[email protected]>

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.

---
 meta/recipes-devtools/rust/cargo-c_0.10.16+cargo-0.91.0.bb | 2 ++
 1 file changed, 2 insertions(+)
meta/recipes-devtools/rust/cargo-c_0.10.16+cargo-0.91.0.bb +0 -0
index fd15f02da9..5ef68e13c2 100644
@@ -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}"

meta/recipes-devtools/rust/cargo-c_0.10.16+cargo-0.91.0.bb +2 -1
+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: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw
Quoted 2 lines · Frédéric Martinsons

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

The error logs pointed out to cargo-c binaries only.

For cargo, DEBUG_PREFIX_MAP is already defined:
https://git.yoctoproject.org/poky/tree/meta/recipes-devtools/rust/cargo_1.90.0.bb#n22

This remaps the rust source path i.e $RUSTSRC.
However, cargo-c uses a separate source installation directory ($CARGO_HOME) which isn't covered by DEBUG_PREFIX_MAP.

Regards,
Yash

Quoted 75 lines

Le mer. 8 oct. 2025, 15:01, Yash Shinde via lists.openembedded.org <https://urldefense.com/v3/__http://lists.openembedded.org__;!!AjveYdw8EvQ!eT6NUyxobn9jkx3pHarcK-637_es2YI-QyHcS2uLhyDXsf2bIzqgfXyiGljcR3YtFoalO9cR6w0vcM-0RUYHKsb9Ca4-IUA$> <[email protected]> a écrit :

    From: Yash Shinde <[email protected]>

    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 <[email protected]>
    ---
     meta/recipes-devtools/rust/cargo-c_0.10.16+cargo-0.91.0.bb
    <https://urldefense.com/v3/__http://cargo-0.91.0.bb__;!!AjveYdw8EvQ!eT6NUyxobn9jkx3pHarcK-637_es2YI-QyHcS2uLhyDXsf2bIzqgfXyiGljcR3YtFoalO9cR6w0vcM-0RUYHKsb90kr3UWQ$>
    | 2 ++
     1 file changed, 2 insertions(+)

    diff --git
    a/meta/recipes-devtools/rust/cargo-c_0.10.16+cargo-0.91.0.bb
    <https://urldefense.com/v3/__http://cargo-0.91.0.bb__;!!AjveYdw8EvQ!eT6NUyxobn9jkx3pHarcK-637_es2YI-QyHcS2uLhyDXsf2bIzqgfXyiGljcR3YtFoalO9cR6w0vcM-0RUYHKsb90kr3UWQ$>
    b/meta/recipes-devtools/rust/cargo-c_0.10.16+cargo-0.91.0.bb
    <https://urldefense.com/v3/__http://cargo-0.91.0.bb__;!!AjveYdw8EvQ!eT6NUyxobn9jkx3pHarcK-637_es2YI-QyHcS2uLhyDXsf2bIzqgfXyiGljcR3YtFoalO9cR6w0vcM-0RUYHKsb90kr3UWQ$>
    index fd15f02da9..5ef68e13c2 100644
    --- a/meta/recipes-devtools/rust/cargo-c_0.10.16+cargo-0.91.0.bb
    <https://urldefense.com/v3/__http://cargo-0.91.0.bb__;!!AjveYdw8EvQ!eT6NUyxobn9jkx3pHarcK-637_es2YI-QyHcS2uLhyDXsf2bIzqgfXyiGljcR3YtFoalO9cR6w0vcM-0RUYHKsb90kr3UWQ$>
    +++ b/meta/recipes-devtools/rust/cargo-c_0.10.16+cargo-0.91.0.bb
    <https://urldefense.com/v3/__http://cargo-0.91.0.bb__;!!AjveYdw8EvQ!eT6NUyxobn9jkx3pHarcK-637_es2YI-QyHcS2uLhyDXsf2bIzqgfXyiGljcR3YtFoalO9cR6w0vcM-0RUYHKsb90kr3UWQ$>
    @@ -12,6 +12,8 @@ SRC_URI =
    "crate://crates.io/cargo-c/${PV};name=cargo-c
    <https://urldefense.com/v3/__http://crates.io/cargo-c/$*7BPV*7D;name=cargo-c__;JSU!!AjveYdw8EvQ!eT6NUyxobn9jkx3pHarcK-637_es2YI-QyHcS2uLhyDXsf2bIzqgfXyiGljcR3YtFoalO9cR6w0vcM-0RUYHKsb9-NilF0c$>
    \
     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
    <https://urldefense.com/v3/__https://lists.openembedded.org/g/openembedded-core/message/224581__;!!AjveYdw8EvQ!eT6NUyxobn9jkx3pHarcK-637_es2YI-QyHcS2uLhyDXsf2bIzqgfXyiGljcR3YtFoalO9cR6w0vcM-0RUYHKsb9Y5bg2LA$>
    Mute This Topic:
    https://lists.openembedded.org/mt/115653303/6213388
    <https://urldefense.com/v3/__https://lists.openembedded.org/mt/115653303/6213388__;!!AjveYdw8EvQ!eT6NUyxobn9jkx3pHarcK-637_es2YI-QyHcS2uLhyDXsf2bIzqgfXyiGljcR3YtFoalO9cR6w0vcM-0RUYHKsb9IEGgQYE$>
    Group Owner: [email protected]
    <mailto:openembedded-core%[email protected]>
    Unsubscribe:
    https://lists.openembedded.org/g/openembedded-core/unsub
    <https://urldefense.com/v3/__https://lists.openembedded.org/g/openembedded-core/unsub__;!!AjveYdw8EvQ!eT6NUyxobn9jkx3pHarcK-637_es2YI-QyHcS2uLhyDXsf2bIzqgfXyiGljcR3YtFoalO9cR6w0vcM-0RUYHKsb9b7ysiMA$>
    [[email protected]]
    -=-=-=-=-=-=-=-=-=-=-=-
Signature · 2 lines
Regards,
Yash Shinde
#3 lore raw
Quoted 9 lines · Yash Shinde

On 08-10-2025 23:13, Frédéric Martinsons wrote:

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

The error logs pointed out to cargo-c binaries only. For cargo, DEBUG_PREFIX_MAP is already defined:

Quoted 8 lines

https://git.yoctoproject.org/poky/tree/meta/recipes-devtools/rust/cargo_1.90.0.bb#n22

This remaps the rust source path i.e $RUSTSRC. However, cargo-c uses a separate source installation directory ($CARGO_HOME) which isn't covered
by DEBUG_PREFIX_MAP.

Thanks !

Quoted 81 lines

Regards,
Yash

Quoted 68 lines · Le mer. 8 oct. 2025, 15:01, Yash Shinde via lists.openembedded.org…

From: Yash Shinde <[email protected]>

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.

---
meta/recipes-devtools/rust/cargo-c_0.10.16+cargo-0.91.0.bb
<https://urldefense.com/v3/__http://cargo-0.91.0.bb__;!!AjveYdw8EvQ!eT6NUyxobn9jkx3pHarcK-637_es2YI-QyHcS2uLhyDXsf2bIzqgfXyiGljcR3YtFoalO9cR6w0vcM-0RUYHKsb90kr3UWQ$>
| 2 ++

 1 file changed, 2 insertions(+)
(quoted diff) +0 -0

<https://urldefense.com/v3/__http://cargo-0.91.0.bb__;!!AjveYdw8EvQ!eT6NUyxobn9jkx3pHarcK-637_es2YI-QyHcS2uLhyDXsf2bIzqgfXyiGljcR3YtFoalO9cR6w0vcM-0RUYHKsb90kr3UWQ$>
b/meta/recipes-devtools/rust/cargo-c_0.10.16+cargo-0.91.0.bb
<https://urldefense.com/v3/__http://cargo-0.91.0.bb__;!!AjveYdw8EvQ!eT6NUyxobn9jkx3pHarcK-637_es2YI-QyHcS2uLhyDXsf2bIzqgfXyiGljcR3YtFoalO9cR6w0vcM-0RUYHKsb90kr3UWQ$>
index fd15f02da9..5ef68e13c2 100644
--- a/meta/recipes-devtools/rust/cargo-c_0.10.16+cargo-0.91.0.bb
<https://urldefense.com/v3/__http://cargo-0.91.0.bb__;!!AjveYdw8EvQ!eT6NUyxobn9jkx3pHarcK-637_es2YI-QyHcS2uLhyDXsf2bIzqgfXyiGljcR3YtFoalO9cR6w0vcM-0RUYHKsb90kr3UWQ$>
+++ b/meta/recipes-devtools/rust/cargo-c_0.10.16+cargo-0.91.0.bb
<https://urldefense.com/v3/__http://cargo-0.91.0.bb__;!!AjveYdw8EvQ!eT6NUyxobn9jkx3pHarcK-637_es2YI-QyHcS2uLhyDXsf2bIzqgfXyiGljcR3YtFoalO9cR6w0vcM-0RUYHKsb90kr3UWQ$>

(quoted diff) +0 -0
@@ -12,6 +12,8 @@ SRC_URI = "crate://crates.io/cargo-c/${PV};name=cargo-c

<https://urldefense.com/v3/__http://crates.io/cargo-c/$*7BPV*7D;name=cargo-c__;JSU!!AjveYdw8EvQ!eT6NUyxobn9jkx3pHarcK-637_es2YI-QyHcS2uLhyDXsf2bIzqgfXyiGljcR3YtFoalO9cR6w0vcM-0RUYHKsb9-NilF0c$>
\
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
<https://urldefense.com/v3/__https://lists.openembedded.org/g/openembedded-core/message/224581__;!!AjveYdw8EvQ!eT6NUyxobn9jkx3pHarcK-637_es2YI-QyHcS2uLhyDXsf2bIzqgfXyiGljcR3YtFoalO9cR6w0vcM-0RUYHKsb9Y5bg2LA$>
Mute This Topic: https://lists.openembedded.org/mt/115653303/6213388
<https://urldefense.com/v3/__https://lists.openembedded.org/mt/115653303/6213388__;!!AjveYdw8EvQ!eT6NUyxobn9jkx3pHarcK-637_es2YI-QyHcS2uLhyDXsf2bIzqgfXyiGljcR3YtFoalO9cR6w0vcM-0RUYHKsb9IEGgQYE$>
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub
<https://urldefense.com/v3/__https://lists.openembedded.org/g/openembedded-core/unsub__;!!AjveYdw8EvQ!eT6NUyxobn9jkx3pHarcK-637_es2YI-QyHcS2uLhyDXsf2bIzqgfXyiGljcR3YtFoalO9cR6w0vcM-0RUYHKsb9b7ysiMA$>
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Quoted 1 line

--

Regards,
Yash Shinde