8000 fix: build, lint and test on Windows by ozkanerbatuhan · Pull Request #122 · avelino/mcp · GitHub
[go: up one dir, main page]

Skip to content

fix: build, lint and test on Windows - #122

Merged
avelino merged 1 commit into
avelino:mainfrom
ozkanerbatuhan:fix/windows-build
Nov 10, 2026
Merged

avelino merged 1 commit into
avelino:mainfrom
ozkanerbatuhan:fix/windows-build

Conversation

@ozkanerbatuhan
Copy link
Copy Markdown
Contributor

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: gate instances_dir/record_path with cfg(unix) (only the unix registry uses them) so clippy -D warnings passes.
  • Two tests that rely on the unix executable bit are 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

@avelino avelino left a comment
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Cargo.toml
# 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]
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

- 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).
@avelino avelino left a comment
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@avelino
avelino merged commit 867d298 into avelino:main Nov 10, 2026
3 checks passed
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.

2 participants

0