Skip to contentSkip to conversation

rust: Use variable to specify extra tools to install

PATCH Superseded Khem Raj 2 participants 2 messages Sep 8, 2022

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore

Khem Raj

author
#0 lore raw

PATCH 1/1 rust: Use variable to specify extra tools to install

All architectures may not support same set of tools, therefore use a variable to specify this. E.g. on riscv32 only cargo-clippy is buildable right now.

---
 meta/recipes-devtools/rust/rust_1.63.0.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-devtools/rust/rust_1.63.0.bb +3 -1
index cf6468d212..2f70b33c29 100644
@@ -62,13 +62,15 @@ rust_do_install:class-nativesdk() {
     rm ${D}${libdir}/rustlib/manifest*
 }
 
+EXTRA_TOOLS ?= "cargo-clippy clippy-driver rustfmt"
+EXTRA_TOOLS:remove:riscv32 = "cargo-driver rustfmt"
 rust_do_install:class-target() {
     export PSEUDO_UNLOAD=1
     rust_runx install
     unset PSEUDO_UNLOAD
 
     install -d ${D}${bindir}
-    for i in cargo-clippy clippy-driver rustfmt; do
+    for i in ${EXTRA_TOOLS}; do
         cp build/${RUST_BUILD_SYS}/stage2-tools/${RUST_HOST_SYS}/release/$i ${D}${bindir}
         chrpath -r "\$ORIGIN/../lib" ${D}${bindir}/$i
     done
Signature · 1 line
2.37.3
#1 lore raw

Em qui., 8 de set. de 2022 às 12:13, Khem Raj <[email protected]> escreveu:

Quoted 15 lines

All architectures may not support same set of tools, therefore use a variable to specify this. E.g. on riscv32 only cargo-clippy is buildable right now.

---
 meta/recipes-devtools/rust/rust_1.63.0.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-devtools/rust/rust_1.63.0.bb +0 -0
index cf6468d212..2f70b33c29 100644

meta/recipes-devtools/rust/rust_1.63.0.bb rust_do_install:class-nativesdk() { · line 67

Quoted 6 lines
meta/recipes-devtools/rust/rust_1.63.0.bb +2 -0
@@ -62,13 +62,15 @@ rust_do_install:class-nativesdk() {
     rm ${D}${libdir}/rustlib/manifest*
 }
 
+EXTRA_TOOLS ?= "cargo-clippy clippy-driver rustfmt"
+EXTRA_TOOLS:remove:riscv32 = "cargo-driver rustfmt"
 

clippy driver is spelled wrong.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://code.ossystems.com.br
Mobile: +55 (53) 9 9981-7854          Mobile: +1 (347) 903-9750