aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Cargo.toml1
-rwxr-xr-xci/install-dependencies.sh8
-rwxr-xr-xci/run-rust-checks.sh5
3 files changed, 14 insertions, 0 deletions
diff --git a/Cargo.toml b/Cargo.toml
index 45c9b34981..2f51bf5d5f 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -2,6 +2,7 @@
name = "gitcore"
version = "0.1.0"
edition = "2018"
+rust-version = "1.49.0"
[lib]
crate-type = ["staticlib"]
diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh
index dcd22ddd95..29e558bb9c 100755
--- a/ci/install-dependencies.sh
+++ b/ci/install-dependencies.sh
@@ -10,6 +10,8 @@ begin_group "Install dependencies"
P4WHENCE=https://cdist2.perforce.com/perforce/r23.2
LFSWHENCE=https://github.com/github/git-lfs/releases/download/v$LINUX_GIT_LFS_VERSION
JGITWHENCE=https://repo1.maven.org/maven2/org/eclipse/jgit/org.eclipse.jgit.pgm/6.8.0.202311291450-r/org.eclipse.jgit.pgm-6.8.0.202311291450-r.sh
+CARGO_MSRV_VERSION=0.18.4
+CARGO_MSRV_WHENCE=https://github.com/foresterre/cargo-msrv/releases/download/v$CARGO_MSRV_VERSION/cargo-msrv-x86_64-unknown-linux-musl-v$CARGO_MSRV_VERSION.tgz
# Make sudo a no-op and execute the command directly when running as root.
# While using sudo would be fine on most platforms when we are root already,
@@ -130,6 +132,12 @@ RustAnalysis)
sudo apt-get -q -y install rustup
rustup default stable
rustup component add clippy rustfmt
+
+ wget -q "$CARGO_MSRV_WHENCE" -O "cargo-msvc.tgz"
+ sudo mkdir -p "$CUSTOM_PATH"
+ sudo tar -xf "cargo-msvc.tgz" --strip-components=1 \
+ --directory "$CUSTOM_PATH" --wildcards "*/cargo-msrv"
+ sudo chmod a+x "$CUSTOM_PATH/cargo-msrv"
;;
sparse)
sudo apt-get -q -y install libssl-dev libcurl4-openssl-dev \
diff --git a/ci/run-rust-checks.sh b/ci/run-rust-checks.sh
index fb5ea8991b..b5ad9e8dc6 100755
--- a/ci/run-rust-checks.sh
+++ b/ci/run-rust-checks.sh
@@ -14,4 +14,9 @@ then
RET=1
fi
+if ! group "Check for minimum required Rust version" cargo msrv verify
+then
+ RET=1
+fi
+
exit $RET