-
Notifications
You must be signed in to change notification settings - Fork 222
support stable #269
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
support stable #269
Conversation
No, current sdk requires 1.85, which is stable since early 2025. Check this: https://forge.rust-lang.org/ |
I hope it can run on the Win7 operating system, but the Rust support version for Win7 is 1.77.2, so I hope it can be backward compatible to the 2021 editing version, just modify the edition to 2021 |
@cn-kali-team Have you tried these toolchains? https://doc.rust-lang.org/rustc/platform-support/win7-windows-msvc.html After all, Win7 has been discontinued for a long time. |
When using x86_64-win7-windows-msvc, it's necessary to switch to the nightly Rust version. Additionally, the edition setting has a propagation effect - if upstream uses edition="2024", downstream must also use edition="2024". Otherwise, when using older Rust versions, the rmcp package cannot be found.
[package]
name = "app"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rmcp = { git = "https://github.com/modelcontextprotocol/rust-sdk", branch = "main", features = ["server", "transport-io"] } -This results in:
[package]
name = "app"
version = "0.1.0"
edition = "2024"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rmcp = { git = "https://github.com/modelcontextprotocol/rust-sdk", branch = "main", features = ["server", "transport-io"] } You get:
Finally, you can refer to reqwest's approach which works on older stable versions: 使用x86_64-win7-windows-msvc需要切换到nightly版本,而且edition具有传染性,上游使用了edition="2024",下游也必须使用edition="2024",不然在使用第版本的rust会出现找不到rmcp包
[package]
name = "app"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rmcp = { git = "https://github.com/modelcontextprotocol/rust-sdk", branch = "main", features = ["server", "transport-io"] }
[package]
name = "app"
version = "0.1.0"
edition = "2024"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
rmcp = { git = "https://github.com/modelcontextprotocol/rust-sdk", branch = "main", features = ["server", "transport-io"] }
|
I know this is feasible, but I hope to use the stable version to build the window7 program. Changing the edition to 2021 will not affect your use of Rust's new features because the stable version is backward compatible. What I mean is that you can relax the Rust version to allow more people to use it 我知道这样可行,但是我希望使用stable版本构建window7程序,将edition修改为2021并不会影响你使用rust的新功能,因为stable版本是向后兼容的,我的意思是你可以把rust版本放宽点可以让更多的人使用 |
But in this crate, we cannot use the lastest features. 🥲🥲🥲 @jokemanfire what's your opinion on this? |
Although this makes sense, from the perspective of maintainers, I still hope to limit higher versions of the Rust toolchain, especially for some third-party libraries that will elevate higher toolchain versions in subsequent updates. If users encounter problems using lower version toolchains, it will undoubtedly increase our workload. |
Added support for Rust stable toolchain
添加了对Rust stable版本的支持,使SDK能在stable工具链上编译运行
Motivation and Context
Current SDK requires nightly Rust which limits usage scenarios. Many production environments prefer stable versions.
当前SDK需要nightly Rust才能使用,这限制了用户的使用场景。许多生产环境更倾向于使用stable版本。
How Has This Been Tested?
在stable工具链(1.82.0)下运行所有测试用例
在nightly工具链下验证原有功能不受影响
测试了基础功能如模型加载、推理等核心场景
Breaking Changes
No breaking changes, fully backward compatible
无破坏性变更,此修改完全向后兼容
Types of changes
Checklist | 检查清单
Additional context
Main changes:
主要修改点:
替换了需要nightly特性的代码
更新了构建配置
确保所有特性在stable下可用
Prerequisite | 前置条件
Requires merging: 4t145/sse-stream#2
需要先合并: 4t145/sse-stream#2