Originally created by: Akarsh-Hegde
The Windows tray build failed to compile meridian-tray with six errors — all one class: macOS-only code reaching a Windows build.
error[E0455]: link kind `framework` is only supported on Apple targets
--> tray\src-tauri\src\capture\ui_events.rs:79:35
error[E0455]: link kind `framework` is only supported on Apple targets
--> tray\src-tauri\src\lib.rs:927:42
error[E0425]: cannot find function `with_autorelease_pool` in this scope
--> tray\src-tauri\src\capture\screenpipe.rs:106:27
error[E0599]: no method named `title_bar_style` found ...
--> tray\src-tauri\src\tray.rs:202:10
error: unused variable: `app_handle` (system.rs:57, tray.rs:122)
The capture module looks Apple-only (Apple Vision OCR, autorelease pools, IOKit), which invites the wrong fix — gating capture off on Windows. The code says otherwise: capture/screenpipe.rs:468 already has a perform_ocr_windows arm, drm_detector.rs is fully paired macOS/non-macOS, and there are documented Windows permission stubs at 573/583. The forked screenpipe crates compile on Windows too — nothing in the CI log failed inside them, only in meridian-tray.
So this is an incomplete Windows port, not unportable code. Gating capture off would have silently disabled a feature that is actively being built, and left the Windows tray producing no sessions.
Three missing Windows arms, mirroring the both-arms pattern already in these files:
| Site | Fix |
|---|---|
capture/screenpipe.rs |
with_autorelease_pool was macOS-gated but called from the shared engine loop (L106). Added a pass-through non-macOS arm, so the loop stays platform-agnostic instead of cfg-ing the call site. |
capture/ui_events.rs |
input_monitoring_granted (IOKit) gated to macOS + a Windows arm returning true — no TCC there, matching the fork's own screenpipe_a11y::platform::windows check_permissions(). |
lib.rs |
start_capture's CGPreflightScreenCaptureAccess launch gate scoped to macOS, always-open on Windows. |
Two errors were unrelated to capture, and were the same eight duplicated lines in tray.rs and commands/system.rs: a revert-to-Accessory window hook whose #[cfg] sat on the closure body, so on Windows the closure captured nothing and app_handle tripped -D warnings. Extracted to sys::revert_to_accessory_on_close — gated once instead of twice — and dropped the now-unused WindowEvent import from tray.rs.
title_bar_style is restructured out of the builder chain because both the method and tauri::TitleBarStyle are macOS-only — a #[cfg] on the call alone still leaves an unresolvable type. Windows keeps a standard title bar (the wizard card sits ~26px lower; cosmetic, layout holds).
cargo clippy --all-targets clean, cargo fmt --check clean, 114 tests pass.cfg'd out on macOS, so the local checks verified zero of it. Cross-compiling is blocked by ring's C build needing the MSVC headers, which wouldn't faithfully reproduce the msvc CI anyway.Worth flagging for review: the Windows-only arms — including the pre-existing perform_ocr_windows path — have never been type-checked by any compiler, because resolution errors (E0455/E0425) abort before type-checking. A round-2 CI error is possible, most likely another unused-on-Windows-only binding under -D warnings, which is exactly what errors 5 and 6 were. Windows CI on this PR is the real check.
🤖 Generated with Claude Code
Originally posted by: coderabbitai[bot]
✨ Finishing Touches
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests - [ ] Commit unit tests in branch `fix/windows-tray-build`Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)Comment
@coderabbitai helpto get the list of available commands.Originally posted by: Akarsh-Hegde
Review
The diagnosis and all six fixes are correct. But the PR asks "Windows CI on this PR is the real check" — I went and read that check, and it does not say what the green tick implies.
The green "Windows portability" check does not cover this PR
That job's tray step is non-blocking:
Its blocking steps are
cargo check/test -p meridian -p meridian-core— neither touchesmeridian-tray, and every file in this PR is undertray/src-tauri/. So the job is green while verifying zero lines of this change.The step itself failed. From the job log (run 88281045925):
The tray still does not compile on Windows. The 15 are all
-D dead-code, in three files:backend_install.rscleanup_legacy_screenpipe,cleanup_legacy_mlx_server,cleanup_legacy_a11y_helper,migrate_legacy_bundle_env,apply_subs,render_plist,register_agent,launchctlcapture/drm_detector.rsSAFARI_STYLE_BROWSERS,CHROMIUM_STYLE_BROWSERS,current_tab_url_script,scriptable_browsers,NATIVE_APP_PROCESS_HINTScommands/app_icons.rs,sys.rscache_key,uid_strThis is not a regression — it's the next layer
All 15 are pre-existing macOS-only helpers, and none sit on code this PR adds. They were invisible before precisely because E0455/E0425 abort ahead of dead-code analysis — exactly the mechanism the PR body predicts, and it landed one round earlier than expected. Removing the resolution errors is what exposed them. This PR adds zero new dead code: both new items (
sys::revert_to_accessory_on_close, the Windowsinput_monitoring_granted) are called unconditionally and are live on Windows.So: correct, net-positive, and it advances the burn-down. It just doesn't reach what the title claims.
Ask
The repo already has the exact pattern for these —
#[cfg_attr(not(target_os = "macos"), allow(dead_code))], as used atlib.rs:663/673/680andcommands/app_icons.rs:40/91. Either:check trayactually goes green and the port is finished; orfix(tray): resolve the Windows link/resolution errors in the capture moduleand track the dead-code layer separately.I'd take (a) — the remaining work is mechanical, and it's the only way the "finished" claim gets a compiler behind it. Worth considering dropping
continue-on-erroronce it's green, otherwise the next round regresses silently the same way.Nits
ui_events.rs—input_monitoring_grantedhas arms formacosandwindowsonly. Any third target fails to resolve.sys.rs:138already models the alternative (all(not(macos), not(windows))), and the sibling arm added in this same PR (with_autorelease_pool) usesnot(macos). Usingnot(target_os = "macos")here would be self-consistent and target-complete.sys.rs— two mechanisms for one problem.winis silenced with#[cfg_attr(not(macos), allow(unused_variables))]on the parameter whileappuses a trailinglet _ = app;. A singlelet _ = (app, win);in thenot(macos)block would drop the attribute and keep the signature clean.tray.rswizard sizing. The comment says the card sits ~26px lower on Windows, butinner_sizeis the client area in Tauri — with an opaque title bar the webview is still 1000x680 and the card still centres; the outer window just grows. Cosmetic either way, but the note reads as describing a shift that shouldn't occur.Originally posted by: Akarsh-Hegde
Review was correct on every point, including the one that mattered most: I cited the green "Windows portability" tick as verification without checking that its tray step is
continue-on-error: true. The job was green while compiling none of this PR. Confirmed the 15 dead-code errors in the run you linked.Took (a). Pushed in
51891a7c:The 15 items now carry
#[cfg_attr(not(target_os = "macos"), allow(dead_code))], the pattern already atlib.rs:663/673/680andapp_icons.rs:40/91— 8 launchd/plist helpers inbackend_install.rs, the 5 AppleScript browser tables incapture/drm_detector.rs,app_icons::cache_key,sys::uid_str. Agreed these are pre-existing and that this PR adds no new dead code; the attribute is the repo's existing answer for exactly this.Nits, all three taken:
input_monitoring_granted's non-Apple arm is nownot(target_os = "macos"), matchingwith_autorelease_poolin the sibling module and leaving no target unresolved.revert_to_accessory_on_closedrops the parameter attribute for a singlelet _ = (app, win);in thenot(macos)block.inner_sizeis the client area, so the webview stays 1000x680 and the card still centres; only the outer window grows by the title-bar height. No shift; the old wording described one that can't happen.Now verified rather than asserted — step-level, not the job tick (job 88308625400):
check trayconclusion: success. The tray compiles on Windows.On dropping
continue-on-error: agreed in principle, and it's the only thing that stops the next round regressing silently the same way. Leaving it to you as a separate call since it changes what the gate blocks on, and the standing comment inci.ymlargues for non-blocking on the grounds that tray breakage may be latent and unrelated to Windows. Happy to do it here or in a follow-up - say which.Ticket changed by: Akarsh-Hegde