LukeMathWalker / cargo-px

A cargo subcommand that extends cargo's capabilities when it comes to code generation.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can cargo px run a command after a crate is built?

dlight opened this issue · comments

Cargo still doesn't support something like postbuild.rs which would run after the build (like build.rs runs before the build). The usual workaround is to build with another tool that first calls cargo build, then run the other command if the build is successful. Something like make or whatnot.

But, cargo px is another tool, one that was created explicitly to address shortcomings of Cargo. Could it maybe support this use case? (at least until Cargo has this feature natively).

Now, I had another idea to workaround this issue, which is basically to use the xtask pattern to drive the build (calling first cargo build, then the postbuild command). But I would like to avoid this if cargo px had a postbuild option.

It currently doesn't, but I'm open to explore the idea—is there any prior art/research on the topic for cargo?