rust-sdk/Cargo.toml
Tanish Desai 1d38d68709
fix: exclude WASI example from workspace to avoid linker errors (#541)
* fix: exclude WASI example from workspace to avoid linker errors on Mac/arm64

Cargo uses the macOS host linker for workspace builds,
but that linker cannot resolve WASI WebAssembly imports
(such as _wasi:cli/run@0.2.x). As a result, including a WASI
crate in the workspace causes builds to fail on macOS systems using arm64.

Solution: Mark the WASI example as non-default by excluding it from the
workspace members. This makes the WASI package optional, so `cargo build`
won't touch it, and it can be built explicitly when needed with:
  cargo build -p wasi-mcp-example --target wasm32-wasip2

Signed-off-by: tanish111 <tanishdesai37@gmail.com>

* fix: make WASI example standalone for CI compatibility

Replace workspace inheritance with explicit values in examples/wasi/Cargo.toml
since excluded packages cannot inherit from workspace. This fixes CI manifest
parsing errors when building WASI example explicitly.

Signed-off-by: tanish111 <tanishdesai37@gmail.com>

* fix: exclude examples from default builds using default-members

Only core crates are built by default, preventing WASI linker errors
on macOS while keeping it in workspace for property inheritance.

Signed-off-by: tanish111 <tanishdesai37@gmail.com>

---------

Signed-off-by: tanish111 <tanishdesai37@gmail.com>
2025-11-18 09:28:41 +08:00

23 lines
723 B
TOML

[workspace]
members = ["crates/rmcp", "crates/rmcp-macros", "examples/*"]
default-members = ["crates/rmcp", "crates/rmcp-macros"]
resolver = "2"
[workspace.dependencies]
rmcp = { version = "0.9.0", path = "./crates/rmcp" }
rmcp-macros = { version = "0.9.0", path = "./crates/rmcp-macros" }
[workspace.package]
edition = "2024"
version = "0.9.0"
authors = ["4t145 <u4t145@163.com>"]
license = "MIT"
repository = "https://github.com/modelcontextprotocol/rust-sdk/"
description = "Rust SDK for Model Context Protocol"
keywords = ["mcp", "sdk", "tokio", "modelcontextprotocol"]
homepage = "https://github.com/modelcontextprotocol/rust-sdk"
categories = [
"network-programming",
"asynchronous",
]
readme = "README.md"