Skip to content

Add regression test for binary size regression in derive(Debug) - #166625

Open
panstromek wants to merge 1 commit into
rust-lang:mainfrom
panstromek:regression-test-binary-size
Open

panstromek wants to merge 1 commit into
rust-lang:mainfrom
panstromek:regression-test-binary-size

Conversation

@panstromek

@panstromek panstromek commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Regression test for #165189
closes #165189

This is a first time I'm adding a test like this, so there are two things I'm not sure about:

  • do I need to restrict this to some platforms? I don't know where this can blow up unexpectedly.
  • the threshold is current binary size + 10%, which is just intuition, I don't know how strict we should be here.

r? folkertdev

@rustbot rustbot added A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Nov 26, 2026
@rust-log-analyzer

This comment has been minimized.

@panstromek

Copy link
Copy Markdown
Contributor Author

I guess we ignore arm then? 😆

66928 is suspiciously big, though, I wonder what's happening there

@folkertdev

Copy link
Copy Markdown
Contributor

Locally the aarch64 test fails with .linker("aarch64-linux-gnu-ld") but works with .linker("rust-lld"), so there must be some difference in defaults between them.

Overall I think binary size is really difficult to pin down in a reliable, cross-platform way. Maybe it makes more sense to measure the size of the generated MIR/LLVM IR?

@panstromek

panstromek commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor Author

I think checking MIR or LLVM IR would be too early, this code is eliminated further down the line, maybe even during link-time (I'm not exactly sure now). Maybe we should limit this to x64 Linux then, where we know it works. I don't think we need to do it perfectly for now, I just want start somewhere. Right now there's no signal about this at all, so one test for one platform is at least something.

@folkertdev folkertdev left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, yeah then pinning this to one target (that runs in PR CI) seems fine.

View changes since this review

@panstromek
panstromek force-pushed the regression-test-binary-size branch from 99a55de to aa19a9a Compare November 28, 2026 15:16
@panstromek

Copy link
Copy Markdown
Contributor Author

I restricted this to Linux x86-64 for now.

@folkertdev

Copy link
Copy Markdown
Contributor

@bors try jobs=test-various

Just to check if there is anything weird in our CI (musl maybe?)

@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Nov 28, 2026
Add regression test for binary size regression in derive(Debug)


try-job: test-various
@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 28, 2026
@rust-bors

rust-bors Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

💔 Test for 39c1a52 failed: CI. Failed job:

@rust-log-analyzer

This comment has been minimized.

@panstromek
panstromek force-pushed the regression-test-binary-size branch from aa19a9a to 6ff0a43 Compare November 29, 2026 07:46
@panstromek

Copy link
Copy Markdown
Contributor Author

@rustbot ready
(if CI agrees)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 29, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-run-make Area: port run-make Makefiles to rmake.rs S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Binary size regression on MSP430

4 participants