2
2
3
3
set -eu
4
4
5
- echo " Running msrv check for opentelemetry package"
6
- cargo check --manifest-path=opentelemetry/Cargo.toml --all-features
7
-
8
- echo " Running msrv check for opentelemetry-sdk package"
9
- cargo check --manifest-path=opentelemetry-sdk/Cargo.toml --all-features
10
-
11
- echo " Running msrv check for opentelemetry-stdout package"
12
- cargo check --manifest-path=opentelemetry-stdout/Cargo.toml --all-features
13
-
14
- # TODO: Ignoring as this is failing with the following error:
15
- # error: package `prost-derive v0.12.6` cannot be built because it requires rustc 1.70 or newer, while the currently active rustc version is 1.65.0
16
- # echo "Running msrv check for opentelemetry-otlp package"
17
- # cargo check --manifest-path=opentelemetry-otlp/Cargo.toml --all-features
18
-
19
- echo " Running msrv check for opentelemetry-http package"
20
- cargo check --manifest-path=opentelemetry-http/Cargo.toml --all-features
21
-
22
- echo " Running msrv check for opentelemetry-jaeger-propagator package"
23
- cargo check --manifest-path=opentelemetry-jaeger-propagator/Cargo.toml --all-features
24
-
25
- echo " Running msrv check for opentelemetry-zipkin package"
26
- cargo check --manifest-path=opentelemetry-zipkin/Cargo.toml --all-features
27
-
28
- echo " Running msrv check for opentelemetry-appender-log package"
29
- cargo check --manifest-path=opentelemetry-appender-log/Cargo.toml --all-features
30
-
31
- echo " Running msrv check for opentelemetry-appender-tracing package"
32
- cargo check --manifest-path=opentelemetry-appender-tracing/Cargo.toml --all-features
33
-
5
+ # Check if a version is specified as parameter
6
+ if [ $# -eq 0 ]; then
7
+ echo " No Rust version specified. Usage: $0 <rust-version>"
8
+ exit 1
9
+ fi
10
+
11
+ RUST_VERSION=$1
12
+
13
+ # Determine the directory containing the script
14
+ SCRIPT_DIR=$( dirname " $( readlink -f " $0 " ) " )
15
+
16
+ # Path to the configuration file
17
+ CONFIG_FILE=" $SCRIPT_DIR /msrv_config.json"
18
+
19
+ # function to check if specified toolchain is installed
20
+ check_rust_toolchain_installed () {
21
+ local version=$1
22
+ if ! rustup toolchain list | grep -q " $version " ; then
23
+ echo " Rust toolchain $version is not installed. Please install it using 'rustup toolchain install $version '."
24
+ exit 1
25
+ fi
26
+ }
27
+
28
+ # check if specified toolchain is installed
29
+ check_rust_toolchain_installed " $RUST_VERSION "
30
+
31
+ # Extract the exact installed rust version string
32
+ installed_version=$( rustup toolchain list | grep " $RUST_VERSION " | awk ' {print $1}' )
33
+
34
+ # Read the configuration file and get the packages for the specified version
35
+ if [ -f " $CONFIG_FILE " ]; then
36
+ packages=$( jq -r --arg version " $RUST_VERSION " ' .[$version] | .[]' " $CONFIG_FILE " )
37
+ if [ -z " $packages " ]; then
38
+ echo " No packages found for Rust version $RUST_VERSION in the configuration file."
39
+ exit 1
40
+ fi
41
+ else
42
+ echo " Configuration file $CONFIG_FILE not found."
43
+ exit 1
44
+ fi
45
+
46
+ # Check MSRV for the packages
47
+ for package in $packages ; do
48
+ echo " Running msrv check for $package with Rust $installed_version "
49
+ rustup run " $installed_version " cargo check --manifest-path=$package --all-features
50
+ done
0 commit comments