Gate optional dependencies behind feature flags#672
Open
DaleSeo wants to merge 1 commit intomodelcontextprotocol:mainfrom
Open
Gate optional dependencies behind feature flags#672DaleSeo wants to merge 1 commit intomodelcontextprotocol:mainfrom
DaleSeo wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
a8d0a9f to
a651890
Compare
a651890 to
54320d8
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #625
Motivation and Context
The crate failed to compile when built without default features because code in the
model,task_manager, andtransportmodules used optional dependencies (pastey,schemars) and server-only types unconditionally. This adds the missing#[cfg]gates so every valid feature combination compiles.How Has This Been Tested?
Before:
After:
Also verified that all other feature combinations compile.
Breaking Changes
None for the common case (default features). Users who were relying on
ServerCapabilitiesBuilderorClientCapabilitiesBuilderwithout enablingserverormacroswould not have been able to compile before this change either, so the newcfggates only formalize what was already required.Types of changes
Checklist
Additional context
The three files changed:
crates/rmcp/src/lib.rs— Gatetask_managerbehindserver,transportbehindclient | server, fixschemarsre-export toany(server, schemars).crates/rmcp/src/model/capabilities.rs— Gatepasteyimport,builder!macro, builder invocations, all builderimplblocks, and tests behindany(server, macros).crates/rmcp/src/model/tool.rs— Gateschemars::JsonSchemaimport,with_output_schema, andwith_input_schemabehindserver.