diff mbox series

[2/3] cargo.bbclass: Collect installation paths of executable binaries

Message ID 20251112155730.646159-3-andreas.stergiopoulos@smile.fr
State New
Headers show
Series Better support for Rust integration tests | expand

Commit Message

Andreas STERGIOPOULOS Nov. 12, 2025, 3:57 p.m. UTC
All the binary executables that are installed in the image are collected along with
their paths and then added to the cargo_bin_exe_paths file. This file is then used
for the CARGO_BIN_EXE_<name> environment variables, used by the integration tests.

Signed-off-by: Andreas Stergiopoulos <andreas.stergiopoulos@smile.fr>
---
 meta/classes-recipe/cargo.bbclass | 3 +++
 1 file changed, 3 insertions(+)
diff mbox series

Patch

diff --git a/meta/classes-recipe/cargo.bbclass b/meta/classes-recipe/cargo.bbclass
index 2dd28e95d3..167040cb81 100644
--- a/meta/classes-recipe/cargo.bbclass
+++ b/meta/classes-recipe/cargo.bbclass
@@ -58,6 +58,7 @@  cargo_do_compile () {
 
 cargo_do_install () {
 	local have_installed=false
+	binary_exe_path_list="${B}/binary_exe_path_list"
 	for tgt in "${B}/target/${CARGO_TARGET_SUBDIR}/"*; do
 		case $tgt in
 		*.so|*.rlib)
@@ -83,6 +84,8 @@  cargo_do_install () {
 				install -d "${D}${bindir}"
 				install -m755 "$tgt" "${D}${bindir}"
 				have_installed=true
+				# Append the install path of the executable to the bin_exe list
+				echo "${bindir}/$(basename ${tgt})" >> ${binary_exe_path_list}
 			fi
 			;;
 		esac