mirror of
https://github.com/rust-mobile/android-activity.git
synced 2026-07-10 16:54:10 +00:00
Fix various codebase rots (stale CI, new Rust lints, broken MSRV checks by transitive dependency upgrades) (#164)
* game_activity/ffi: Drop cfg for inexistant `target_arch = "armv7"` [Rust 1.80 from July 25th 2024] points out that `armv7` is not a known, valid value for the `target_arch` cfg variable. This is confirmed by the docs not listing it either: https://doc.rust-lang.org/reference/conditional-compilation.html#target_arch Hence drop this entirely, and rely purely on `target_arch = "arm"`. [Rust 1.80 from July 25th 2024]: https://blog.rust-lang.org/2024/07/25/Rust-1.80.0.html * Fix `unexpected-cfgs` by adding `api-level-30` feature and removing `test` Some code copied from the NDK carried over the respective `feature` `cfg` guards, without ever adding the feature to the `[features]` list in `Cargo.toml`. Now that Rust detects these mishaps, we can fix it by removing `test` (bindings don't seem to be run-tested) and reexpose `ConfigurationRef::screen_round()` which was behind a previously unsettable `feature = "api-level-30"`. Also remove `unsafe impl Send/Sync for ConfigurationRef` since the upstream `ndk` already declares `Configuration` to be `Send` and `Sync`, and `RwLock` and `Arc` carry that through. * native_activity: Fix clippy lints around `NativeActivityGlue` not `SendSync` and unwritten `redraw_needed` field * CI: Remove deprecated/unmaintained `actions-rs` toolchain setup The `actions-rs` containers haven't been maintained and updated for years and don't need to: GitHub's actions environment already comes fully loaded with a complete `stable` Rust installation with the standard tools (in this case `rustfmt`). Remove the remaining toolchain setup (which was already replaced with `hecrj/setup-rust-action` elsewhere) to get rid of ancient Node 12 deprecation warnings. * Bump dependency patch-versions to fix `-Zminimal-versions` and MSRV check Use `-Zminimal-versions` in our MSRV check. This not only ensures our minimum version bounds are actually solid and tested (even if they may be a bit conservative at times, i.e. we could allow older versions except for the crates that are bumped in this patch which were explicitly build-tested), it also allows us to use this as a base for the MSRV test, and preempt us from failing it whenever a (transitive!) dependency bumps its MSRV beyond ours in a *semver-compatible* release. * Elide redundant `impl` block lifetimes following stricter Rust 1.83 lint Rust now points out that `impl<'a> (Trait for) Struct<'a>` is superfluous whenever `'a` is not used anywhere else in the `impl` block.
This commit is contained in:
@@ -21,6 +21,20 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
# Downgrade all dependencies to their minimum version, both to ensure our
|
||||
# minimum version bounds are correct and buildable, as well as to satisfy
|
||||
# our MSRV check when arbitrary dependencies bump their MSRV beyond our
|
||||
# MSRV in a patch-release.
|
||||
# This implies that downstream consumers can only rely on our MSRV when
|
||||
# downgrading various (transitive) dependencies.
|
||||
- uses: hecrj/setup-rust-action@v2
|
||||
with:
|
||||
rust-version: nightly
|
||||
if: ${{ matrix.rust-version != 'stable' }}
|
||||
- name: Downgrade dependencies
|
||||
run: cargo +nightly generate-lockfile -Zminimal-versions
|
||||
if: ${{ matrix.rust-version != 'stable' }}
|
||||
|
||||
- uses: hecrj/setup-rust-action@v2
|
||||
with:
|
||||
rust-version: ${{ matrix.rust-version }}
|
||||
@@ -87,13 +101,6 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: actions-rs/toolchain@v1
|
||||
with:
|
||||
profile: minimal
|
||||
toolchain: stable
|
||||
override: true
|
||||
components: rustfmt
|
||||
|
||||
- name: Format
|
||||
run: cargo fmt --all -- --check
|
||||
working-directory: android-activity
|
||||
|
||||
Reference in New Issue
Block a user