-
Notifications
You must be signed in to change notification settings - Fork 12.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Big file size regression on Windows #99143
Comments
How was this built? My best guess (and why I'm asking the above) is that you already have a EDIT: turns out it's the standard library, I forgot we compile it w/ debuginfo until #99143 (comment) |
This was built with |
Just checked, this regressed between |
This comment was marked as outdated.
This comment was marked as outdated.
I already ran cargo-bisect-rustc, that's how I came to the conclusion in #99143 (comment) that it was #98350. Sorry if that wasn't clear. |
My bad - also, I was probably wasting everyone's time by not trying to borrow someone else's windows laptop. So what's really going on is that even at > ls $HOME/.rustup/toolchains/nightly-2022-07-09-x86_64-pc-windows-msvc/lib/rustlib/x86_64-pc-windows-msvc/lib/libstd-*.rlib
-a---- 7/12/2022 9:52 PM 17610844 libstd-3aa3a0da9afb34c9.rlib
> ls $HOME/.rustup/toolchains/nightly-2022-07-10-x86_64-pc-windows-msvc/lib/rustlib/x86_64-pc-windows-msvc/lib/libstd-*.rlib
-a---- 7/12/2022 9:55 PM 19936364 libstd-3aa3a0da9afb34c9.rlib So yeah, it's #98350 via |
WG-prioritization assigning priority (Zulip discussion). @rustbot label -I-prioritize +P-medium +I-heavy |
Regarding prioritization: This kills the Clippy Windows CI, because it is running out of disk space: rust-lang/rust-clippy#9174 It increases the size of I don't think Clippy is/will be the only project affected by this. |
Btw as per #98350 (comment) a quick fix would be to make the (unconditional after #98350) This should be perfectly backwards compatible as all MSVC targets had If someone can make a PR and test it on windows, I'll r+ p=10 it just to get it out sooner. |
$ cargo clean && cargo +stable build -q && ls -lh target/debug/helloworld.*
-rw-r--r-- 1 lqd 197121 117 Jul 14 19:40 target/debug/helloworld.d
-rwxr-xr-x 2 lqd 197121 156K Jul 14 19:40 target/debug/helloworld.exe*
-rw-r--r-- 2 lqd 197121 1.2M Jul 14 19:40 target/debug/helloworld.pdb
$ cargo clean && cargo +nightly-2022-07-08 build -q && ls -lh target/debug/helloworld.*
-rw-r--r-- 1 lqd 197121 117 Jul 14 19:41 target/debug/helloworld.d
-rwxr-xr-x 2 lqd 197121 157K Jul 14 19:41 target/debug/helloworld.exe*
-rw-r--r-- 2 lqd 197121 1.3M Jul 14 19:41 target/debug/helloworld.pdb
$ cargo clean && cargo +nightly build -q && ls -lh target/debug/helloworld.*
-rw-r--r-- 1 lqd 197121 117 Jul 14 19:41 target/debug/helloworld.d
-rwxr-xr-x 2 lqd 197121 3.4M Jul 14 19:41 target/debug/helloworld.exe*
-rw-r--r-- 2 lqd 197121 2.7M Jul 14 19:41 target/debug/helloworld.pdb
$ cargo clean && cargo +stage1 build -q && ls -lh target/debug/helloworld.*
-rw-r--r-- 1 lqd 197121 117 Jul 14 19:41 target/debug/helloworld.d
-rwxr-xr-x 2 lqd 197121 167K Jul 14 19:41 target/debug/helloworld.exe*
-rw-r--r-- 2 lqd 197121 596K Jul 14 19:41 target/debug/helloworld.pdb
(edit1: maybe I did something silly in this test above in that maybe debuginfo-std-level is not the same as a nightly) |
Since you're doing a local build, that will be highly impacted by Lines 72 to 75 in 24699bc
Okay yeah looks like dist builds always set |
Indeed, forcing this setting as @eddyb mentions, and doing the same build as #99143 (comment) instead of a debug build, it's looking good now. I'll open a PR. |
cc @rust-lang/wg-debugging Before this is concluded, I wanted to bring up that we could've likely avoided this bug if we had "debuginfo tests" (in the sense of introspecting the debuginfo generated, without involved a debugger) and they were always looking for both:
(The only test that even uses Because what would've then happened in #98350 is any CodeView-only test would start also having DWARF being found by One complication though, and you might already have guessed it by the section names in the original issue description, but @lqd just tried to use We believe PE is causing the symbol names to be truncated, as per MS docs:
However, I don't believe we would ever actually rely on dumping debuginfo from a final executable (on any platform), because that statically links Thankfully, @lqd was able to confirm that |
Out of curiosity, I also checked the MinGW target ( (click to expand
|
thanks for the ping @flip1995 I have re-read this issue and you're right, this is much more impacting than I (mistakenly) understood. Even if the issue should be now solved I'll bump up the prioritization for historical records to @rustbot label P-critical -P-medium |
Binary sizes on the latest nightlies are significantly larger than on stable and some previous nightly versions. This is caused by some extra sections in the binary and also an increase in the text and data sections
Stable (1.62.0):
Nightly (1.64.0-nightly c396bb3):
Code
I tried this code:
I expected to see this happen: small binary size (143 360 bytes on 1.62.0)
Instead, this happened: extremely large binary size (3 517 952 bytes)
Version it worked on
It most recently worked on: Rust 1.64.0 (nightly) ddcbba0
Version with regression
rustc --version --verbose
:The text was updated successfully, but these errors were encountered: