Skip to content

Commit 24331fa

Browse files
committed
initial commit
1 parent 82fa485 commit 24331fa

File tree

6 files changed

+79
-35
lines changed

6 files changed

+79
-35
lines changed

.github/workflows/ci.yml

+9-5
Original file line numberDiff line numberDiff line change
@@ -101,17 +101,21 @@ jobs:
101101
msrv:
102102
strategy:
103103
matrix:
104-
os: [ windows-latest, ubuntu-latest ]
104+
os: [windows-latest, ubuntu-latest]
105+
rust: [1.65.0, 1.70.0]
105106
runs-on: ${{ matrix.os }}
106107
steps:
107108
- uses: actions/checkout@v4
108109
with:
109110
submodules: true
110-
- uses: dtolnay/rust-toolchain@1.65.0
111-
- name: Patch dependencies versions # some dependencies bump MSRV without major version bump
112-
run: bash ./scripts/patch_dependencies.sh
111+
- name: Set up Rust ${{ matrix.rust }}
112+
uses: dtolnay/rust-toolchain@v1
113+
with:
114+
toolchain: ${{ matrix.rust }}
115+
- name: Patch dependencies versions
116+
- name: Patch dependencies versions # some dependencies bump MSRV without major version bump
113117
- name: Check MSRV for all crates
114-
run: bash ./scripts/msrv.sh
118+
run: bash ./scripts/msrv.sh ${{ matrix.rust }}
115119
cargo-deny:
116120
runs-on: ubuntu-latest # This uses the step `EmbarkStudios/cargo-deny-action@v1` which is only supported on Linux
117121
continue-on-error: true # Prevent sudden announcement of a new advisory from failing ci

opentelemetry-proto/CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
## vNext
44

5+
- Bump MSRV to 1.70 [](https://github.com/open-telemetry/opentelemetry-rust/pull/)
6+
57
## v0.6.0
68

79
- Update protobuf definitions to v1.3.1 [#1721](https://github.com/open-telemetry/opentelemetry-rust/pull/1721)

opentelemetry-proto/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ categories = [
1313
keywords = ["opentelemetry", "otlp", "logging", "tracing", "metrics"]
1414
license = "Apache-2.0"
1515
edition = "2021"
16-
rust-version = "1.65"
16+
rust-version = "1.70"
1717
autotests = false
1818

1919
[lib]

opentelemetry-proto/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@
55
# OpenTelemetry Proto
66
This crate contains generated files from [opentelemetry-proto](https://github.com/open-telemetry/opentelemetry-proto)
77
repository and transformation between types from generated files and types defined in [opentelemetry](https://github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry).
8+
9+
10+
*Compiler support: [requires `rustc` 1.70+][msrv]*
11+
12+
[msrv]: #supported-rust-versions

scripts/msrv.sh

+46-29
Original file line numberDiff line numberDiff line change
@@ -2,32 +2,49 @@
22

33
set -eu
44

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

scripts/msrv_config.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"1.65.0": [
3+
"opentelemetry/Cargo.toml",
4+
"opentelemetry-sdk/Cargo.toml",
5+
"opentelemetry-stdout/Cargo.toml",
6+
"opentelemetry-http/Cargo.toml",
7+
"opentelemetry-jaeger-propagator/Cargo.toml",
8+
"opentelemetry-zipkin/Cargo.toml",
9+
"opentelemetry-appender-log/Cargo.toml",
10+
"opentelemetry-appender-tracing/Cargo.toml"
11+
],
12+
"1.70.0": [
13+
"opentelemetry-otlp/Cargo.toml",
14+
"opentelemetry-proto/Cargo.toml"
15+
]
16+
}

0 commit comments

Comments
 (0)