diff mbox series

[meta-oe,4/5] librust-cxx: Install crates from cargo's new build-dir layout

Message ID 20261120080821.1085842-4-khem.raj@oss.qualcomm.com
State New
Headers show
Series [meta-oe,1/5] libsigrokdecode: Link with python 3.15 embed library | expand

Commit Message

Khem Raj Nov. 20, 2026, 8:08 a.m. UTC
Since cargo 1.100 the new build-dir layout is always used: compiled
crates are placed in build/<crate>/<hash>/out/ and deps/ is no longer
created, so do_install fails with:

  cp: cannot stat '.../release/deps/*': No such file or directory

Build script OUT_DIRs live under build/<crate>/<hash>/out/ too, so only
pick up the .rlib and .rmeta files from there.

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 .../recipes-devtools/librust-cxx/librust-cxx_1.0.205.bb   | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/meta-oe/recipes-devtools/librust-cxx/librust-cxx_1.0.205.bb b/meta-oe/recipes-devtools/librust-cxx/librust-cxx_1.0.205.bb
index 695f9b4043..7a2788cb83 100644
--- a/meta-oe/recipes-devtools/librust-cxx/librust-cxx_1.0.205.bb
+++ b/meta-oe/recipes-devtools/librust-cxx/librust-cxx_1.0.205.bb
@@ -26,11 +26,9 @@  require ${BPN}-crates.inc

 do_install () {
     install -d ${D}${rustlibdir}
-    # The cxx deps directory also contains dependency files (.d) generated
-    # during compilation. These files are only needed for incremental builds
-    # and are not required when installing the cxx libraries.
-    rm -f ${B}/target/${RUST_TARGET_SYS}/${BUILD_DIR}/deps/*.d
-    cp ${B}/target/${RUST_TARGET_SYS}/${BUILD_DIR}/deps/* ${D}${rustlibdir}
+    install -m 0644 ${B}/target/${RUST_TARGET_SYS}/${BUILD_DIR}/build/*/*/out/*.rlib \
+                    ${B}/target/${RUST_TARGET_SYS}/${BUILD_DIR}/build/*/*/out/*.rmeta \
+                    ${D}${rustlibdir}
 }

 BBCLASSEXTEND = "native"