How to run code after build completes?

When building you can use build.rs to alter the build environment. Can I similarly have a file that runs after the binary is output, so that I can operate on the result?

Nope, not at the moment - you have to use external build tools: https://github.com/rust-lang/cargo/issues/545

1 Like

Thanks! That's a shame. I like only having to deal with cargo when I'm in a pure Rust project.

2 Likes

There's a prototype of cargo-based build helpers: https://github.com/matklad/cargo-xtask

2 Likes

You could also take a look at Cargo Make:

2 Likes

Thanks to you both. I'll investigate my options.