Skip to content

ci: cross-check opc-gui against the Windows target - #32

Merged
kyaky merged 1 commit into
mainfrom
ci/gui-cross-check
Aug 26, 2026
Merged

ci: cross-check opc-gui against the Windows target#32
kyaky merged 1 commit into
mainfrom
ci/gui-cross-check

Conversation

@kyaky

@kyaky kyaky commented Aug 26, 2026

Copy link
Copy Markdown
Owner

v0.2.0-alpha.21 was tagged, built artifacts on every Linux platform, and then died — because opc-gui failed to compile on both macOS x86_64 and Windows. create-release never ran, nothing was published, and the fix turned out to be eleven _f32 suffixes (#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-gui sits outside the workspace with its own Cargo.lock. So:

  • cargo build --workspace --all-targets does not reach it
  • cargo clippy --workspace does not lint it
  • cargo fmt --all -- --check does not format-check it

The 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:

error: The platform you're compiling for is not supported by winit
  --> winit-0.30.13/src/platform_impl/mod.rs:78:1

bins/opc-gui/Cargo.toml takes eframe with default-features = false and only default_fonts, glow, persistence — no x11, no wayland. 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:

cargo check --manifest-path bins/opc-gui/Cargo.toml --target x86_64-pc-windows-msvc --locked

~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:

  • With the fix in place, the check is clean.
  • Reintroducing the alpha.21 bug on a single 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

So this job would have caught the exact failure that blocked the release, on a PR, in under a minute.

-D warnings comes from setup-rust-toolchain's default, which CI keeps deliberately — #31 removed it from release.yml only.

Limits, stated plainly

  • macOS is not covered. Cross-checking it needs the Apple SDK. A macOS-only break is still possible; the mitigation is that the code that changes is shared, and the alpha.21 failure hit Windows too.
  • This is check, not build. It will not catch a link error or a Windows-only runtime problem — the release job still does that.
  • 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 red immediately, so it wants its own reformat commit first and is deliberately not bundled here.

`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.
@kyaky
kyaky merged commit fd7f0c2 into main Aug 26, 2026
9 checks passed
@kyaky kyaky mentioned this pull request Aug 26, 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