Repository navigation
fix: build, lint and test on Windows - #122
Conversation
There was a problem hiding this comment.
Thanks for picking up the Windows build, @ozkanerbatuhan, and sorry this sat for three weeks.
You found the right bug in Cargo.toml: the unix-only table was swallowing the OpenTelemetry crates. Main got the same fix in c316e33 ("restore opentelemetry on non-unix targets") after you opened this, so the branch now conflicts there. The cfg(unix) gates on instances_dir / record_path and on the two exec-bit tests are still missing on main, so that part is still worth landing.
Could you rebase on main, drop the Cargo.toml hunk (keep main's version) and keep the rest? The advisories failure is old and comes from our side, a rebase gives it a fresh run. I'll merge as soon as it's green.
| # Unix-only: flock(2) for the instance registry's liveness proof and kill(2) | ||
| # for the SIGHUP that `mcp reload` sends. Both are gated behind cfg(unix). | ||
| # Kept after every shared dependency: anything below this header is unix-only. | ||
| [target.'cfg(unix)'.dependencies] |
There was a problem hiding this comment.
Main already moved this table to the end in c316e33, with a comment explaining why, so this hunk conflicts now. Just take main's Cargo.toml when you rebase, nothing else needed here.
8f54929 to
225afa1
Compare
- Cargo.toml: the OpenTelemetry dependencies sat below the `[target.'cfg(unix)'.dependencies]` header, so on Windows they were never compiled and the crate failed with 33 "cannot find crate" errors. Move the unix-only table to the end of the dependency list. - instances.rs: `instances_dir`/`record_path` are only used by the unix registry; gate them so `clippy -D warnings` passes on Windows. - Two tests rely on the unix executable bit (`PermissionsExt`, "exists but not executable"); gate them with `cfg(unix)`. Verified on Windows 11: cargo fmt --check, cargo clippy --all-targets -D warnings, cargo test (966 passed).
225afa1 to
0e1b23a
Compare
There was a problem hiding this comment.
Thanks for the quick turnaround, @ozkanerbatuhan. Taking main's Cargo.toml and keeping only the cfg(unix) gates is exactly what I wanted, and the comment on instances_dir explains why the gate is there, which saves the next person a trip through git blame. CI is green on all three jobs and I ran the full suite locally with this and #124 on top of main: 1139 passed. Merging.
Part of #121 (item 1).
Cargo.toml: OpenTelemetry deps were under[target.'cfg(unix)'.dependencies], so they never compiled on Windows. Moved the unix-only table to the end of the dependency list.instances.rs: gateinstances_dir/record_pathwithcfg(unix)(only the unix registry uses them) soclippy -D warningspasses.cfg(unix).Verified on Windows 11:
cargo fmt --check,cargo clippy --all-targets -- -D warnings,cargo test(966 passed). No behavior change on unix.🤖 Generated with Claude Code