Skip to content

Commit 2e7b1ab

Browse files
chore(msrv): feature-gate eframe/egui behind opt-in gui feature (#39)
## Summary `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"` and breaks the MSRV CI job. Move `eframe` into a new opt-in `gui` feature so default + non-GUI optional builds stay MSRV-clean. Users who want the native viewer build with `--features gui` on a newer toolchain. ### Changes (4 files, +12/-3) | File | Change | |------|--------| | `Cargo.toml` | `eframe = { ..., optional = true }`; add `gui = ["eframe"]` feature | | `src/report/mod.rs` | cfg-gate `pub mod gui` + `pub use gui::ReportGui` | | `src/main.rs:472` | cfg-gate the `Commands::Gui` clap variant | | `src/main.rs:1703` | cfg-gate the `Commands::Gui { .. }` match arm | | `.github/workflows/rust-ci.yml` | MSRV check: `cargo check --features signing,http` (was `--all-features`) | ### Why `--features signing,http` not `--all-features` The MSRV job should test what users actually consume on the declared MSRV. `signing` (ed25519-dalek 2.1) and `http` (ureq 3.3) are both 1.85-compatible. The new `gui` feature explicitly raises MSRV — building it on 1.85 will fail, which is correct behaviour. ## Test plan - [x] `cargo check` — default build OK - [x] `cargo check --features signing,http` — the new MSRV check command OK - [x] `cargo check --features gui` — opt-in build still works - [x] `cargo clippy --all-features --all-targets -- -D warnings` — clean - [x] `cargo test --features signing,http --no-fail-fast` — all 17 suites pass - [x] `cargo fmt --check` — clean - [x] Signed commit, MPL-2.0 headers untouched ## Follow-up Future improvement: add a `cargo check --features gui` job pinned to a recent stable Rust so the GUI path stays buildable. Out of scope for this PR (single-concern unbreakage). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 0d54dc3 commit 2e7b1ab

4 files changed

Lines changed: 12 additions & 3 deletions

File tree

.github/workflows/rust-ci.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,4 +68,6 @@ jobs:
6868
uses: Swatinem/rust-cache@779680da715d629ac1d338a641029a2f4372abb5 # v2
6969

7070
- name: Check build
71-
run: cargo check --all-features
71+
# NB: the `gui` feature pulls eframe/egui which raise MSRV above 1.85.
72+
# Verify the default + non-GUI optional features compile on MSRV.
73+
run: cargo check --features signing,http

Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ chrono = "0.4"
2424
filetime = "0.2"
2525
encoding_rs = "0.8"
2626
crossterm = "0.29"
27-
eframe = "0.34"
27+
eframe = { version = "0.34", optional = true }
2828
rayon = "1.12"
2929
blake3 = { version = "1.8", features = ["mmap"] }
3030
sha2 = "0.11"
@@ -39,6 +39,9 @@ ureq = { version = "3.3", optional = true }
3939
default = []
4040
signing = ["ed25519-dalek"]
4141
http = ["ureq"]
42+
# Native GUI viewer (eframe/egui). Opt-in because eframe raises MSRV above the
43+
# 1.85.0 baseline; default builds remain pure-CLI and MSRV-clean.
44+
gui = ["eframe"]
4245

4346
[dev-dependencies]
4447
tempfile = "3.27"

src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -468,7 +468,8 @@ enum Commands {
468468
headless: bool,
469469
},
470470

471-
/// GUI review of a saved report
471+
/// GUI review of a saved report (requires `--features gui` at build time)
472+
#[cfg(feature = "gui")]
472473
Gui {
473474
/// Assault report JSON file
474475
#[arg(value_name = "REPORT")]
@@ -1700,6 +1701,7 @@ fn run_main() -> Result<()> {
17001701
}
17011702
}
17021703

1704+
#[cfg(feature = "gui")]
17031705
Commands::Gui { report, headless } => {
17041706
let content = read_report_bounded(&report)?;
17051707
let assault_report: AssaultReport = serde_json::from_str(&content)?;

src/report/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
pub mod diff;
66
pub mod formatter;
77
pub mod generator;
8+
#[cfg(feature = "gui")]
89
pub mod gui;
910
pub mod migration;
1011
pub mod output;
@@ -19,6 +20,7 @@ use std::path::Path;
1920
pub use diff::{format_diff, load_report};
2021
pub use formatter::{ReportFormatter, ReportView};
2122
pub use generator::ReportGenerator;
23+
#[cfg(feature = "gui")]
2224
pub use gui::ReportGui;
2325
pub use output::ReportOutputFormat;
2426
pub use tui::ReportTui;

0 commit comments

Comments
 (0)