I have e.g. a codegen task that (say) creates a file generated.rs. This is partly in Rust and it also calls out to an external command.
I tried having a cli binary and adding a codegen subcommand with clap etc. but my problem is that, when my codegen is misconfigured, generated.rs may have compiler errors that prevent the whole project from compiling, and thus I can't re-run my codegen command to fix the problem.
I've moved to a completely external script using rust-script, but of course this means I can't re-use code easily from the project, and (at least my) IDE support for rust-script is pretty poor.
Is there a better way to do this? Maybe this is a case for workspaces? Although I've not used them before.