From bc711220a6fdd49392cc870993942ca42d0b7b85 Mon Sep 17 00:00:00 2001 From: Martin Jansa Date: Thu, 27 Mar 2025 14:27:36 +0100 Subject: [PATCH] cargo_common: add CARGO_HOME to DEBUG_PREFIX_MAP * it was done with CFLAGS only in python3-maturin but it could be useful for other recipes as well, move it to bbclass which sets CARGO_HOME * python3-maturin buildflags issue is reproducible with scarthgap: WARNING: python3-maturin-1.4.0-r0 do_package_qa: QA Issue: File /usr/bin/.debug/maturin in package python3-maturin-dbg contains reference to TMPDIR [buildpaths] but not with whinlatter --- meta/classes-recipe/cargo_common.bbclass | 3 +++ meta/recipes-devtools/python/python3-maturin_1.9.1.bb | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/meta/classes-recipe/cargo_common.bbclass b/meta/classes-recipe/cargo_common.bbclass index c9eb2d09a5..75540f2159 100644 --- a/meta/classes-recipe/cargo_common.bbclass +++ b/meta/classes-recipe/cargo_common.bbclass @@ -20,6 +20,9 @@ inherit rust-common # Where we download our registry and dependencies to export CARGO_HOME = "${UNPACKDIR}/cargo_home" +DEBUG_PREFIX_MAP:append = " -ffile-prefix-map=${CARGO_HOME}=${TARGET_DBGSRC_DIR}/cargo_home" + + # The pkg-config-rs library used by cargo build scripts disables itself when # cross compiling unless this is defined. We set up pkg-config appropriately # for cross compilation, so tell it we know better than it. diff --git a/meta/recipes-devtools/python/python3-maturin_1.9.1.bb b/meta/recipes-devtools/python/python3-maturin_1.9.1.bb index ce38e93136..3204ea19ab 100644 --- a/meta/recipes-devtools/python/python3-maturin_1.9.1.bb +++ b/meta/recipes-devtools/python/python3-maturin_1.9.1.bb @@ -9,8 +9,6 @@ SRC_URI[sha256sum] = "97b52fb19d20c1fdc70e4efdc05d79853a4c9c0051030c93a793cd5181 S = "${UNPACKDIR}/maturin-${PV}" -CFLAGS += "-ffile-prefix-map=${CARGO_HOME}=${TARGET_DBGSRC_DIR}/cargo_home" - DEPENDS += "\ python3-setuptools-rust-native \ python3-semantic-version-native \ -- 2.47.2