From 24331fa2f0f07d3ce02a5ab8cd940cffa16206c5 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Tue, 4 Jun 2024 11:50:15 -0700 Subject: [PATCH 01/12] initial commit --- .github/workflows/ci.yml | 14 +++--- opentelemetry-proto/CHANGELOG.md | 2 + opentelemetry-proto/Cargo.toml | 2 +- opentelemetry-proto/README.md | 5 +++ scripts/msrv.sh | 75 ++++++++++++++++++++------------ scripts/msrv_config.json | 16 +++++++ 6 files changed, 79 insertions(+), 35 deletions(-) create mode 100644 scripts/msrv_config.json diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4332693776..a8b903d98f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -101,17 +101,21 @@ jobs: msrv: strategy: matrix: - os: [ windows-latest, ubuntu-latest ] + os: [windows-latest, ubuntu-latest] + rust: [1.65.0, 1.70.0] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v4 with: submodules: true - - uses: dtolnay/rust-toolchain@1.65.0 - - name: Patch dependencies versions # some dependencies bump MSRV without major version bump - run: bash ./scripts/patch_dependencies.sh + - name: Set up Rust ${{ matrix.rust }} + uses: dtolnay/rust-toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + - name: Patch dependencies versions + - name: Patch dependencies versions # some dependencies bump MSRV without major version bump - name: Check MSRV for all crates - run: bash ./scripts/msrv.sh + run: bash ./scripts/msrv.sh ${{ matrix.rust }} cargo-deny: runs-on: ubuntu-latest # This uses the step `EmbarkStudios/cargo-deny-action@v1` which is only supported on Linux continue-on-error: true # Prevent sudden announcement of a new advisory from failing ci diff --git a/opentelemetry-proto/CHANGELOG.md b/opentelemetry-proto/CHANGELOG.md index eee7294902..3ed6cf804f 100644 --- a/opentelemetry-proto/CHANGELOG.md +++ b/opentelemetry-proto/CHANGELOG.md @@ -2,6 +2,8 @@ ## vNext +- Bump MSRV to 1.70 [](https://github.com/open-telemetry/opentelemetry-rust/pull/) + ## v0.6.0 - Update protobuf definitions to v1.3.1 [#1721](https://github.com/open-telemetry/opentelemetry-rust/pull/1721) diff --git a/opentelemetry-proto/Cargo.toml b/opentelemetry-proto/Cargo.toml index 1ff235ba6a..65836b58e7 100644 --- a/opentelemetry-proto/Cargo.toml +++ b/opentelemetry-proto/Cargo.toml @@ -13,7 +13,7 @@ categories = [ keywords = ["opentelemetry", "otlp", "logging", "tracing", "metrics"] license = "Apache-2.0" edition = "2021" -rust-version = "1.65" +rust-version = "1.70" autotests = false [lib] diff --git a/opentelemetry-proto/README.md b/opentelemetry-proto/README.md index b540bc4403..aaf39e2ec1 100644 --- a/opentelemetry-proto/README.md +++ b/opentelemetry-proto/README.md @@ -5,3 +5,8 @@ # OpenTelemetry Proto This crate contains generated files from [opentelemetry-proto](https://github.com/open-telemetry/opentelemetry-proto) repository and transformation between types from generated files and types defined in [opentelemetry](https://github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry). + + +*Compiler support: [requires `rustc` 1.70+][msrv]* + +[msrv]: #supported-rust-versions diff --git a/scripts/msrv.sh b/scripts/msrv.sh index eb9386cfa3..b01489adfd 100755 --- a/scripts/msrv.sh +++ b/scripts/msrv.sh @@ -2,32 +2,49 @@ set -eu -echo "Running msrv check for opentelemetry package" -cargo check --manifest-path=opentelemetry/Cargo.toml --all-features - -echo "Running msrv check for opentelemetry-sdk package" -cargo check --manifest-path=opentelemetry-sdk/Cargo.toml --all-features - -echo "Running msrv check for opentelemetry-stdout package" -cargo check --manifest-path=opentelemetry-stdout/Cargo.toml --all-features - -# TODO: Ignoring as this is failing with the following error: -# 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 -#echo "Running msrv check for opentelemetry-otlp package" -# cargo check --manifest-path=opentelemetry-otlp/Cargo.toml --all-features - -echo "Running msrv check for opentelemetry-http package" -cargo check --manifest-path=opentelemetry-http/Cargo.toml --all-features - -echo "Running msrv check for opentelemetry-jaeger-propagator package" -cargo check --manifest-path=opentelemetry-jaeger-propagator/Cargo.toml --all-features - -echo "Running msrv check for opentelemetry-zipkin package" -cargo check --manifest-path=opentelemetry-zipkin/Cargo.toml --all-features - -echo "Running msrv check for opentelemetry-appender-log package" -cargo check --manifest-path=opentelemetry-appender-log/Cargo.toml --all-features - -echo "Running msrv check for opentelemetry-appender-tracing package" -cargo check --manifest-path=opentelemetry-appender-tracing/Cargo.toml --all-features - +# Check if a version is specified as parameter +if [ $# -eq 0 ]; then + echo "No Rust version specified. Usage: $0 " + exit 1 +fi + +RUST_VERSION=$1 + +# Determine the directory containing the script +SCRIPT_DIR=$(dirname "$(readlink -f "$0")") + +# Path to the configuration file +CONFIG_FILE="$SCRIPT_DIR/msrv_config.json" + +# function to check if specified toolchain is installed +check_rust_toolchain_installed() { + local version=$1 + if ! rustup toolchain list | grep -q "$version"; then + echo "Rust toolchain $version is not installed. Please install it using 'rustup toolchain install $version'." + exit 1 + fi +} + +# check if specified toolchain is installed +check_rust_toolchain_installed "$RUST_VERSION" + +# Extract the exact installed rust version string +installed_version=$(rustup toolchain list | grep "$RUST_VERSION" | awk '{print $1}') + +# Read the configuration file and get the packages for the specified version +if [ -f "$CONFIG_FILE" ]; then + packages=$(jq -r --arg version "$RUST_VERSION" '.[$version] | .[]' "$CONFIG_FILE") + if [ -z "$packages" ]; then + echo "No packages found for Rust version $RUST_VERSION in the configuration file." + exit 1 + fi +else + echo "Configuration file $CONFIG_FILE not found." + exit 1 +fi + +# Check MSRV for the packages +for package in $packages; do + echo "Running msrv check for $package with Rust $installed_version" + rustup run "$installed_version" cargo check --manifest-path=$package --all-features +done \ No newline at end of file diff --git a/scripts/msrv_config.json b/scripts/msrv_config.json new file mode 100644 index 0000000000..8ab4f8122a --- /dev/null +++ b/scripts/msrv_config.json @@ -0,0 +1,16 @@ +{ + "1.65.0": [ + "opentelemetry/Cargo.toml", + "opentelemetry-sdk/Cargo.toml", + "opentelemetry-stdout/Cargo.toml", + "opentelemetry-http/Cargo.toml", + "opentelemetry-jaeger-propagator/Cargo.toml", + "opentelemetry-zipkin/Cargo.toml", + "opentelemetry-appender-log/Cargo.toml", + "opentelemetry-appender-tracing/Cargo.toml" + ], + "1.70.0": [ + "opentelemetry-otlp/Cargo.toml", + "opentelemetry-proto/Cargo.toml" + ] + } \ No newline at end of file From 434ea09b15d2c041cb7edc5711cf7c525a2d40a8 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Tue, 4 Jun 2024 12:00:24 -0700 Subject: [PATCH 02/12] fix yaml --- .github/workflows/ci.yml | 2 +- opentelemetry-proto/README.md | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a8b903d98f..dc55d5df62 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -109,7 +109,7 @@ jobs: with: submodules: true - name: Set up Rust ${{ matrix.rust }} - uses: dtolnay/rust-toolchain@v1 + - uses: dtolnay/rust-toolchain@master with: toolchain: ${{ matrix.rust }} - name: Patch dependencies versions diff --git a/opentelemetry-proto/README.md b/opentelemetry-proto/README.md index aaf39e2ec1..e655fbeacd 100644 --- a/opentelemetry-proto/README.md +++ b/opentelemetry-proto/README.md @@ -7,6 +7,4 @@ This crate contains generated files from [opentelemetry-proto](https://github.co repository and transformation between types from generated files and types defined in [opentelemetry](https://github.com/open-telemetry/opentelemetry-rust/tree/main/opentelemetry). -*Compiler support: [requires `rustc` 1.70+][msrv]* - -[msrv]: #supported-rust-versions +*Compiler support: [requires `rustc` 1.70+] \ No newline at end of file From 20c0f2f913eab7dee372748a8790829b8ee521de Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Tue, 4 Jun 2024 12:02:38 -0700 Subject: [PATCH 03/12] fix yaml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dc55d5df62..96e441f1cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -113,7 +113,7 @@ jobs: with: toolchain: ${{ matrix.rust }} - name: Patch dependencies versions - - name: Patch dependencies versions # some dependencies bump MSRV without major version bump + run: bash ./scripts/patch_dependencies.sh - name: Check MSRV for all crates run: bash ./scripts/msrv.sh ${{ matrix.rust }} cargo-deny: From c877ffeca20494b0b4bdaaf6f1fd543e24615d1f Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Tue, 4 Jun 2024 12:14:34 -0700 Subject: [PATCH 04/12] more yaml changes --- .github/workflows/ci.yml | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 96e441f1cc..bcfdd71a0b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -105,17 +105,17 @@ jobs: rust: [1.65.0, 1.70.0] runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 - with: - submodules: true - - name: Set up Rust ${{ matrix.rust }} - - uses: dtolnay/rust-toolchain@master - with: - toolchain: ${{ matrix.rust }} - - name: Patch dependencies versions - run: bash ./scripts/patch_dependencies.sh - - name: Check MSRV for all crates - run: bash ./scripts/msrv.sh ${{ matrix.rust }} + - uses: actions/checkout@v4 + with: + submodules: true + - name: Set up Rust ${{ matrix.rust }} + uses: dtolnay/rust-toolchain@master + with: + toolchain: ${{ matrix.rust }} + - name: Patch dependencies versions + run: bash ./scripts/patch_dependencies.sh + - name: Check MSRV for all crates + run: bash ./scripts/msrv.sh ${{ matrix.rust }} cargo-deny: runs-on: ubuntu-latest # This uses the step `EmbarkStudios/cargo-deny-action@v1` which is only supported on Linux continue-on-error: true # Prevent sudden announcement of a new advisory from failing ci From 6d9ec610962c67566d379fd0ab08fc04dc47848b Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Tue, 4 Jun 2024 13:25:22 -0700 Subject: [PATCH 05/12] run script from correct path --- scripts/msrv.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/scripts/msrv.sh b/scripts/msrv.sh index b01489adfd..db1713ec4e 100755 --- a/scripts/msrv.sh +++ b/scripts/msrv.sh @@ -16,6 +16,9 @@ SCRIPT_DIR=$(dirname "$(readlink -f "$0")") # Path to the configuration file CONFIG_FILE="$SCRIPT_DIR/msrv_config.json" +# Change to the root directory of the repository +cd "$SCRIPT_DIR/.." + # function to check if specified toolchain is installed check_rust_toolchain_installed() { local version=$1 @@ -43,6 +46,8 @@ else exit 1 fi +echo "checking packages: "$packages +echo # Check MSRV for the packages for package in $packages; do echo "Running msrv check for $package with Rust $installed_version" From 27a01f9fa6b2c4b9a58d03d2e81fcd8594b83a70 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Tue, 4 Jun 2024 13:48:25 -0700 Subject: [PATCH 06/12] fix script --- scripts/msrv.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/scripts/msrv.sh b/scripts/msrv.sh index db1713ec4e..4e0baf0a2b 100755 --- a/scripts/msrv.sh +++ b/scripts/msrv.sh @@ -13,6 +13,8 @@ RUST_VERSION=$1 # Determine the directory containing the script SCRIPT_DIR=$(dirname "$(readlink -f "$0")") +echo "Current working directory: $(pwd)" + # Path to the configuration file CONFIG_FILE="$SCRIPT_DIR/msrv_config.json" @@ -50,6 +52,8 @@ echo "checking packages: "$packages echo # Check MSRV for the packages for package in $packages; do - echo "Running msrv check for $package with Rust $installed_version" + echo "Running MSRV check for $package with Rust $installed_version" + echo "Current working directory: $(pwd)" + echo "Command: rustup run \"$installed_version\" cargo check --manifest-path=\"$package\" --all-features" rustup run "$installed_version" cargo check --manifest-path=$package --all-features done \ No newline at end of file From f0af219cbe3d9fb4627b797a1ac9fb578e65c05b Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Tue, 4 Jun 2024 13:58:40 -0700 Subject: [PATCH 07/12] handle windows new line --- scripts/msrv.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/msrv.sh b/scripts/msrv.sh index 4e0baf0a2b..991868fa23 100755 --- a/scripts/msrv.sh +++ b/scripts/msrv.sh @@ -38,7 +38,7 @@ installed_version=$(rustup toolchain list | grep "$RUST_VERSION" | awk '{print $ # Read the configuration file and get the packages for the specified version if [ -f "$CONFIG_FILE" ]; then - packages=$(jq -r --arg version "$RUST_VERSION" '.[$version] | .[]' "$CONFIG_FILE") + packages=$(jq -r --arg version "$RUST_VERSION" '.[$version] | .[]' "$CONFIG_FILE" | tr '\n' ' ') if [ -z "$packages" ]; then echo "No packages found for Rust version $RUST_VERSION in the configuration file." exit 1 From a54db842f26c86d41909063099e6f23bac5a0fdc Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Tue, 4 Jun 2024 14:48:03 -0700 Subject: [PATCH 08/12] fix newlines for packages --- scripts/msrv.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/msrv.sh b/scripts/msrv.sh index 991868fa23..7c5c7a2061 100755 --- a/scripts/msrv.sh +++ b/scripts/msrv.sh @@ -52,6 +52,7 @@ echo "checking packages: "$packages echo # Check MSRV for the packages for package in $packages; do + package=$(echo "$package" | tr -d '\r\n') # Remove any newline and carriage return characters echo "Running MSRV check for $package with Rust $installed_version" echo "Current working directory: $(pwd)" echo "Command: rustup run \"$installed_version\" cargo check --manifest-path=\"$package\" --all-features" From 61be6f52c0a4b16a6ee1991c66f8f3706ba76706 Mon Sep 17 00:00:00 2001 From: Lalit Kumar Bhasin Date: Tue, 4 Jun 2024 14:51:05 -0700 Subject: [PATCH 09/12] fix newlines for packages --- scripts/msrv.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/msrv.sh b/scripts/msrv.sh index 7c5c7a2061..68313727e6 100755 --- a/scripts/msrv.sh +++ b/scripts/msrv.sh @@ -53,8 +53,10 @@ echo # Check MSRV for the packages for package in $packages; do package=$(echo "$package" | tr -d '\r\n') # Remove any newline and carriage return characters + echo "Processing pacakge:"$package":" echo "Running MSRV check for $package with Rust $installed_version" echo "Current working directory: $(pwd)" echo "Command: rustup run \"$installed_version\" cargo check --manifest-path=\"$package\" --all-features" + echo "Package length: ${#package}" rustup run "$installed_version" cargo check --manifest-path=$package --all-features done \ No newline at end of file From 8211c8cea98b48ceaf1da5527b6ab6ff1f658931 Mon Sep 17 00:00:00 2001 From: Lalit Date: Tue, 4 Jun 2024 15:56:38 -0700 Subject: [PATCH 10/12] remove comments --- scripts/msrv.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/scripts/msrv.sh b/scripts/msrv.sh index 68313727e6..55c035dbe8 100755 --- a/scripts/msrv.sh +++ b/scripts/msrv.sh @@ -53,10 +53,6 @@ echo # Check MSRV for the packages for package in $packages; do package=$(echo "$package" | tr -d '\r\n') # Remove any newline and carriage return characters - echo "Processing pacakge:"$package":" - echo "Running MSRV check for $package with Rust $installed_version" - echo "Current working directory: $(pwd)" echo "Command: rustup run \"$installed_version\" cargo check --manifest-path=\"$package\" --all-features" - echo "Package length: ${#package}" rustup run "$installed_version" cargo check --manifest-path=$package --all-features done \ No newline at end of file From f9899a0c1951bb00516af9bd8eb0a6d48288a340 Mon Sep 17 00:00:00 2001 From: Lalit Date: Tue, 4 Jun 2024 16:05:39 -0700 Subject: [PATCH 11/12] add newline --- scripts/msrv.sh | 8 +++----- scripts/msrv_config.json | 3 ++- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/scripts/msrv.sh b/scripts/msrv.sh index 55c035dbe8..30c080a33b 100755 --- a/scripts/msrv.sh +++ b/scripts/msrv.sh @@ -13,14 +13,14 @@ RUST_VERSION=$1 # Determine the directory containing the script SCRIPT_DIR=$(dirname "$(readlink -f "$0")") -echo "Current working directory: $(pwd)" - # Path to the configuration file CONFIG_FILE="$SCRIPT_DIR/msrv_config.json" # Change to the root directory of the repository cd "$SCRIPT_DIR/.." +echo "Current working directory: $(pwd)" + # function to check if specified toolchain is installed check_rust_toolchain_installed() { local version=$1 @@ -48,11 +48,9 @@ else exit 1 fi -echo "checking packages: "$packages -echo # Check MSRV for the packages for package in $packages; do package=$(echo "$package" | tr -d '\r\n') # Remove any newline and carriage return characters echo "Command: rustup run \"$installed_version\" cargo check --manifest-path=\"$package\" --all-features" rustup run "$installed_version" cargo check --manifest-path=$package --all-features -done \ No newline at end of file +done diff --git a/scripts/msrv_config.json b/scripts/msrv_config.json index 8ab4f8122a..321c2afda3 100644 --- a/scripts/msrv_config.json +++ b/scripts/msrv_config.json @@ -13,4 +13,5 @@ "opentelemetry-otlp/Cargo.toml", "opentelemetry-proto/Cargo.toml" ] - } \ No newline at end of file + } + \ No newline at end of file From 21f7264f21871ffe16507038d9994ac42d1832ba Mon Sep 17 00:00:00 2001 From: Lalit Date: Tue, 4 Jun 2024 16:08:52 -0700 Subject: [PATCH 12/12] update changelog --- opentelemetry-proto/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/opentelemetry-proto/CHANGELOG.md b/opentelemetry-proto/CHANGELOG.md index 3ed6cf804f..afcccc6ea4 100644 --- a/opentelemetry-proto/CHANGELOG.md +++ b/opentelemetry-proto/CHANGELOG.md @@ -2,7 +2,7 @@ ## vNext -- Bump MSRV to 1.70 [](https://github.com/open-telemetry/opentelemetry-rust/pull/) +- Bump MSRV to 1.70 [1864](https://github.com/open-telemetry/opentelemetry-rust/pull/1874) ## v0.6.0