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: Post-build script execution · Issue #545 · rust-lang/cargo · GitHub

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: GitHub - 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.

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