Skip to content

Instantly share code, notes, and snippets.

@carols10cents
Last active December 19, 2018 12:59
Show Gist options
  • Save carols10cents/b5fc3702a23a0c5d48e7643218e6ff7d to your computer and use it in GitHub Desktop.
Save carols10cents/b5fc3702a23a0c5d48e7643218e6ff7d to your computer and use it in GitHub Desktop.
Descriptions of the breakages I'm experiencing today
  • I'm using rustc 1.9.0-dev (28c9fdafc 2016-04-11), cargo 0.10.0. Yes, I run nightly but don't update it every night. dealwithit.gif

  • I wanted to get back to working on eeyore. Master compiles fine.

  • I want to use this branch of hubcaps I've been working on, and that I rebased on hubcaps master today.

  • I changed eeyore's Cargo.toml to use my collabs branch of hubcaps (hubcaps = { git = "https://github.com/carols10cents/hubcaps", branch = "collabs" }) and ran cargo update. Perhaps I should have run cargo update -p hubcaps here...

  • Now compiling eeyore, I get:

/Users/carolnichols/.cargo/registry/src/github.com-88ac128001ac3a9a/bodyparser-0.1.0/src/lib.rs:78:18: 78:21 error: the trait bound `persistent::Read<MaxBodyLength>: plugin::Plugin<iron::Request<'_, '_>>` is not satisfied [E0277]
/Users/carolnichols/.cargo/registry/src/github.com-88ac128001ac3a9a/bodyparser-0.1.0/src/lib.rs:78                 .get::<persistent::Read<MaxBodyLength>>()
                                                                                                                    ^~~
/Users/carolnichols/.cargo/registry/src/github.com-88ac128001ac3a9a/bodyparser-0.1.0/src/lib.rs:78:18: 78:21 help: run `rustc --explain E0277` to see a detailed explanation
/Users/carolnichols/.cargo/registry/src/github.com-88ac128001ac3a9a/bodyparser-0.1.0/src/lib.rs:78:18: 78:21 help: the following implementations were found:
/Users/carolnichols/.cargo/registry/src/github.com-88ac128001ac3a9a/bodyparser-0.1.0/src/lib.rs:78:18: 78:21 help:   <persistent::Read<P> as plugin::Plugin<iron::request::Request<'a, 'b>>>
error: aborting due to previous error
  • Now because it's been a while, and I was feeling reckless, and eeyore is a binary not a library, I changed all of eeyore's dependencies except for hubcaps to be "*" and ran cargo update. This may have been my next mistake. But shouldn't everything run on everything's latest?
  • Previous error is gone, now I get:
/Users/carolnichols/.cargo/registry/src/github.com-88ac128001ac3a9a/formdata-0.7.10/build.rs:15:33: 15:46 error: mismatched types:
 expected `&mut syntex::Registry`,
    found `&mut inner::syntex::Registry`
(expected struct `syntex::Registry`,
    found struct `inner::syntex::Registry`) [E0308]
/Users/carolnichols/.cargo/registry/src/github.com-88ac128001ac3a9a/formdata-0.7.10/build.rs:15         serde_codegen::register(&mut registry);
                                                                                                                                ^~~~~~~~~~~~~
/Users/carolnichols/.cargo/registry/src/github.com-88ac128001ac3a9a/formdata-0.7.10/build.rs:15:33: 15:46 help: run `rustc --explain E0308` to see a detailed explanation
/Users/carolnichols/.cargo/registry/src/github.com-88ac128001ac3a9a/textnonce-0.2.6/build.rs:17:33: 17:46 error: mismatched types:
 expected `&mut syntex::Registry`,
    found `&mut inner::syntex::Registry`
(expected struct `syntex::Registry`,
    found struct `inner::syntex::Registry`) [E0308]
/Users/carolnichols/.cargo/registry/src/github.com-88ac128001ac3a9a/textnonce-0.2.6/build.rs:17         serde_codegen::register(&mut registry);
                                                                                                                                ^~~~~~~~~~~~~
/Users/carolnichols/.cargo/registry/src/github.com-88ac128001ac3a9a/textnonce-0.2.6/build.rs:17:33: 17:46 help: run `rustc --explain E0308` to see a detailed explanation
  • This looks to be because some of the crates I'm depending on depend on syntex 0.31.0 and formdata and textnonce still use syntex 0.30.1 and are conflicting. Ok, let's try to fix this.
  • formdata master won't cargo test for me; I get basically the same error:
build.rs:15:33: 15:46 error: mismatched types:
 expected `&mut syntex::Registry`,
    found `&mut inner::syntex::Registry`
(expected struct `syntex::Registry`,
    found struct `inner::syntex::Registry`) [E0308]
build.rs:15         serde_codegen::register(&mut registry);
                                            ^~~~~~~~~~~~~
build.rs:15:33: 15:46 help: run `rustc --explain E0308` to see a detailed explanation
  • Ok, so let's update syntex. That seemed to work (sent pull request)
  • Ok, so now let's go back to eeyore and specify a .cargo/config that has path = ["my-local-path-to-my-updated-formdata"].
  • Now I get an error with handlebars because their api changed, cool, easily fixed. An error with hubcaps's api, cool, easily fixed. And then there's:
src/main.rs:113:9: 113:21 error: mismatched types:
 expected `&hyper::client::Client`,
    found `&hyper::Client`
(expected struct `hyper::client::Client`,
    found struct `hyper::Client`) [E0308]
src/main.rs:113         &user_client,
                        ^~~~~~~~~~~~
src/main.rs:113:9: 113:21 help: run `rustc --explain E0308` to see a detailed explanation
  • I looked at eeyore's Cargo.lock at this point and eeyore is depending on hyper 0.9.1 and everything else is depending on 0.8.1. Perhaps at this point I could have backed my hyper dependency back to 0.8.1, but alas, I did not. Possible mistake #3.
  • Instead, I decide everything ELSE needs to be updated to use hyper 0.9.1, starting with formdata. That seems to go ok.
  • But when I try to use formdata with that update in eeyore, now I get:
/Users/carolnichols/.cargo/registry/src/github.com-88ac128001ac3a9a/params-0.1.0/src/lib.rs:514:59: 514:71 error: mismatched types:
 expected `&hyper::header::Headers`,
    found `&iron::Headers`
(expected struct `hyper::header::Headers`,
    found struct `iron::Headers`) [E0308]
/Users/carolnichols/.cargo/registry/src/github.com-88ac128001ac3a9a/params-0.1.0/src/lib.rs:514     let boundary = match formdata::get_multipart_boundary(&req.headers) {
                                                                                                                                                          ^~~~~~~~~~~~
/Users/carolnichols/.cargo/registry/src/github.com-88ac128001ac3a9a/params-0.1.0/src/lib.rs:514:59: 514:71 help: run `rustc --explain E0308` to see a detailed explanation
  • Ok, so now I check out params. Params uses formdata, which means it has the same syntex problem, but I fixed that! so I tell params to use my local updated formdata too. And now I reproduce the eerror[sic] I was seeing in eeyore:
src/lib.rs:514:59: 514:71 error: mismatched types:
 expected `&hyper::header::Headers`,
    found `&iron::Headers`
(expected struct `hyper::header::Headers`,
    found struct `iron::Headers`) [E0308]
src/lib.rs:514     let boundary = match formdata::get_multipart_boundary(&req.headers) {
  • Ok, so this looks like because params also gets hyper through iron. So the problem must really be with iron + formdata, not params + formata. So check out iron.
  • Iron master passes cargo test fine.
  • Try updating iron to depend on hyper 0.9.
  • Now I get:
src/request/mod.rs:75:45: 75:56 error: mismatched types:
 expected `url::Url`,
    found `hyper::Url`
(expected struct `url::Url`,
    found struct `hyper::Url`) [E0308]
src/request/mod.rs:75                 match Url::from_generic_url(url.clone()) {
                                                                  ^~~~~~~~~~~
src/request/mod.rs:75:45: 75:56 help: run `rustc --explain E0308` to see a detailed explanation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment