From d783375d29cd3c5cd8d91352a429e8744e250b14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gonz=C3=A1lez?= Date: Wed, 20 Sep 2023 13:10:17 +0100 Subject: [PATCH 1/2] ci: Parametrise the MSRV MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Currently, to update the MSRV, several places in the ci.sh script need to be changed. * Create an environment variable to define the MSRV so that only one change is needed to update it. Signed-off-by: Tomás González --- ci.sh | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ci.sh b/ci.sh index 4b847b0c..5ca0384c 100755 --- a/ci.sh +++ b/ci.sh @@ -156,6 +156,7 @@ setup_mappings() { # Use the newest version of the Rust toolchain rustup update +MSRV=1.66.0 # Parse arguments NO_CARGO_CLEAN= @@ -247,12 +248,12 @@ fi git submodule update --init if [ "$PROVIDER_NAME" = "coverage" ]; then - rustup toolchain install 1.66.0 + rustup toolchain install ${MSRV} PROVIDERS="trusted-service mbed-crypto tpm pkcs11" EXCLUDES="fuzz/*,e2e_tests/*,src/providers/cryptoauthlib/*,src/authenticators/jwt_svid_authenticator/*" UNIT_TEST_FEATURES="unix-peer-credentials-authenticator,direct-authenticator" # Install tarpaulin - cargo +1.66.0 install cargo-tarpaulin + cargo +${MSRV} install cargo-tarpaulin mkdir -p reports @@ -268,7 +269,7 @@ if [ "$PROVIDER_NAME" = "coverage" ]; then cp -r $(pwd)/e2e_tests/fake_mappings/* mappings # Start service - RUST_LOG=info cargo +1.66.0 tarpaulin --out Xml --forward --command build --exclude-files="$EXCLUDES" \ + RUST_LOG=info cargo +${MSRV} tarpaulin --out Xml --forward --command build --exclude-files="$EXCLUDES" \ --output-dir $(pwd)/reports/$provider --features="$provider-provider,direct-authenticator" \ --run-types bins --timeout 3600 -- -c $CONFIG_PATH & wait_for_service @@ -286,7 +287,7 @@ if [ "$PROVIDER_NAME" = "coverage" ]; then fi # Start service - RUST_LOG=info cargo +1.66.0 tarpaulin --out Xml --forward --command build --exclude-files="$EXCLUDES" \ + RUST_LOG=info cargo +${MSRV} tarpaulin --out Xml --forward --command build --exclude-files="$EXCLUDES" \ --output-dir $(pwd)/reports/$provider --features="$provider-provider,direct-authenticator" \ --run-types bins --timeout 3600 -- -c $CONFIG_PATH & wait_for_service @@ -297,7 +298,7 @@ if [ "$PROVIDER_NAME" = "coverage" ]; then # Run unit tests mkdir -p reports/unit - cargo +1.66.0 tarpaulin --tests --out Xml --features=$UNIT_TEST_FEATURES --exclude-files="$EXCLUDES" --output-dir $(pwd)/reports/unit + cargo +${MSRV} tarpaulin --tests --out Xml --features=$UNIT_TEST_FEATURES --exclude-files="$EXCLUDES" --output-dir $(pwd)/reports/unit exit 0 fi @@ -332,9 +333,9 @@ if [ "$PROVIDER_NAME" = "cargo-check" ]; then # - openSUSE Tumbleweed # - openSUSE Leap 15.4 - rustup toolchain install 1.66.0 + rustup toolchain install ${MSRV} # TODO: The "jwt-svid-authenticator" is currently not being used. - RUST_BACKTRACE=1 cargo +1.66.0 check --release --features=all-providers,direct-authenticator,unix-peer-credentials-authenticator + RUST_BACKTRACE=1 cargo +${MSRV} check --release --features=all-providers,direct-authenticator,unix-peer-credentials-authenticator # Latest stable rustup toolchain install stable From 8b34f74291f40314994eef66d8a028727722f681 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1s=20Gonz=C3=A1lez?= Date: Wed, 20 Sep 2023 13:02:05 +0100 Subject: [PATCH 2/2] ci/coverage: Fix cargo-tarpaulin version to 0.26.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The nightly coverage build is currently failing as it is failing to compile the cargo-tarpaulin crate 0.27.0 with the rust compiler 1.66 (our current MSRV). We cannot upgrade the current MSRV because certain distros need that version, so we can only: * Fix the version of cargo-tarpaulin to 0.26.1 This version should be unfixed when the MSRV upgrade is performed. Signed-off-by: Tomás González --- ci.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ci.sh b/ci.sh index 5ca0384c..e9ac5dce 100755 --- a/ci.sh +++ b/ci.sh @@ -253,7 +253,8 @@ if [ "$PROVIDER_NAME" = "coverage" ]; then EXCLUDES="fuzz/*,e2e_tests/*,src/providers/cryptoauthlib/*,src/authenticators/jwt_svid_authenticator/*" UNIT_TEST_FEATURES="unix-peer-credentials-authenticator,direct-authenticator" # Install tarpaulin - cargo +${MSRV} install cargo-tarpaulin + # TODO: Stop using the --version parameter when MSRV is upgraded. + cargo +${MSRV} install cargo-tarpaulin --version 0.26.1 mkdir -p reports