rust-lang / mdBook

Create book from markdown files. Like Gitbook but implemented in Rust
https://rust-lang.github.io/mdBook/
Mozilla Public License 2.0
17.3k stars 1.59k forks source link

mdbook with plugins in CI #2026

Open mimoo opened 1 year ago

mimoo commented 1 year ago

Question

I'm trying to run mdbook in CI to build our repo's book. The problem is that I often run into issues due to the version of mdbook used, or version of a plugin used. So I created a Makefile that checks versions here: https://github.com/o1-labs/proof-systems/blob/master/book/Makefile

But now I'm getting another error in CI: https://github.com/o1-labs/proof-systems/actions/runs/4176356656/jobs/7232533118

My question is, more generally, how to deal with these issues when using cargo tools? Since there's no Cargo.lock file, it's too easy to have a mismatch between local and remote versions

Version

No response

ehuss commented 1 year ago

I recommend adding --locked to your cargo install commands to use the set of dependencies used when the plugin was published.

mimoo commented 1 year ago

we introduced a Cargo.toml here to fix the issue: https://github.com/o1-labs/proof-systems/pull/1006/files

but I have a feeling this won't work as intuitively, I think mdbook tries to find the plugin binaries in the PATH, whereas we are only importing the libraries (not the binaries) of the plugins with the Cargo.toml

(cc @querolita on the --locked trick)