diff mbox series

rust: Use variable to specify extra tools to install

Message ID 20220908151303.2592885-1-raj.khem@gmail.com
State Accepted, archived
Commit 332df9ebbd75a1825ac99abf1311d2e692d398d7
Headers show
Series rust: Use variable to specify extra tools to install | expand

Commit Message

Khem Raj Sept. 8, 2022, 3:13 p.m. UTC
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.

Signed-off-by: Khem Raj <raj.khem@gmail.com>
---
 meta/recipes-devtools/rust/rust_1.63.0.bb | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Otavio Salvador Sept. 8, 2022, 4:35 p.m. UTC | #1
Em qui., 8 de set. de 2022 às 12:13, Khem Raj <raj.khem@gmail.com> escreveu:

> 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.
>
> Signed-off-by: Khem Raj <raj.khem@gmail.com>
> ---
>  meta/recipes-devtools/rust/rust_1.63.0.bb | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/meta/recipes-devtools/rust/rust_1.63.0.bb
> b/meta/recipes-devtools/rust/rust_1.63.0.bb
> index cf6468d212..2f70b33c29 100644
> --- a/meta/recipes-devtools/rust/rust_1.63.0.bb
> +++ b/meta/recipes-devtools/rust/rust_1.63.0.bb
> @@ -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.
diff mbox series

Patch

diff --git a/meta/recipes-devtools/rust/rust_1.63.0.bb b/meta/recipes-devtools/rust/rust_1.63.0.bb
index cf6468d212..2f70b33c29 100644
--- a/meta/recipes-devtools/rust/rust_1.63.0.bb
+++ b/meta/recipes-devtools/rust/rust_1.63.0.bb
@@ -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