Skip to content
This repository has been archived by the owner on Oct 18, 2021. It is now read-only.

Issues between serde and mongo #152

Closed
dariusc93 opened this issue Jul 21, 2016 · 9 comments
Closed

Issues between serde and mongo #152

dariusc93 opened this issue Jul 21, 2016 · 9 comments

Comments

@dariusc93
Copy link

Have anyone had issues between serde and mongo? Since recently I ran a cargo update there had been an issue where is serde, serde_json, and serde_macro exist along side mongo-rust-driver-prototype would give an error related to quasi but with it commented out in Cargo.toml it does not error out at all. I cannot pinpoint the issue but it seems to be related to serde-deprecated/quasi#54 .

Example of Cargo.toml (replace the section for mongodb with either from crates or use git}

[package]
name = "test-serde"
version = "0.1.0"
authors = ["test"]

[dependencies]
serde = "0.7"
serde_json = "0.7"
serde_macros = "0.7"

mongodb = {path = "../mongo-rust-driver-prototype"}

I do not know what the reason on why it happens when using mongodb (even tried it with bson-rs and it doesnt error out). At this point i might have to switch back to rustc_serialize :/ .

@saghm
Copy link
Contributor

saghm commented Jul 22, 2016

From trying it out, it seems that updating serde and serde_macros to the latest version (0.8.0-rc2) seems to fix the compilation errors I got. I'm not sure if using a release candidate is an option for your situtation, but either way, the final 0.8.0 release will probably be available shortly.

@dariusc93
Copy link
Author

I do not know if its fixed now but I did switch back to rustc_serialize. It was an annoying move though but hopefully serde will become more stable.

@saghm
Copy link
Contributor

saghm commented Aug 3, 2016

I just tried it out again now that serde 0.8.0 has been released, and after running cargo update, I'm now getting an issue with bson still using serde 0.7. I looked into seeing what it would take to upgrade the dependency, but unfortunately it seems decently involved due to the API changes made in the new version. I'm not familiar with the serde code in bson, but I'll open up an issue there.

@kyeah, I don't suppose you'd have a chance to take a look at updating bson to use serde 0.8? I'm not as familiar with that code as you are, although I can take a stab at doing the update myself if you're busy with other things.

@dtolnay
Copy link

dtolnay commented Aug 3, 2016

I can take care of bson today.

@saghm
Copy link
Contributor

saghm commented Aug 3, 2016

Awesome! Thanks a bunch

@dtolnay
Copy link

dtolnay commented Aug 3, 2016

PR mongodb/bson-rust#39

@kyeah
Copy link
Contributor

kyeah commented Aug 31, 2016

bson v0.3 is out with the fix, should be able to update. sorry for the wait, y'all!

@saghm
Copy link
Contributor

saghm commented Aug 31, 2016

Assuming the Travis build passes, I'll merge #160 and push out a new version to crates.io

@saghm
Copy link
Contributor

saghm commented Aug 31, 2016

Just pushed 0.1.6. @dariusc93, if you use the latest version along with bson 0.3, and serde 0.8, it should work fine now.

@saghm saghm closed this as completed Aug 31, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants