From 3aa870b14c3ada9de5729982fa8e53ecc9a204fc Mon Sep 17 00:00:00 2001 From: Ben Ford Date: Tue, 29 Oct 2024 17:34:08 +0000 Subject: [PATCH] Pin rust versions in CI --- .github/workflows/github-cxx-qt-tests.yml | 4 +++- CMakeLists.txt | 5 +++-- Cargo.toml | 2 +- clippy.toml | 2 +- crates/cxx-qt-build/Cargo.toml | 2 +- crates/cxx-qt-lib-extras/Cargo.toml | 2 +- crates/cxx-qt-lib/Cargo.toml | 2 +- crates/cxx-qt-macro/Cargo.toml | 2 +- crates/cxx-qt/Cargo.toml | 2 +- crates/qt-build-utils/Cargo.toml | 2 +- 10 files changed, 14 insertions(+), 11 deletions(-) diff --git a/.github/workflows/github-cxx-qt-tests.yml b/.github/workflows/github-cxx-qt-tests.yml index f9ec471ce..666442430 100644 --- a/.github/workflows/github-cxx-qt-tests.yml +++ b/.github/workflows/github-cxx-qt-tests.yml @@ -361,7 +361,9 @@ jobs: # # Note we still need rustfmt for the cxx-qt-gen tests - name: "Install Rust toolchain" - run: rustup component add clippy rustfmt + run: | + rustup default 1.77.2 + rustup component add clippy rustfmt - name: "Rust tools cache" uses: actions/cache@v4 diff --git a/CMakeLists.txt b/CMakeLists.txt index 144b4fb43..f02c4d743 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -151,8 +151,9 @@ if(BUILD_TESTING) # Add CMake tests for `cargo test/clippy/fmt/doc`. add_test(NAME cargo_tests COMMAND cargo test --release --all-features --target-dir ${CARGO_TARGET_DIR}) add_test(NAME cargo_doc COMMAND cargo doc --release --all-features --target-dir ${CARGO_TARGET_DIR}) - add_test(NAME cargo_clippy COMMAND cargo clippy --release --all-features --target-dir ${CARGO_TARGET_DIR} -- -D warnings) - + # Minimum clippy version for the incompatible_msrv lint is 1.78.0 + add_test(NAME cargo_clippy COMMAND cargo +1.78.0 clippy --release --all-features --target-dir ${CARGO_TARGET_DIR} -- -D warnings) + set_tests_properties(cargo_tests cargo_clippy PROPERTIES ENVIRONMENT_MODIFICATION "${CARGO_ENV}" ) diff --git a/Cargo.toml b/Cargo.toml index 446330199..5e9bb171a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,13 +22,13 @@ members = [ "tests/qt_types_standalone/rust", ] resolver = "2" -rust-version = "1.77.2" [workspace.package] edition = "2021" license = "MIT OR Apache-2.0" repository = "https://github.com/KDAB/cxx-qt/" version = "0.6.1" +rust-version = "1.77.2" # Clippy needs to >= 1.78.0 for a lint, but the package can be 1.77.2 # Note a version needs to be specified on dependencies of packages # we publish, otherwise crates.io complains as it doesn't know the version. diff --git a/clippy.toml b/clippy.toml index ff0e55fde..bc19b4c32 100644 --- a/clippy.toml +++ b/clippy.toml @@ -2,4 +2,4 @@ # SPDX-FileContributor: Ben Ford # # SPDX-License-Identifier: MIT OR Apache-2.0 -msrv = "1.77.2" +msrv = "1.78.0" diff --git a/crates/cxx-qt-build/Cargo.toml b/crates/cxx-qt-build/Cargo.toml index 7ba4d3b86..618b37fea 100644 --- a/crates/cxx-qt-build/Cargo.toml +++ b/crates/cxx-qt-build/Cargo.toml @@ -11,7 +11,7 @@ edition.workspace = true license.workspace = true description = "Helpers for integrating `cxx-qt` crate into a Cargo build" repository.workspace = true -rust-version = "1.70.0" +rust-version.workspace = true [dependencies] cc.workspace = true diff --git a/crates/cxx-qt-lib-extras/Cargo.toml b/crates/cxx-qt-lib-extras/Cargo.toml index 1844c872c..3319c80af 100644 --- a/crates/cxx-qt-lib-extras/Cargo.toml +++ b/crates/cxx-qt-lib-extras/Cargo.toml @@ -11,7 +11,7 @@ license.workspace = true description = "Extra Qt types for integrating `cxx-qt` crate with `cxx` that are not available in `cxx-qt-lib`" repository.workspace = true links = "cxx-qt-lib-extras" -rust-version = "1.77.2" +rust-version.workspace = true [dependencies] cxx.workspace = true diff --git a/crates/cxx-qt-lib/Cargo.toml b/crates/cxx-qt-lib/Cargo.toml index 08a033306..e59bd23fb 100644 --- a/crates/cxx-qt-lib/Cargo.toml +++ b/crates/cxx-qt-lib/Cargo.toml @@ -18,7 +18,7 @@ exclude = [ "**/generate.sh" ] # can pass metadata from library to dependent. # See also: https://doc.rust-lang.org/cargo/reference/build-scripts.html#the-links-manifest-key links = "cxx-qt-lib" -rust-version = "1.77.2" +rust-version.workspace = true [dependencies] cxx.workspace = true diff --git a/crates/cxx-qt-macro/Cargo.toml b/crates/cxx-qt-macro/Cargo.toml index 646c4f166..5437522cd 100644 --- a/crates/cxx-qt-macro/Cargo.toml +++ b/crates/cxx-qt-macro/Cargo.toml @@ -13,7 +13,7 @@ license.workspace = true description = "A set of macros for Qt/C++ interop in Rust" repository.workspace = true homepage = "https://kdab.github.io/cxx-qt/book/" -rust-version = "1.66.1" +rust-version.workspace = true [lib] proc-macro = true diff --git a/crates/cxx-qt/Cargo.toml b/crates/cxx-qt/Cargo.toml index 58fde84bb..009649c1c 100644 --- a/crates/cxx-qt/Cargo.toml +++ b/crates/cxx-qt/Cargo.toml @@ -16,7 +16,7 @@ homepage = "https://kdab.github.io/cxx-qt/book/" readme = "README.md" keywords = ["cxx", "ffi", "QML", "Qt"] categories = ["api-bindings", "gui"] -rust-version = "1.77.2" +rust-version.workspace = true # When creating a library with cxx-qt-build, we need to set a fake "links" key # to make sure the build scripts are run in the correct order and the build scripts diff --git a/crates/qt-build-utils/Cargo.toml b/crates/qt-build-utils/Cargo.toml index cb3e173f0..c27f981e3 100644 --- a/crates/qt-build-utils/Cargo.toml +++ b/crates/qt-build-utils/Cargo.toml @@ -11,7 +11,7 @@ authors = ["Be Wilson "] license.workspace = true description = "Build script helper for linking Qt libraries and using moc code generator. Intended to be used together with cc, cpp_build, or cxx_build" repository.workspace = true -rust-version = "1.77.2" +rust-version.workspace = true [dependencies] cc.workspace = true