Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

The rmcp lib test target does not build without the macros feature

Chiusa
#1,317 1 commento 1 reazione 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

@DaleSeo ci sta già lavorando.

Dal 4/10/2026.

  • #1 di @itsmunzir — chiusa senza merge
  • #1318 di @DaleSeo — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug P2 ready for work T-model T-test

object! is #[macro_export]ed and documented from model.rs:42, but model.rs:60 puts it behind the macros feature, so it is unreachable in a --no-default-features build. The lib test target is where that shows on 8f9a28e: four unit tests call the macro.

$ cd /tmp/rmcp-main && cargo check -p rmcp --lib --no-default-features --profile test
# rustc 1.96.1 (31fca3adb 2026-06-26), the pinned rust-toolchain.toml, on 8f9a28e
error: cannot find macro `object` in this scope
    --> crates/rmcp/src/model.rs:5529:17
note: `object` is imported here, but it is a function, not a macro
    --> crates/rmcp/src/model.rs:4837:9
error: could not compile `rmcp` (lib test) due to 4 previous errors   # :5459 :5488 :5503 :5529

$ cargo check -p rmcp --lib --no-default-features --features macros --profile test
    Finished `test` profile [unoptimized + debuginfo] target(s) in 7.63s

# same export, `#[cfg(feature = "macros")]` deleted from model.rs:60, nothing else touched
$ cargo test -p rmcp --lib --no-default-features
    test result: ok. 139 passed; 0 failed; 0 ignored
# not run: the integration targets under crates/rmcp/tests, and any host other than Linux

The expansion is serde_json::json! around the ungated model::object function, serde_json is a plain dependency, and macros is dep:rmcp-macros + dep:pastey. Deleting the gate is the one-line option. Keeping it means object(json!({ ... })) at the four call sites, or a #[cfg(feature = "macros")] on the four #[test] functions.

Dropping --lib fails too, in 13 integration targets, on missing server/client items. Different cause, and none of the above fixes it.

@DaleSeo, the feature-matrix job on feat/rationalize-feature-flags (#1067) runs cargo check, which never builds a test target, and ci.yml:268 and :302 both enable macros. Would --profile test on that job, or a cargo test -p rmcp --lib --no-default-features line beside it, be the right home for this?

Lingua principale
Rust
Stelle
4k
Fork
654
Merge medio
4g 2h
PR unite (30g)
40

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di modelcontextprotocol/rust-sdk

Tutte le issue di modelcontextprotocol/rust-sdk

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.