8000 Modernize to Rust 2024 edition, add tests/, update CI by qatoqat · Pull Request #665 · not-fl3/miniquad · GitHub
[go: up one dir, main page]

Skip to content

Modernize to Rust 2024 edition, add tests/, update CI - #665

Closed
qatoqat wants to merge 4 commits into
not-fl3:masterfrom
qatoqat:main
Closed

qatoqat wants to merge 4 commits into
not-fl3:masterfrom
qatoqat:main

Conversation

@qatoqat
@qatoqat qatoqat commented Sep 7, 2026
Copy link
Copy Markdown

Summary

Modernizes the codebase to the current Rust language version and adds a real test suite:

  • Edition 2018 → 2024 (rust-version = 1.85, the edition's MSRV): migrates all unsafe extern blocks, #[unsafe(no_mangle)] attributes, and unsafe {} blocks inside unsafe fn bodies across every platform backend (Linux/X11/Wayland, Windows, macOS, iOS/tvOS, Android, WASM).
  • tests/ folder with 29 headless integration tests: conf/platform defaults, graphics value types (uniform/vertex/texture formats, pipeline defaults), event types (X11 keysym discriminants, CursorIcon exhaustiveness), and the desktop fs loader. Also adds PartialEq/Eq/Hash to UniformType (additive).
  • CI: replaces the archived actions-rs/* actions with dtolnay/rust-toolchain, adds Test (default + log-impl) and Lint (cargo fmt --check + cargo clippy -D warnings) jobs, MSRV job bumped 1.70 → 1.85, adds aarch64-apple-darwin to the build matrix.
  • Android CI: replaces the notfl3/cargo-apk container job with a cargo check matrix over all four Android ABIs — cargo-quad-apk statically links cargo 0.62, whose manifest parser rejects edition-2024 manifests, and there is no newer release (upstream repo is gone). cargo check needs no NDK and keeps the compile coverage.
  • Dependencies: dev-deps updated to glam 0.33 / fontdue 0.9 / quad-rand 0.2, with examples migrated to the glam camera API.

Notable fixes along the way

  • Fixed the Android event-loop closure capturing the non-Send F directly through the SendHack wrapper (2021+ disjoint field capture); the whole wrapper is now moved into the closure.
  • Replaced the X11 clipboard static mut MESSAGE with a Mutex<Option<String>> (removes a data-race hazard).
  • Fixed 3 doctests in ElapsedQuery docs that called GPU-context methods and were already failing.
  • Fixed all clippy warnings (including pre-existing ones) and applied rustfmt; the crate is now warning-free under -D warnings on every target.

Deliberately not changed

winapi → windows, objc-rs → objc2, and ndk-sys bumps are left out: they are large FFI rewrites that need real hardware/CI validation on those platforms and deserve separate PRs.

Verification

  • cargo build, cargo test, cargo test --features log-impl, cargo build --all-targets: green.
  • cargo fmt --check and cargo clippy --all-targets -- -D warnings: clean.
  • cargo check + cargo clippy with zero warnings on: x86_64-unknown-linux-gnu, x86_64-pc-windows-gnu, wasm32-unknown-unknown, x86_64-apple-darwin, aarch64-apple-darwin, aarch64-apple-ios, aarch64-linux-android.
  • MSRV: library compiles exactly on Rust 1.85.0.
  • Full CI matrix green on the fork before opening this PR.

qatoqat and others added 4 commits September 8, 2026 05:03
- Bump edition 2018 -> 2024 (rust-version 1.85); migrate unsafe extern
  blocks, unsafe attributes, and unsafe fn bodies across all platforms
- Fix disjoint-capture Send regression in the Android event loop closure
- Replace X11 clipboard static mut with a Mutex
- Mark GPU-context-dependent ElapsedQuery doctests as ignore (failing)
- Add tests/ with headless integration tests for conf defaults, graphics
  value types, event types, and desktop fs
- Update dev-dependencies: glam 0.33, fontdue 0.9, quad-rand 0.2 and
  migrate examples to the glam camera API
- CI: replace archived actions-rs with dtolnay/rust-toolchain, add test
  and lint jobs, bump MSRV job to 1.85
- Fix clippy warnings and apply rustfmt across all targets
The notfl3/cargo-apk image ships a toolchain older than cargo 1.85,
which fails to parse the 2024 edition manifest.
cargo-quad-apk statically links cargo 0.62, whose manifest parser
rejects edition-2024 manifests, and there is no newer release, so the
container-based APK build cannot work with this Cargo.toml anymore.
A cross-target cargo check needs no NDK/SDK and keeps compile coverage
of all four Android ABIs.
Modernize to Rust 2024 edition, add tests/
@qatoqat qatoqat closed this Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0