Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[resolver]
Copy link

Copilot AI May 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider expanding the comment in this config to clearly document when and why the 'fallback' resolver is used, for enhanced clarity in future maintenance.

Copilot uses AI. Check for mistakes.
# https://doc.rust-lang.org/cargo/reference/config.html#resolverincompatible-rust-versions
incompatible-rust-versions = "fallback"
30 changes: 15 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
external-types:
strategy:
matrix:
example: [opentelemetry, opentelemetry-sdk, opentelemetry-otlp, opentelemetry-zipkin]
member: [opentelemetry, opentelemetry-sdk, opentelemetry-otlp, opentelemetry-zipkin]
runs-on: ubuntu-latest # TODO: Check if this could be covered for Windows. The step used currently fails on Windows.
steps:
- name: Harden the runner (Audit all outbound calls)
Expand All @@ -96,20 +96,20 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b
with:
toolchain: nightly-2024-06-30
# Rust version should be kept in sync with the one the release was tested with
# https://github.com/awslabs/cargo-check-external-types/releases
toolchain: nightly-2025-05-04
components: rustfmt
- name: Patch dependencies versions
run: bash ./scripts/patch_dependencies.sh
- uses: taiki-e/install-action@33734a118689b0b418824fb78ea2bf18e970b43b # v2.50.4
with:
tool: [email protected]
- name: external-type-check
run: |
cargo install [email protected]
cd ${{ matrix.example }}
cargo check-external-types --all-features --config allowed-external-types.toml
working-directory: ${{ matrix.member }}
run: cargo check-external-types --all-features --config allowed-external-types.toml
msrv:
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
rust: [1.75.0]
runs-on: ${{ matrix.os }}
continue-on-error: true
steps:
Expand All @@ -121,14 +121,14 @@ jobs:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
submodules: true
- name: Set up Rust ${{ matrix.rust }}
uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b
- uses: dtolnay/rust-toolchain@b3b07ba8b418998c39fb20f53e8b695cdcc8de1b
with:
toolchain: stable
- uses: taiki-e/install-action@33734a118689b0b418824fb78ea2bf18e970b43b # v2.50.4
with:
toolchain: ${{ matrix.rust }}
- name: Patch dependencies versions
run: bash ./scripts/patch_dependencies.sh
tool: cargo-msrv
- name: Check MSRV for all crates
run: bash ./scripts/msrv.sh ${{ matrix.rust }}
run: bash ./scripts/msrv.sh
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
Expand Down
55 changes: 5 additions & 50 deletions scripts/msrv.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,10 @@

set -eu

Copy link

Copilot AI May 22, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider adding a comment to document that the script now retrieves all workspace member manifests using cargo metadata, clarifying the new MSRV verification scope.

Suggested change
# Retrieve all workspace member manifests using `cargo metadata`.
# This defines the scope of MSRV (Minimum Supported Rust Version) verification.

Copilot uses AI. Check for mistakes.
# Check if a version is specified as parameter
if [ $# -eq 0 ]; then
echo "No Rust version specified. Usage: $0 <rust-version>"
exit 1
fi
members=$(cargo metadata -q --no-deps --format-version 1 | jq -r '.packages[].manifest_path')

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"

# 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
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" | tr '\n' ' ')
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
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
for member in $members; do
echo "Verifying MSRV version for $member"
cargo msrv verify --manifest-path "$member" --output-format json
echo "" # just for nicer separation between packages
done
14 changes: 0 additions & 14 deletions scripts/msrv_config.json

This file was deleted.

10 changes: 0 additions & 10 deletions scripts/patch_dependencies.sh

This file was deleted.

Loading