You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
refactor: move test fixtures out of the plugin's build.rs; format generated code #22
Part of #2. Follow-up from the reviews of #18 and #21.
Why
protoc-gen-rust-mcp/build.rs now always:
compiles the test-only fixtures (tests/testdata/schemapb, tests/testdata/mcpgen) with protox, pbjson-build and tonic-prost-build
runs the generator on them through #[path] includes, because a build script can't depend on the crate it's building
So every cargo build/cargo install of the plugin pulls in those build-dependencies and does fixture work. On a clean release build that took build time from about 3s to about 8s, before the tonic fixtures were added. Separately, the generated *.mcp.rs isn't formatted: there are 300-character lines, while tonic's output is run through prettyplease.
Do
Move the fixtures and their build script into a non-published, dev-only workspace crate, e.g. test-fixtures/, with publish = false, that depends on the plugin crate as a normal library dependency. The plugin's own tests use it as a dev-dependency. The plugin crate should end up with no build.rs, or a trivial one.
Summary: moved tests/testdata/{schemapb,mcpgen} and their proto-compiling build.rs into a new non-published test-fixtures/ workspace crate (which depends on protoc-gen-rust-mcp as a normal dependency); protoc-gen-rust-mcp now has no build.rs and no longer pulls in protox/prost-build/pbjson-build/tonic-prost-build on a plain build. Generated code now goes through prettyplease (like prost-build/tonic-build) plus a final rustfmt pass in make generate, so the committed *.mcp.rs is rustfmt-clean. All existing tests pass unchanged; see the PR for full details and check output.
Activity
erikist commentedon Oct 10, 2026
🤖 Factory: picked up by dispatcher; working on branch factory/22-refactor-move-test-fixtures-out-of.
chore: drop dead tonic-prost/futures dev-deps from protoc-gen-rust-mcp (
erikist commentedon Oct 10, 2026
🤖 Factory: opened PR #28 implementing this issue.
Summary: moved
tests/testdata/{schemapb,mcpgen}and their proto-compilingbuild.rsinto a new non-publishedtest-fixtures/workspace crate (which depends onprotoc-gen-rust-mcpas a normal dependency);protoc-gen-rust-mcpnow has nobuild.rsand no longer pulls inprotox/prost-build/pbjson-build/tonic-prost-buildon a plain build. Generated code now goes throughprettyplease(like prost-build/tonic-build) plus a finalrustfmtpass inmake generate, so the committed*.mcp.rsis rustfmt-clean. All existing tests pass unchanged; see the PR for full details and check output.refactor: move test fixtures out of plugin's build.rs; format generat…