rust-lang / backtrace-rs

Backtraces in Rust
https://docs.rs/backtrace
Other
524 stars 240 forks source link

CI: add workflow for checking binary size #542

Closed Kobzol closed 1 year ago

Kobzol commented 1 year ago

This PR adds a CI workflow that tracks the binary size effect of backtrace on Rust programs. After each commit to a PR, it downloads rustc, patches in backtrace using the base SHA of the PR, builds stage 0 libstd, and compiles a simple program that panics. Then it patches in the updated (head) SHA of the PR, builds stage 0 libstd again, and compiles the program again. If the binary sizes differ, it posts a comment to the PR.

The comment (when I artificially increased the binary size of backtrace) can be seen here.

The workflow takes about 3 minutes on the default ubuntu-latest CI runner.

Once/if https://github.com/rust-lang/rust/pull/113341 gets merged, the workflow can be simplified slightly (four lines can be removed).

Fixes: https://github.com/rust-lang/backtrace-rs/issues/541

workingjubilee commented 1 year ago

Oh excellent! This means I get to try it out on https://twitter.com/capcorvidart/status/1676443948162613250

klensy commented 1 year ago

Sadly that don't work with windows targets, for example #543 cuts about 30kb from stdlib (all gains from miniz_oxide, but anyway). But looks like no change for hello world app, stdlib only.

Kobzol commented 1 year ago

Once the workflow actually works, I don't think that it should be that difficult to also run it on Windows on CI :)