ci: cross-check opc-gui against the Windows target - #32
Merged
Conversation
`bins/opc-gui` lives outside the workspace with its own Cargo.lock, so
`cargo build --workspace` never reaches it and `cargo fmt --all` never
format-checks it. The practical effect is that the GUI was compiled for
the first time *during a release*.
That is how v0.2.0-alpha.21 died. Eleven `float_literal_f32_fallback`
errors in opc-gui surfaced only after Linux x86_64, Linux aarch64 and
macOS arm64 had all produced artifacts; `create-release` never ran and
nothing was published. A lint that would have been a one-line PR fix
instead cost a release cycle.
The GUI cannot be built on Linux at all: `eframe` is taken with
`default-features = false` and neither `x11` nor `wayland`, so winit
stops with "The platform you're compiling for is not supported". Adding
those features is a real decision about whether a Linux GUI is
supported — not something to do incidentally for CI.
Cross-checking against the Windows target does work from an ubuntu
runner, and it is enough: the lints that bite here are type-inference
lints, which fire during `cargo check` with no linker and no Windows
runner minutes. Measured at ~26s for a cold dependency graph.
Verified rather than assumed — with the fix in place the check is
clean, and reintroducing the alpha.21 bug on one line reproduces the
release failure exactly:
$ sed -i 's/Stroke::new(1.0_f32, TEXT_SECONDARY)/Stroke::new(1.0, TEXT_SECONDARY)/' \
bins/opc-gui/src/theme.rs
$ RUSTFLAGS="-D warnings" cargo check \
--manifest-path bins/opc-gui/Cargo.toml \
--target x86_64-pc-windows-msvc --locked
error: falling back to `f32` as the trait bound `f32: From<f64>` is not satisfied
--> src/theme.rs:30:60
error: could not compile `opc-gui` (bin "opc-gui") due to 1 previous error
`-D warnings` comes from the setup-rust-toolchain default, which CI
keeps deliberately (release.yml no longer does).
macOS is still not cross-checked — that needs the Apple SDK. A
macOS-only break remains possible; the shared code is what changes.
Not addressed: `bins/opc-gui/src/views.rs` has 21 rustfmt diffs on
main, for the same out-of-workspace reason. Adding `--manifest-path`
to the fmt job would turn that into a red CI on the next push, so it
wants its own reformat commit first.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
v0.2.0-alpha.21was tagged, built artifacts on every Linux platform, and then died — becauseopc-guifailed to compile on both macOS x86_64 and Windows.create-releasenever ran, nothing was published, and the fix turned out to be eleven_f32suffixes (#31).That is a bad trade: a one-line-per-site lint cost a release cycle, because CI never builds
opc-gui.Why it is invisible today
bins/opc-guisits outside the workspace with its ownCargo.lock. So:cargo build --workspace --all-targetsdoes not reach itcargo clippy --workspacedoes not lint itcargo fmt --all -- --checkdoes not format-check itThe GUI is compiled for the first time during a release. Every GUI regression is therefore discovered at tag time, on a runner, after everything else has already succeeded.
Why not just build it on Linux
I tried, with a full GTK stack. It cannot work:
bins/opc-gui/Cargo.tomltakeseframewithdefault-features = falseand onlydefault_fonts,glow,persistence— nox11, nowayland. That is consistent with the release artifacts, which ship the GUI for macOS and Windows only. Adding those features is a real decision about whether a Linux GUI is supported, not something to do incidentally for CI.What this does instead
Cross-check against the Windows target from the existing ubuntu runner — no linker, no Windows runner minutes:
~26s for a cold dependency graph. The lints that bite here are type-inference lints, so they fire during
check.Verified, not assumed
Both directions, locally:
So this job would have caught the exact failure that blocked the release, on a PR, in under a minute.
-D warningscomes fromsetup-rust-toolchain's default, which CI keeps deliberately — #31 removed it fromrelease.ymlonly.Limits, stated plainly
check, notbuild. It will not catch a link error or a Windows-only runtime problem — the release job still does that.views.rshas 21 rustfmt diffs onmain, for the same out-of-workspace reason. Adding--manifest-pathto the fmt job would turn that red immediately, so it wants its own reformat commit first and is deliberately not bundled here.