From 5b9c88edd3249cb00167609cef0c208008554249 Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Thu, 11 Mar 2021 10:00:26 +0100 Subject: [PATCH 1/2] More generic target directory for rust coverage --- infra/base-images/base-builder/cargo | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infra/base-images/base-builder/cargo b/infra/base-images/base-builder/cargo index 79233b600a1d..f4e884db8298 100755 --- a/infra/base-images/base-builder/cargo +++ b/infra/base-images/base-builder/cargo @@ -41,7 +41,7 @@ then # do not optimize with --release, leading to Malformed instrumentation profile data cargo build --bins # copies the build output in the expected target directory - cd target + cd `cargo metadata --format-version 1 --no-deps | jq -r '.target_directory'` mkdir -p x86_64-unknown-linux-gnu/release cp -r debug/* x86_64-unknown-linux-gnu/release/ ) From 28e53c8353a4b3c2f5a41802a7b7374bc9c6933c Mon Sep 17 00:00:00 2001 From: Philippe Antoine Date: Thu, 11 Mar 2021 16:52:42 +0100 Subject: [PATCH 2/2] Rust coverage cargo does not change PATH --- infra/base-images/base-builder/cargo | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/infra/base-images/base-builder/cargo b/infra/base-images/base-builder/cargo index f4e884db8298..670c81934967 100755 --- a/infra/base-images/base-builder/cargo +++ b/infra/base-images/base-builder/cargo @@ -21,8 +21,6 @@ # ################################################################################ -export PATH="/rust/bin:$PATH" - if [ "$SANITIZER" = "coverage" ] && [ $1 = "build" ] then crate_src_abspath=`cargo metadata --no-deps --format-version 1 | jq -r '.workspace_root'` @@ -48,4 +46,4 @@ then exit 0 fi -cargo "$@" +/rust/bin/cargo "$@"