Skip to content

How to use with Servo? #101

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

Closed
RichardlL opened this issue Mar 8, 2016 · 6 comments
Closed

How to use with Servo? #101

RichardlL opened this issue Mar 8, 2016 · 6 comments

Comments

@RichardlL
Copy link

I'm probably doing something wrong, But I can't compile against servo.

I edited servo/components/style/Cargo.toml to

cssparser = {version = "0.5.3", features = ["heap_size", "serde-serialization"],git = "https://github.com/servo/rust-cssparser/"}

But when I try to compile I get

ipc-channel-3840821e54ea11a6/master/ipc.rs:153:26: 153:35 error: the trait `serde::ser::Serializer` is not implemented for the type `bincode::serde::writer::Serializer<'_, collections::vec::Vec<u8>>

and

error: the trait `serde::de::Deserializer` is not implemented for the type `bincode::serde::reader::Deserializer<'_, &[u8]>

Could anyone point me in the right direction?

@SimonSapin
Copy link
Member

Why this change? What are you trying to accomplish? Are you using ./mach build to compile?

Given that the error messages mention ipc-channel and bincode, I don’t know if it’s related to cssparser at all.

@RichardlL
Copy link
Author

I wanted to modify rust-cssparser to see if I could get better performance. So I wanted to point it towards my own github repo, I just used servo/rust-cssparser as an example, since the same thing happened with it.

I deleted */*/Cargo.toml and .cargo/, and reset the branch, and I was still getting the same error after re-editing Cargo.toml to use github (but not with the vanilla file).

I'm re-downloading the entire repo now.

I was using

./mach build -d

@SimonSapin
Copy link
Member

To do that you should use a "path override" rather than modify Cargo.toml files: http://doc.crates.io/guide.html#overriding-dependencies

@metajack
Copy link
Contributor

metajack commented Mar 8, 2016

You want to use cargo overrides for this. Checkout rust-cssparser in a sibling directory to Servo and then in servo/.cargo/config you'll want to put

paths = ["../rust-cssparser"]

and it will use your checkout.

@RichardlL
Copy link
Author

Thank you @SimonSapin @metajack!

Why does the other way not compile? Is it that something else depends on it also, and they have to match?

@SimonSapin
Copy link
Member

I’m not sure how exactly, but you likely ended up with two different versions of serde. So one copy of the Serializer was implemented where another copy was expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants