Skip to content
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

(serde issue) Compilation error: failed to resolve. Could not find `Formatter` in `export` #19698

Closed
paulrouget opened this issue Jan 5, 2018 · 11 comments

Comments

@paulrouget
Copy link
Contributor

@paulrouget paulrouget commented Jan 5, 2018

I'm having issue compiling Servo as a dependency (built with cargo build):

error[E0433]: failed to resolve. Could not find `Formatter` in `export`
  --> /Users/paul/.cargo/registry/src/github.com-1ecc6299db9ec823/unicode-bidi-0.3.3/src/level.rs:31:54
   |
31 | #[cfg_attr(feature = "with_serde", derive(Serialize, Deserialize))]
   |                                                      ^^^^^^^^^^^ Could not find `Formatter` in `export`

My Cargo.toml looks like this:

[package]
name = "servoshell"
version = "0.1.0"
authors = ["Paul Rouget <me@paulrouget.com>"]
description = "A basic servo-based browser"
build = "build.rs"

[dependencies]
open = "1.1.1"
log = "0.3"
libservo = { git = "https://github.com/servo/servo", rev = "9187c9a093" }
glutin = "0.9"
tinyfiledialogs = "3.0"
treediff = { version = "2.5.3", features = ["with-serde-json"] }
serde = "1.0"
serde_json = "1.0"
serde_derive = "1.0"

[target.'cfg(target_os = "macos")'.dependencies]
objc = "0.2"
core-foundation = "0.3"
core-graphics = "0.8"
cocoa = "^0.9.2"
cgl = "0.2"
libc = "0.2"

[target.'cfg(target_os = "windows")'.dependencies]
winapi = "0.2"
user32-sys = "0.2"
gdi32-sys = "0.2"

[features]
force-glutin = []

[patch.crates-io]
serde = { git = "https://github.com/gankro/serde", branch = "deserialize_from_enums3" }
serde_derive = { git = "https://github.com/gankro/serde", branch = "deserialize_from_enums3", feature="deserialize_from" }
@paulrouget
Copy link
Contributor Author

@paulrouget paulrouget commented Jan 5, 2018

I get this warning:

warning: unused manifest key: patch.crates-io.serde_derive.feature
@paulrouget paulrouget changed the title Compilation error: failed to resolve. Could not find `Formatter` in `export` (serde issue) Compilation error: failed to resolve. Could not find `Formatter` in `export` Jan 5, 2018
@SimonSapin
Copy link
Member

@SimonSapin SimonSapin commented Jan 5, 2018

What’s grep serde Cargo.lock?

@paulrouget
Copy link
Contributor Author

@paulrouget paulrouget commented Jan 5, 2018

 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "hyper_serde 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
 "hyper_serde 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde_derive 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
name = "hyper_serde"
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde_bytes 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
 "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde_derive 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "hyper_serde 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
 "hyper_serde 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde_derive 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "hyper_serde 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
 "hyper_serde 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
name = "serde"
name = "serde"
source = "git+https://github.com/gankro/serde?branch=deserialize_from_enums3#fc6117367ef974fb2d3b2017c21c375d34823415"
 "serde_derive 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
name = "serde_bytes"
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
name = "serde_derive"
source = "git+https://github.com/gankro/serde?branch=deserialize_from_enums3#fc6117367ef974fb2d3b2017c21c375d34823415"
 "serde_derive_internals 0.17.0 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
name = "serde_derive_internals"
source = "git+https://github.com/gankro/serde?branch=deserialize_from_enums3#fc6117367ef974fb2d3b2017c21c375d34823415"
name = "serde_json"
 "serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)",
name = "serde_json"
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde_derive 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde_json 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
 "serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)",
 "serde_derive 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
name = "url_serde"
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde_derive 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
 "serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)",
"checksum hyper_serde 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0997ad463f64ce6ba02cf5af320622bb9782e4f8355b650a2cc7ccca69a7cc2e"
"checksum serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)" = "34b623917345a631dc9608d5194cc206b3fe6c3554cd1c75b937e55e285254af"
"checksum serde 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)" = "<none>"
"checksum serde_bytes 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7a73f5ad9bb83e1e407254c7a355f4efdaffe3c1442fc0657ddb8b9b6b225655"
"checksum serde_derive 1.0.23 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)" = "<none>"
"checksum serde_derive_internals 0.17.0 (git+https://github.com/gankro/serde?branch=deserialize_from_enums3)" = "<none>"
"checksum serde_json 0.9.10 (registry+https://github.com/rust-lang/crates.io-index)" = "ad8bcf487be7d2e15d3d543f04312de991d631cfe1b43ea0ade69e6a8a5b16a1"
"checksum serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "48b04779552e92037212c3615370f6bd57a40ebba7f20e554ff9f55e41a69a7b"
"checksum url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "74e7d099f1ee52f823d4bdd60c93c3602043c728f5db3b97bdb548467f7bddea"
@SimonSapin
Copy link
Member

@SimonSapin SimonSapin commented Jan 5, 2018

name = "serde" appears twice. I think I hit the same in Servo… Try cargo update -p serde --precise 1.0.23?

@SimonSapin
Copy link
Member

@SimonSapin SimonSapin commented Jan 5, 2018

By the way this is another instance of #19588. Let’s keep this issue about finding a short-term work-around for your case.

@jdm
Copy link
Member

@jdm jdm commented Jan 5, 2018

This should be fixed by updating to master.

@jdm jdm closed this Jan 5, 2018
@dholbert
Copy link
Contributor

@dholbert dholbert commented Feb 14, 2018

@jdm:

This should be fixed by updating to master.

Was this just referring to the compilation error being fixed? Or also the warning that @paulrouget mentioned in the next comment:

warning: unused manifest key: patch.crates-io.serde_derive.feature

?

(I've been noticing that warning when building mozilla-central -- including on a trivial rebuild of an already-fully-compiled tree. And I'm wondering if that's tracked anywhere as a known issue & if there's anything easy we can do to fix it. Not sure if it's actually related to what was going on here, but I figured I'd start here since it was mentioned here...)

@dholbert
Copy link
Contributor

@dholbert dholbert commented Feb 14, 2018

Ah, partially answering my own question: looks like this warning was discussed in https://mozilla.logbot.info/servo/20180208 , and @staktrace had an idea about how to fix it. Did that end up spinning off to an issue/bug somewhere?

@SimonSapin
Copy link
Member

@SimonSapin SimonSapin commented Feb 15, 2018

Both are fixed in Servo because we stopped overriding serde with [patch.crates-io]. But it looks like Gecko still does, to apply an optimization made by @gankro that is not present upstream.

I believe Cargo will emit this warning even if it ends up deciding to rebuild nothing because everything is up to date. I don’t know if it indicates a real problem, though.

@staktrace
Copy link
Contributor

@staktrace staktrace commented Feb 15, 2018

@dholbert I haven't filed it yet but I can do that tomorrow. I have a tab open that reminds me every day but keep putting it off.

@dholbert
Copy link
Contributor

@dholbert dholbert commented Feb 15, 2018

Thanks!

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

Successfully merging a pull request may close this issue.

None yet
5 participants
You can’t perform that action at this time.