Skip to content

Commit

Permalink
Lock MSRV to 1.60 and validate in CI (#362)
Browse files Browse the repository at this point in the history
* Lock MSRV to 1.60 and validate in CI

Prevent inadvertently bumping MSRV in PRs by checking against MSRV in
the CI, to disallow any large bumps without rationale.  Rust 1.60 is 7
months old at the time of writing, and also required by `winit` which
uses `android-ndk-rs`, hence must be compatible with it.

This does not mean that we cannot bump MSRV at all, but we must remain a
tad conservative; at the same time setting [`rust-version`] in the
manifest provides everyone on Rust 1.56 and higher a helpful error
message when their version is lower than what we require.

[`rust-version`]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-rust-version-field

* ndk-build: Bump quick-xml to 0.26 to solve accidental MSRV bump

Git history suggests that `quick-xml` backed out of an (un?)intentional
MSRV bump and is now back at Rust 1.46; well below our MSRV needed for
`winit`.
  • Loading branch information
MarijnS95 authored Nov 21, 2022
1 parent d7e307e commit 107f03e
Show file tree
Hide file tree
Showing 9 changed files with 24 additions and 2 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,20 @@ jobs:
# also compile cleanly under this target.
args: --all --all-targets --all-features --target aarch64-linux-android -- -Dwarnings

check_msrv:
name: Check MSRV (1.60.0)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: dtolnay/rust-toolchain@1.60.0
with:
target: aarch64-linux-android
- uses: actions-rs/cargo@v1
with:
command: check
# See comment above about using one of our supported targets.
args: --workspace --all-targets --all-features --target aarch64-linux-android

build:
strategy:
fail-fast: false
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Rust on Android

[![Rust](https://github.com/rust-windowing/android-ndk-rs/workflows/Rust/badge.svg)](https://github.com/rust-windowing/android-ndk-rs/actions) ![MIT license](https://img.shields.io/badge/License-MIT-green.svg) ![APACHE2 license](https://img.shields.io/badge/License-APACHE2-green.svg)
[![Rust](https://github.com/rust-windowing/android-ndk-rs/workflows/Rust/badge.svg)](https://github.com/rust-windowing/android-ndk-rs/actions) ![MIT license](https://img.shields.io/badge/License-MIT-green.svg) ![APACHE2 license](https://img.shields.io/badge/License-APACHE2-green.svg) [![MSRV](https://img.shields.io/badge/rustc-1.60.0+-ab6000.svg)](https://blog.rust-lang.org/2022/04/07/Rust-1.60.0.html)


Libraries and tools for Rust programming on Android targets:

Expand Down
1 change: 1 addition & 0 deletions cargo-apk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ keywords = ["android", "ndk", "apk"]
documentation = "https://docs.rs/cargo-apk"
homepage = "https://github.com/rust-windowing/android-ndk-rs"
repository = "https://github.com/rust-windowing/android-ndk-rs"
rust-version = "1.60"

[dependencies]
anyhow = "1.0.57"
Expand Down
3 changes: 2 additions & 1 deletion ndk-build/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ keywords = ["android", "ndk", "apk"]
documentation = "https://docs.rs/ndk-build"
homepage = "https://github.com/rust-windowing/android-ndk-rs"
repository = "https://github.com/rust-windowing/android-ndk-rs"
rust-version = "1.60"

[dependencies]
dirs = "4"
dunce = "1"
quick-xml = { version = "0.25", features = ["serialize"] }
quick-xml = { version = "0.26", features = ["serialize"] }
serde = { version = "1", features = ["derive"] }
thiserror = "1"
which = "4"
1 change: 1 addition & 0 deletions ndk-context/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ keywords = ["android", "ndk", "apk", "jni"]
documentation = "https://docs.rs/ndk-context"
homepage = "https://github.com/rust-windowing/android-ndk-rs"
repository = "https://github.com/rust-windowing/android-ndk-rs"
rust-version = "1.60"
1 change: 1 addition & 0 deletions ndk-glue/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ readme = "README.md"
documentation = "https://docs.rs/ndk-glue"
homepage = "https://github.com/rust-windowing/android-ndk-rs"
repository = "https://github.com/rust-windowing/android-ndk-rs"
rust-version = "1.60"

[dependencies]
android_logger = { version = "0.11", optional = true }
Expand Down
1 change: 1 addition & 0 deletions ndk-macro/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ readme = "README.md"
documentation = "https://docs.rs/ndk-macro"
homepage = "https://github.com/rust-windowing/android-ndk-rs"
repository = "https://github.com/rust-windowing/android-ndk-rs"
rust-version = "1.60"

[lib]
proc-macro = true
Expand Down
1 change: 1 addition & 0 deletions ndk-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ readme = "../README.md"
documentation = "https://docs.rs/android-ndk-sys"
homepage = "https://github.com/rust-windowing/android-ndk-rs"
repository = "https://github.com/rust-windowing/android-ndk-rs"
rust-version = "1.60"

[dependencies]
jni-sys = "0.3.0"
Expand Down
1 change: 1 addition & 0 deletions ndk/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ readme = "../README.md"
documentation = "https://docs.rs/android-ndk"
homepage = "https://github.com/rust-windowing/android-ndk-rs"
repository = "https://github.com/rust-windowing/android-ndk-rs"
rust-version = "1.60"

[features]
all = ["audio", "bitmap","media", "api-level-30"]
Expand Down

0 comments on commit 107f03e

Please sign in to comment.