Skip to content

Commit

Permalink
Depend on cargo-readme as a library
Browse files Browse the repository at this point in the history
This commit changes the `cargo xtask readme` xtask and the
`humility-cmd-doc` build script to depend on `cargo-readme` as a library
crate and call into its `generate_readme` function, rather than using it
as an external binary that's invoked using `std::process::Command`. This
way, the `cargo-readme` binary no longer needs to be installed using
`cargo install` in order to build Humility instead, it's just a normal
Cargo package dependency.

In addition to making the first-time build experience a bit smoother by
reducing the number of external dependencies that need to be installed,
this also means our `cargo-readme` dependency is now a normal versioned
crate dependency. That ensures that everyone developing Humility gets
the `cargo-readme` version present in the lockfile, ensuring that
`cargo-readme` generates consistent output. Installing the binary using
`cargo-install` doesn't provide that guarantee, as it's not versioned,
so if upstream changed their output format, the generated docs might
change unnecessarily between different development systems with
different `cargo-readme` versions installed.
  • Loading branch information
hawkw committed Jan 31, 2024
1 parent 57d9b4d commit df67cb2
Show file tree
Hide file tree
Showing 7 changed files with 355 additions and 158 deletions.
Loading

0 comments on commit df67cb2

Please sign in to comment.