Skip to content

Build failed with default-features = false #1064

Closed
@50U10FCA7

Description

@50U10FCA7

Describe the bug
Juniper failed to build if specified as dependency with default-features = false

Build result:

error[E0433]: failed to resolve: could not find `ContentRefDeserializer` in `de`
   --> ~/juniper/juniper/src/http/mod.rs:232:17
    |
232 | #[derive(Debug, Deserialize, PartialEq)]
    |                 ^^^^^^^^^^^ could not find `ContentRefDeserializer` in `de`
    |
    = note: this error originates in the derive macro `Deserialize` (in Nightly builds, run with -Z macro-backtrace for more info)

To Reproduce
Steps to reproduce the behavior:

  • create a new (empty) rust project
  • set juniper as dependency with default-features = false
  • execute cargo run in project directory

Expected behavior
Build successful.

Additional context
The cause of the problem is that juniper specifies serde as dependency with no std feature enabled. The serde/std feature implements serialize/deserialize for std's structs like Vec, HashMap, etc... But juniper uses Serialize on a struct which field is a Vec.

At now, juniper can build with default-features = true only because bson dependency uses serde/std feature.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions