matklad / cargo-xtask

868 stars 23 forks source link

cargo-xtask vs cargo-make #23

Closed JohnScience closed 1 year ago

JohnScience commented 1 year ago

Hi, is there any reason to choose cargo-xtask instead of cargo-make?

matklad commented 1 year ago

Yes, the following bit separate the two:

It doesn't require any other binaries besides cargo and rustc, it fully bootstraps from them

To use cargo-make, you need to install cargo-make binary first, and that would be a part of global ambient environment, not locked by Cargo.lock.

In the opposite direction, cargo-make provides a lot of features, while xtask doesn’t have any features at all, by virtue of being a pattern, rather than a library.

I think the deeper difference between the two projects is in values:

If you care about both, there should be a way of using either cargo-make or just via xtask pattern, much the same way this sqlx example (https://github.com/matklad/cargo-xtask-sqlx-example) works, but I haven’t see that implemented anywhere personally.