From 173c2bf1b2716c2975699445232a2787521f7474 Mon Sep 17 00:00:00 2001 From: mjsterckx Date: Thu, 2 Mar 2023 16:05:09 +0000 Subject: [PATCH 1/2] Makefile: use SDK for Rust formatting --- Makefile.toml | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/Makefile.toml b/Makefile.toml index 3ab3d0deade..ed09195d107 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -401,16 +401,29 @@ for m in ${GO_MODULES}; do done # For rust first-party source code -if ! cargo fmt \ - --manifest-path ${BUILDSYS_SOURCES_DIR}/Cargo.toml \ +if ! docker run --rm \ + -u $(id -u):$(id -g) \ + -e CARGO_HOME="/tmp/.cargo" \ + -v "${CARGO_HOME}":/tmp/.cargo \ + -v "${BUILDSYS_ROOT_DIR}/sources":/tmp/sources \ + "${BUILDSYS_SDK_IMAGE}" \ + cargo fmt \ + --manifest-path /tmp/sources/Cargo.toml \ --message-format short \ --all \ -- --check; then rc=1 fi -if ! cargo fmt \ - --manifest-path ${BUILDSYS_TOOLS_DIR}/Cargo.toml \ +if ! docker run --rm \ + -u $(id -u):$(id -g) \ + -e CARGO_HOME="/tmp/.cargo" \ + -v "${CARGO_HOME}":/tmp/.cargo \ + -v "${BUILDSYS_ROOT_DIR}/sources":/tmp/sources \ + -v "${BUILDSYS_ROOT_DIR}/tools":/tmp/tools \ + "${BUILDSYS_SDK_IMAGE}" \ + cargo fmt \ + --manifest-path /tmp/tools/Cargo.toml \ --message-format short \ --all \ -- --check; then From ce5eb68dcd9ab27899c358bca063fb01a0e0b9ca Mon Sep 17 00:00:00 2001 From: mjsterckx Date: Wed, 12 Apr 2023 15:44:22 +0000 Subject: [PATCH 2/2] Makefile: remove tools directory mount for sources manifest clippy check --- Makefile.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/Makefile.toml b/Makefile.toml index ed09195d107..6649fac319b 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -470,7 +470,6 @@ if ! docker run --rm \ -e CARGO_HOME="/tmp/.cargo" \ -v "${CARGO_HOME}":/tmp/.cargo \ -v "${BUILDSYS_ROOT_DIR}/sources":/tmp/sources \ - -v "${BUILDSYS_ROOT_DIR}/tools":/tmp/tools \ -e VARIANT \ "${BUILDSYS_SDK_IMAGE}" \ cargo clippy \