From 99d80379d7402883b590d3d47457880f4f056ec7 Mon Sep 17 00:00:00 2001 From: Ryo Onodera Date: Tue, 2 Apr 2024 16:47:25 +0900 Subject: [PATCH 1/6] Support running miri in ci --- scripts/cargo-clippy-stable.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/cargo-clippy-stable.sh b/scripts/cargo-clippy-stable.sh index ed564503e6ae2a..0d270a68a236eb 100755 --- a/scripts/cargo-clippy-stable.sh +++ b/scripts/cargo-clippy-stable.sh @@ -29,3 +29,6 @@ source "$here/../ci/rust-version.sh" stable --deny=clippy::arithmetic_side_effects \ --deny=clippy::manual_let_else \ --deny=clippy::used_underscore_binding + +"$here/cargo-for-all-lock-files.sh" -- \ + miri test -p solana-program -- hash:: account_info:: From 5a235cc760137f81f40dd49c13f2c31d28b3a514 Mon Sep 17 00:00:00 2001 From: Ryo Onodera Date: Tue, 2 Apr 2024 17:07:28 +0900 Subject: [PATCH 2/6] fail fast... --- ci/test-checks.sh | 3 +++ scripts/cargo-clippy-stable.sh | 3 --- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/test-checks.sh b/ci/test-checks.sh index a2022204df7ad4..48c9fd17b925d0 100755 --- a/ci/test-checks.sh +++ b/ci/test-checks.sh @@ -46,6 +46,9 @@ echo --- build environment wasm-pack --version ) +rustup component add miri --toolchain "$rust_stable" +cargo miri test -p solana-program -- hash:: account_info:: + export RUST_BACKTRACE=1 export RUSTFLAGS="-D warnings -A incomplete_features" diff --git a/scripts/cargo-clippy-stable.sh b/scripts/cargo-clippy-stable.sh index 0d270a68a236eb..ed564503e6ae2a 100755 --- a/scripts/cargo-clippy-stable.sh +++ b/scripts/cargo-clippy-stable.sh @@ -29,6 +29,3 @@ source "$here/../ci/rust-version.sh" stable --deny=clippy::arithmetic_side_effects \ --deny=clippy::manual_let_else \ --deny=clippy::used_underscore_binding - -"$here/cargo-for-all-lock-files.sh" -- \ - miri test -p solana-program -- hash:: account_info:: From f865f262733da888d1b60293c1a41b36c0a7692f Mon Sep 17 00:00:00 2001 From: Ryo Onodera Date: Tue, 2 Apr 2024 17:10:27 +0900 Subject: [PATCH 3/6] wait miri is still not stable? --- ci/test-checks.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/test-checks.sh b/ci/test-checks.sh index 48c9fd17b925d0..89016cae6b1094 100755 --- a/ci/test-checks.sh +++ b/ci/test-checks.sh @@ -46,8 +46,8 @@ echo --- build environment wasm-pack --version ) -rustup component add miri --toolchain "$rust_stable" -cargo miri test -p solana-program -- hash:: account_info:: +rustup component add miri --toolchain "$rust_nightly" +$cargoNightly miri test -p solana-program -- hash:: account_info:: export RUST_BACKTRACE=1 export RUSTFLAGS="-D warnings -A incomplete_features" From e83dc226c6acf198563a8f2cbce9fab9dbad37ff Mon Sep 17 00:00:00 2001 From: Ryo Onodera Date: Tue, 2 Apr 2024 17:25:48 +0900 Subject: [PATCH 4/6] clean up --- ci/buildkite-pipeline.sh | 1 + ci/test-checks.sh | 3 --- ci/test-miri.sh | 11 +++++++++++ 3 files changed, 12 insertions(+), 3 deletions(-) create mode 100755 ci/test-miri.sh diff --git a/ci/buildkite-pipeline.sh b/ci/buildkite-pipeline.sh index 4ae00c9feab586..e0b51ef9e4acdb 100755 --- a/ci/buildkite-pipeline.sh +++ b/ci/buildkite-pipeline.sh @@ -143,6 +143,7 @@ all_test_steps() { command_step checks1 "ci/docker-run-default-image.sh ci/test-checks.sh" 20 check command_step checks2 "ci/docker-run-default-image.sh ci/test-dev-context-only-utils.sh check-bins" 15 check command_step checks3 "ci/docker-run-default-image.sh ci/test-dev-context-only-utils.sh check-all-targets" 15 check + command_step miri "ci/docker-run-default-image.sh ci/test-miri.sh" 5 check wait_step # Full test suite diff --git a/ci/test-checks.sh b/ci/test-checks.sh index 89016cae6b1094..a2022204df7ad4 100755 --- a/ci/test-checks.sh +++ b/ci/test-checks.sh @@ -46,9 +46,6 @@ echo --- build environment wasm-pack --version ) -rustup component add miri --toolchain "$rust_nightly" -$cargoNightly miri test -p solana-program -- hash:: account_info:: - export RUST_BACKTRACE=1 export RUSTFLAGS="-D warnings -A incomplete_features" diff --git a/ci/test-miri.sh b/ci/test-miri.sh new file mode 100755 index 00000000000000..a46e2714de96a2 --- /dev/null +++ b/ci/test-miri.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +set -eo pipefail + +source ci/rust-version.sh nightly + +rustup component add miri --toolchain "$rust_nightly" + +# miri is very slow; so only run very few of selective tests! +cargo "+${rust_nightly}" miri test -p solana-program -- hash:: account_info:: + From fd16ae438649bddfad150029205575c4d7d3029f Mon Sep 17 00:00:00 2001 From: Ryo Onodera Date: Tue, 2 Apr 2024 17:26:31 +0900 Subject: [PATCH 5/6] fmt --- ci/test-miri.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/test-miri.sh b/ci/test-miri.sh index a46e2714de96a2..dc3958a66ea93a 100755 --- a/ci/test-miri.sh +++ b/ci/test-miri.sh @@ -8,4 +8,3 @@ rustup component add miri --toolchain "$rust_nightly" # miri is very slow; so only run very few of selective tests! cargo "+${rust_nightly}" miri test -p solana-program -- hash:: account_info:: - From 2c370a69b97e0b66ccec65080e9186e40318cd96 Mon Sep 17 00:00:00 2001 From: Ryo Onodera Date: Tue, 2 Apr 2024 17:47:02 +0900 Subject: [PATCH 6/6] Move to Dockerfile --- ci/docker/Dockerfile | 1 + ci/test-miri.sh | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/ci/docker/Dockerfile b/ci/docker/Dockerfile index cee80877c6db5d..4e792f1368a1ad 100644 --- a/ci/docker/Dockerfile +++ b/ci/docker/Dockerfile @@ -73,6 +73,7 @@ RUN \ rustup install $RUST_NIGHTLY_VERSION && \ rustup component add clippy --toolchain=$RUST_NIGHTLY_VERSION && \ rustup component add rustfmt --toolchain=$RUST_NIGHTLY_VERSION && \ + rustup component add miri --toolchain=$RUST_NIGHTLY_VERSION && \ rustup target add wasm32-unknown-unknown && \ cargo install cargo-audit && \ cargo install cargo-hack && \ diff --git a/ci/test-miri.sh b/ci/test-miri.sh index dc3958a66ea93a..407d48c34106a2 100755 --- a/ci/test-miri.sh +++ b/ci/test-miri.sh @@ -4,7 +4,5 @@ set -eo pipefail source ci/rust-version.sh nightly -rustup component add miri --toolchain "$rust_nightly" - # miri is very slow; so only run very few of selective tests! cargo "+${rust_nightly}" miri test -p solana-program -- hash:: account_info::