badboy / mdbook-mermaid

A preprocessor for mdbook to add mermaid support
Mozilla Public License 2.0
306 stars 32 forks source link

Bump mdbook dependency to latest v0.4.9 #11

Closed eminence closed 3 years ago

eminence commented 3 years ago

I think this upgrade is needed to fix a compatibility problem noticed in https://github.com/rust-lang/wg-async-foundations/issues/218 which is using the latest mdbook and mdbook-mermaid in CI (v0.4.9 and v0.8.1 respectively, at the time of this writing)

The error seen is:

Unable to parse the input
Error: -04 09:00:12 [ERROR] (mdbook::utils): Error: The "mermaid" preprocessor exited unsuccessfully with exit code: 1 status

This error is strangely not reproducible on some machines, but if I add a bit of debugging, I can get this error from mdbook-mermaid:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("missing field `__non_exhaustive`", line: 1, column: 760)', /devel/mdbook/src/preprocess/cmd.rs:49:42

What I think is happening is that mdbook recently removed a private __non_exhaustive field, but one that wasn't set to #[serde(skip)]. This was done in https://github.com/rust-lang/mdBook/pull/1557 which was part of the most recent mdbook v0.4.9 release.

Yet the latest mdbook-mermaid is using mdbook v0.4.6 as a dependency, which expects to deserialize a __non_exhausive field. Hence the above deserializtion error.

badboy commented 3 years ago

(clippy nit unrelated)