-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Xtask #2688
base: main
Are you sure you want to change the base?
Xtask #2688
Conversation
This follows the approach in https://github.com/matklad/cargo-xtask and allow us to run `cargo xtask install-tools` from the project root to install the tools that comprehensive rust depends on, rather than using a bash script which is not truly cross platform.
Hi @egithinji. Thank you very much for drafting this pull request! I really like the idea of having this cross platform task execution tool! |
Thanks @michael-kerscher for reviewing! Yes that sounds like a good candidate for an additional task. Happy to collaborate on this further. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good to me now
Background
Comprehensive Rust requires a number of tools to be installed (e.g. mdbook and mdbook-course). As mentioned in #2509 (and discussed in #2469) it would be nice to have a cross platform command for installing these dependencies. Currently these are installed using a shell script (
install-mdbook.sh
) but this isn't truly cross platform e.g. for Windows users.Xtask
xtask outlines an approach for automating tasks in a Rust project. It involves using cargo's aliasing feature to allow us to run commands like
cargo xtask <some task>
to perform adhoc tasks via a Rust binary that we might otherwise need a shell script for.In this PR we add support for a
cargo xtask install-tools
command that will replace theinstall-mdbook.sh
script and install the dependent tools. We can potentially extend it to support for other tasks e.g.cargo xtask fmt
.