From cfdca9321d6df5cd1bc5afbfa65d4e7f6a09e5a7 Mon Sep 17 00:00:00 2001 From: Mads Marquart Date: Sun, 8 Jan 2023 03:06:42 +0100 Subject: [PATCH] Declare a rust-version, and test it in CI This is _not_ a MSRV policy, e.g. bumping the MSRV is still NOT a breaking change --- .github/workflows/ci.yml | 33 +++++++++++++++++++++++++++++ README.md | 11 ++++++++++ crates/block-sys/Cargo.toml | 1 + crates/block2/Cargo.toml | 1 + crates/icrate/Cargo.toml | 1 + crates/objc-sys/Cargo.toml | 1 + crates/objc2-encode/Cargo.toml | 1 + crates/objc2-proc-macros/Cargo.toml | 1 + crates/objc2/Cargo.toml | 1 + 9 files changed, 51 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b27fedbc3..b86134f33 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -153,6 +153,39 @@ jobs: - name: cargo clippy run: cargo clippy --all-targets ${{ matrix.args }} + msrv: + name: Check MSRV + runs-on: ubuntu-latest + + env: + CARGO_BUILD_TARGET: x86_64-apple-darwin + + steps: + - uses: actions/checkout@v3 + with: + submodules: true + + - name: Install Rust toolchain + uses: actions-rs/toolchain@v1 + with: + toolchain: '1.60' + profile: minimal + override: true + target: x86_64-apple-darwin + + - name: Cache Cargo + uses: actions/cache@v3 + with: + path: ${{ env.CARGO_CACHE_PATH }} + key: cargo-${{ github.job }}-${{ matrix.name }}-${{ hashFiles('**/Cargo.lock') }} + + - name: cargo check + run: >- + cargo check + $PUBLIC_CRATES + --features=$INTERESTING_FEATURES + --features=unstable-frameworks-macos-12 + ui: name: Compiler UI runs-on: macos-latest diff --git a/README.md b/README.md index 1c86f82e4..752063900 100644 --- a/README.md +++ b/README.md @@ -113,6 +113,17 @@ so on, with every following release. [#32]: https://github.com/madsmtm/objc2/issues/32 +## Minimum Supported Rust Version (MSRV) + +The _currently_ minimum supported Rust version is `1.60`; this is _not_ +defined by policy, though, so it may change in at any time in a patch +release. + +Help us define a policy over in [#203]. + +[#203]: https://github.com/madsmtm/objc2/issues/203 + + ## License This project is licensed under the MIT license, see [`LICENSE.txt`]. diff --git a/crates/block-sys/Cargo.toml b/crates/block-sys/Cargo.toml index 90928ab32..43fa18bee 100644 --- a/crates/block-sys/Cargo.toml +++ b/crates/block-sys/Cargo.toml @@ -3,6 +3,7 @@ name = "block-sys" version = "0.1.0-beta.2" # Remember to update html_root_url in lib.rs authors = ["Mads Marquart "] edition = "2021" +rust-version = "1.60" description = "Raw bindings to Apple's C language extension of blocks" keywords = ["objective-c", "macos", "ios", "blocks", "sys"] diff --git a/crates/block2/Cargo.toml b/crates/block2/Cargo.toml index 70fb06bae..40f8dad52 100644 --- a/crates/block2/Cargo.toml +++ b/crates/block2/Cargo.toml @@ -4,6 +4,7 @@ name = "block2" version = "0.2.0-alpha.7" authors = ["Steven Sheldon", "Mads Marquart "] edition = "2021" +rust-version = "1.60" description = "Apple's C language extension of blocks" keywords = ["objective-c", "macos", "ios", "blocks"] diff --git a/crates/icrate/Cargo.toml b/crates/icrate/Cargo.toml index 26c82cb4a..8cd1777dc 100644 --- a/crates/icrate/Cargo.toml +++ b/crates/icrate/Cargo.toml @@ -3,6 +3,7 @@ name = "icrate" version = "0.0.1" authors = ["Mads Marquart "] edition = "2021" +rust-version = "1.60" description = "Bindings to Apple's frameworks" keywords = ["macos", "ios", "cocoa", "apple", "framework"] diff --git a/crates/objc-sys/Cargo.toml b/crates/objc-sys/Cargo.toml index 9aa632e41..a39b21d8f 100644 --- a/crates/objc-sys/Cargo.toml +++ b/crates/objc-sys/Cargo.toml @@ -5,6 +5,7 @@ name = "objc-sys" version = "0.2.0-beta.3" authors = ["Mads Marquart "] edition = "2021" +rust-version = "1.60" description = "Raw bindings to the Objective-C runtime and ABI" keywords = ["objective-c", "macos", "ios", "objc_msgSend", "sys"] diff --git a/crates/objc2-encode/Cargo.toml b/crates/objc2-encode/Cargo.toml index 56d66e13c..ab926dd15 100644 --- a/crates/objc2-encode/Cargo.toml +++ b/crates/objc2-encode/Cargo.toml @@ -4,6 +4,7 @@ name = "objc2-encode" version = "2.0.0-pre.3" authors = ["Steven Sheldon", "Mads Marquart "] edition = "2021" +rust-version = "1.60" description = "Objective-C type-encodings" keywords = ["objective-c", "macos", "ios", "encode"] diff --git a/crates/objc2-proc-macros/Cargo.toml b/crates/objc2-proc-macros/Cargo.toml index e4894e689..8d39a85b7 100644 --- a/crates/objc2-proc-macros/Cargo.toml +++ b/crates/objc2-proc-macros/Cargo.toml @@ -4,6 +4,7 @@ name = "objc2-proc-macros" version = "0.1.0" authors = ["Mads Marquart ", "Calvin Watford"] edition = "2021" +rust-version = "1.60" description = "Procedural macros for the objc2 project" keywords = ["objective-c", "macos", "ios", "proc-macro"] diff --git a/crates/objc2/Cargo.toml b/crates/objc2/Cargo.toml index afe11d92f..a8609fbb9 100644 --- a/crates/objc2/Cargo.toml +++ b/crates/objc2/Cargo.toml @@ -3,6 +3,7 @@ name = "objc2" version = "0.3.0-beta.4" # Remember to update html_root_url in lib.rs authors = ["Steven Sheldon", "Mads Marquart "] edition = "2021" +rust-version = "1.60" description = "Objective-C interface and bindings to the Cocoa Foundation framework" keywords = ["objective-c", "macos", "ios", "objc_msgSend", "cocoa"]