Cargo's next few years

I don’t think the proposal contains any provision for how to execute the actual command. I.e. it’s only about versioning/installing commands, not actually running them. Note, running them is orthogonal, just like writing them is.

1 Like

The minimal proposal is just “if user types ‘cargo task foo’, cargo will find the foo binary among task dependencies and run it”. There’s zero dependency tracking, you can’t mark task as dependency of other task, etc. What you could do though is to build logic for “should I reexecute” inside the task binary. I.e, the task can just exit with zero if it sees mtime of the output is greater than the mtime of the input.

There are some ideas about adding task hooks like “run this task every time user types ‘cargo run’”, with a constraint that this works only for the current crate. That is, you can’t write a task which substitutes or decorates “cargo build” for the dependency, only build.rs of decencies is run.

There are no plans to add general purpose custom targets or dependency tracking. But if someone creares a general-purpose build system in Rust, they could use a cargo task for bootstrapping.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.