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

mdBook fails cargo install due to handlebars change #852

Closed
ehuss opened this issue Dec 14, 2018 · 1 comment
Closed

mdBook fails cargo install due to handlebars change #852

ehuss opened this issue Dec 14, 2018 · 1 comment

Comments

@ehuss
Copy link
Contributor

ehuss commented Dec 14, 2018

Because Cargo.lock is not published by default, running cargo install mdbook is now failing because it is picking up a new version of handlebars which is incompatible. See sunng87/handlebars-rust#249. I am getting these errors:

error[E0061]: this function takes 2 parameters but 3 parameters were supplied
  --> src/renderer/html_handlebars/helpers/navigation.rs:55:23
   |
55 |     let chapters = rc.evaluate_absolute(ctx, "chapters", true).and_then(|c| {
   |                       ^^^^^^^^^^^^^^^^^ expected 2 parameters

error[E0308]: mismatched types
  --> src/renderer/html_handlebars/helpers/navigation.rs:56:57
   |
56 |         serde_json::value::from_value::<Vec<StringMap>>(c.clone())
   |                                                         ^^^^^^^^^ expected enum `handlebars::Value`, found enum `std::option::Option`
   |
   = note: expected type `handlebars::Value`
              found type `std::option::Option<&handlebars::Value>`

error[E0061]: this function takes 2 parameters but 3 parameters were supplied
  --> src/renderer/html_handlebars/helpers/navigation.rs:61:10
   |
61 |         .evaluate_absolute(ctx, "path", true)?
   |          ^^^^^^^^^^^^^^^^^ expected 2 parameters

error[E0599]: no method named `as_str` found for type `std::option::Option<&handlebars::Value>` in the current scope
  --> src/renderer/html_handlebars/helpers/navigation.rs:62:10
   |
62 |         .as_str()
   |          ^^^^^^

error[E0277]: the size for values of type `str` cannot be known at compilation time
  --> src/renderer/html_handlebars/helpers/navigation.rs:60:9
   |
60 |     let base_path = rc
   |         ^^^^^^^^^ doesn't have a size known at compile-time
   |
   = help: the trait `std::marker::Sized` is not implemented for `str`
   = note: to learn more, visit <https://doc.rust-lang.org/book/second-edition/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
   = note: all local variables must have a statically known size
   = help: unsized locals are gated as an unstable feature

error[E0061]: this function takes 2 parameters but 3 parameters were supplied
   --> src/renderer/html_handlebars/helpers/navigation.rs:100:10
    |
100 |         .evaluate_absolute(ctx, "path", false)?
    |          ^^^^^^^^^^^^^^^^^ expected 2 parameters

error[E0599]: no method named `as_str` found for type `std::option::Option<&handlebars::Value>` in the current scope
   --> src/renderer/html_handlebars/helpers/navigation.rs:101:10
    |
101 |         .as_str()
    |          ^^^^^^

error[E0061]: this function takes 2 parameters but 3 parameters were supplied
  --> src/renderer/html_handlebars/helpers/theme.rs:20:10
   |
20 |         .evaluate_absolute(ctx, "default_theme", true)?
   |          ^^^^^^^^^^^^^^^^^ expected 2 parameters

error[E0599]: no method named `as_str` found for type `std::option::Option<&handlebars::Value>` in the current scope
  --> src/renderer/html_handlebars/helpers/theme.rs:21:10
   |
21 |         .as_str()
   |          ^^^^^^

error[E0061]: this function takes 2 parameters but 3 parameters were supplied
  --> src/renderer/html_handlebars/helpers/toc.rs:28:27
   |
28 |         let chapters = rc.evaluate_absolute(ctx, "chapters", true).and_then(|c| {
   |                           ^^^^^^^^^^^^^^^^^ expected 2 parameters

error[E0308]: mismatched types
  --> src/renderer/html_handlebars/helpers/toc.rs:29:76
   |
29 |             serde_json::value::from_value::<Vec<BTreeMap<String, String>>>(c.clone())
   |                                                                            ^^^^^^^^^ expected enum `handlebars::Value`, found enum `std::option::Option`
   |
   = note: expected type `handlebars::Value`
              found type `std::option::Option<&handlebars::Value>`

error[E0061]: this function takes 2 parameters but 3 parameters were supplied
  --> src/renderer/html_handlebars/helpers/toc.rs:33:14
   |
33 |             .evaluate_absolute(ctx, "path", true)?
   |              ^^^^^^^^^^^^^^^^^ expected 2 parameters

error[E0599]: no method named `as_str` found for type `std::option::Option<&handlebars::Value>` in the current scope
  --> src/renderer/html_handlebars/helpers/toc.rs:34:14
   |
34 |             .as_str()
   |              ^^^^^^

error: aborting due to 13 previous errors
bors added a commit to rust-lang/cargo that referenced this issue Dec 14, 2018
Travis: only use mdbook 0.1.7.

The latest mdbook does not build (rust-lang/mdBook#852). Cargo uses 0.1.7, so force install only that version.
@ehuss
Copy link
Contributor Author

ehuss commented Dec 16, 2018

Handlebars 1.2 has been yanked.

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

1 participant