From 7afaab109794c9e13a16ed610ff1fa992a07427e Mon Sep 17 00:00:00 2001 From: hyperpolymath <6759885+hyperpolymath@users.noreply.github.com> Date: Tue, 26 May 2026 09:43:07 +0100 Subject: [PATCH] chore(msrv): feature-gate eframe/egui behind opt-in `gui` feature MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `eframe = "0.34"` (and the egui chain it pulls) raises MSRV above 1.85.0, which conflicts with the project's declared `rust-version = "1.85.0"`. The MSRV CI job ran `cargo check --all-features` against 1.85, so any push silently passed (the job is currently red on main) or would fail once toolchain caches refresh. Move eframe into a new opt-in `gui` feature. The default and existing optional features (`signing`, `http`) stay MSRV-clean; users who want the native viewer build with `--features gui` on a newer toolchain. Changes: - Cargo.toml: `eframe = { ..., optional = true }`; add `gui = ["eframe"]`. - src/report/mod.rs: cfg-gate `mod gui` and the `pub use ReportGui`. - src/main.rs: cfg-gate the `Commands::Gui` clap variant and its match arm. - .github/workflows/rust-ci.yml: MSRV `cargo check` now uses `--features signing,http` (drops `--all-features` to exclude `gui`). Verified locally: * `cargo check` — OK (default) * `cargo check --features signing,http` — OK (the new MSRV check command) * `cargo check --features gui` — OK (opt-in build still works) * `cargo clippy --all-features --all-targets -- -D warnings` — clean * `cargo test --features signing,http --no-fail-fast` — all 17 suites OK * `cargo fmt --check` — clean Co-Authored-By: Claude Opus 4.7 (1M context) --- .github/workflows/rust-ci.yml | 4 +++- Cargo.toml | 5 ++++- src/main.rs | 4 +++- src/report/mod.rs | 2 ++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index b33d5eb..94879a9 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -68,4 +68,6 @@ jobs: uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2 - name: Check build - run: cargo check --all-features + # NB: the `gui` feature pulls eframe/egui which raise MSRV above 1.85. + # Verify the default + non-GUI optional features compile on MSRV. + run: cargo check --features signing,http diff --git a/Cargo.toml b/Cargo.toml index c941029..bc88b75 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,7 @@ chrono = "0.4" filetime = "0.2" encoding_rs = "0.8" crossterm = "0.29" -eframe = "0.34" +eframe = { version = "0.34", optional = true } rayon = "1.12" blake3 = { version = "1.8", features = ["mmap"] } sha2 = "0.11" @@ -39,6 +39,9 @@ ureq = { version = "3.3", optional = true } default = [] signing = ["ed25519-dalek"] http = ["ureq"] +# Native GUI viewer (eframe/egui). Opt-in because eframe raises MSRV above the +# 1.85.0 baseline; default builds remain pure-CLI and MSRV-clean. +gui = ["eframe"] [dev-dependencies] tempfile = "3.27" diff --git a/src/main.rs b/src/main.rs index 90a2210..b4009e8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -468,7 +468,8 @@ enum Commands { headless: bool, }, - /// GUI review of a saved report + /// GUI review of a saved report (requires `--features gui` at build time) + #[cfg(feature = "gui")] Gui { /// Assault report JSON file #[arg(value_name = "REPORT")] @@ -1700,6 +1701,7 @@ fn run_main() -> Result<()> { } } + #[cfg(feature = "gui")] Commands::Gui { report, headless } => { let content = read_report_bounded(&report)?; let assault_report: AssaultReport = serde_json::from_str(&content)?; diff --git a/src/report/mod.rs b/src/report/mod.rs index 74f3c1b..d933d4a 100644 --- a/src/report/mod.rs +++ b/src/report/mod.rs @@ -5,6 +5,7 @@ pub mod diff; pub mod formatter; pub mod generator; +#[cfg(feature = "gui")] pub mod gui; pub mod migration; pub mod output; @@ -19,6 +20,7 @@ use std::path::Path; pub use diff::{format_diff, load_report}; pub use formatter::{ReportFormatter, ReportView}; pub use generator::ReportGenerator; +#[cfg(feature = "gui")] pub use gui::ReportGui; pub use output::ReportOutputFormat; pub use tui::ReportTui;