Skip to content
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

Disk usage 2-3x somewhere around 1.48 #84097

Closed
infinity0 opened this issue Apr 11, 2021 · 14 comments
Closed

Disk usage 2-3x somewhere around 1.48 #84097

infinity0 opened this issue Apr 11, 2021 · 14 comments
Labels
I-heavy Issue: Problems and improvements with respect to binary size of generated code. ICEBreaker-Cleanup-Crew Helping to "clean up" bugs with minimal examples and bisections P-high High priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@infinity0
Copy link
Contributor

infinity0 commented Apr 11, 2021

Not sure if anyone else is seeing this, but the Debian builds of rustc started to take up way more disk space around 1.48, in some cases more than a 3x increase:

arch 1.47 → 1.48 1.48 → 1.48 1.49 beta → 1.49
all [*] 7 GB 20.32 GB 21.73 GB
amd64 8.36 GB 32.69 GB 34.62 GB
arm64 7.61 GB 25.03 GB 26.85 GB
armel 7.39 GB 9.95 GB 11.21 GB
armhf 7.38 GB 9.94 GB 11.2 GB
i386 7.74 GB 27.29 GB 28.84 GB
mips64el 9.47 GB 33.6 GB 36.63 GB
mipsel 8.94 GB 11.5 GB 12.85 GB
powerpc 7.64 GB 9.88 GB (failed)
ppc64 8.12 GB 33.06 GB 35.1 GB
ppc64el 14.4 GB 39.48 GB 41.75 GB
riscv64 7.7 GB 37.61 GB (failed)
s390x 8.24 GB 39.31 GB 42.09 GB
sparc64 7.97 GB 31.57 GB 33.39 GB

Data from Debian rustc logs; the column headings mean (version of stage0 used -> stable version being built)

[*] architecture-independent artifacts such as libstd:wasm32 and docs; builds rustc during the process but this is discarded

LLVM 11 was used for all of these builds.

@jyn514 jyn514 added I-heavy Issue: Problems and improvements with respect to binary size of generated code. regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 11, 2021
@rustbot rustbot added the I-prioritize Issue: Indicates that prioritization has been requested for this issue. label Apr 11, 2021
@jyn514
Copy link
Member

jyn514 commented Apr 11, 2021

@infinity0 is this with incremental enabled? Could you paste debian/config.toml?

@infinity0
Copy link
Contributor Author

We are not enabling incremental, the relevant parts of config.toml is as follows, but this hasn't changed across the 3 different builds listed in the above table:

[build]
submodules = false
vendor = true
locked-deps = false
verbose = 2

[install]
prefix = "/usr"

[target.DEB_BUILD_RUST_TYPE]
llvm-config = "LLVM_DESTDIR/usr/lib/llvm-LLVM_VERSION/bin/llvm-config"
linker = "DEB_BUILD_GNU_TYPE-gcc"

[target.DEB_HOST_RUST_TYPE]
llvm-config = "LLVM_DESTDIR/usr/lib/llvm-LLVM_VERSION/bin/llvm-config"
linker = "DEB_HOST_GNU_TYPE-gcc"

[target.wasm32-wasi]
wasi-root = "/usr"

[llvm]
link-shared = true

[rust]
jemalloc = false
optimize = true
dist-src = false

channel = "stable"

debuginfo-level = 2
debuginfo-level-std = 2
rpath = false
remap-debuginfo = true

verbose-tests = true
backtrace-on-ice = true

We also have some Debian-specific patches but these are generally fairly trivial and also haven't changed significantly across the builds.

One thing that may be significant, is the first column used LLVM 11.0.0 but the others used LLVM 11.0.1. Does rust official builds record the disk usage? If so it would be interesting to see this info for before and after PR #80796.

@Mark-Simulacrum
Copy link
Member

We don't track those metrics (yet), but it may be possible to pull them from logs. Do you have a tarball or some other way of seeing what is using the disk space in your case?

@klensy
Copy link
Contributor

klensy commented Apr 11, 2021

I've see

1.40.0+dfsg1-5 (sid)

amd64 Maybe-Successful 2020-01-05 17:11:43 x86-ubc-01 1h 50m 20.07 GB

So it isn't specific to version mentioned?

@nagisa
Copy link
Member

nagisa commented Apr 12, 2021

What is the actual thing that's being measured here?

@infinity0
Copy link
Contributor Author

@Mark-Simulacrum no sadly not, it all gets discarded. I can probably reproduce by rebuilding an old version but that'll take some time.

@nagisa Extra disk space consumed by the build process.

It's possibly debuginfo-related - the architectures using the least space are the ones where we are setting debuginfo-level = 0 due to #45854, generally the 32-bit architectures. But it's weird that it's changing across versions when the config is staying the same.

@apiraino
Copy link
Contributor

Issue has been discussed during the compiler team meeting on Zulip.

We acknowledge this is definitively a major annoyance and we need to improve/investigate our reporting on our builds (currently lacking a bit of depth in this regard).

@rustbot label -I-prioritize +P-medium

@rustbot rustbot added P-medium Medium priority and removed I-prioritize Issue: Indicates that prioritization has been requested for this issue. labels Apr 15, 2021
@apiraino apiraino added P-high High priority and removed P-medium Medium priority labels Apr 15, 2021
@apiraino
Copy link
Contributor

Could some bisecting help isolating why the debug artifacts have been growing so much?

@rustbot ping icebreakers-cleanup-crew

@rustbot rustbot added the ICEBreaker-Cleanup-Crew Helping to "clean up" bugs with minimal examples and bisections label Apr 15, 2021
@rustbot
Copy link
Collaborator

rustbot commented Apr 15, 2021

@chordtoll
Copy link
Contributor

I was able to reproduce this one locally, and it appears to be a change in how cargo resolves the value of the debuginfo parameter to pass to rustc. With everything else held constant, a build using cargo rust-1.42.0 uses ~8G of space, and cargo rust-1.46.0 uses ~33G. I'm working on bisecting further, and hope to have a specific changeset identified in a few days.

@chordtoll
Copy link
Contributor

chordtoll commented Feb 20, 2022

Looks like the change is caused by rust-lang/cargo#5506, which stabilizes the config-profile feature. We've been setting the CARGO_PROFILE_RELEASE_DEBUG = 2 environment variable, and prior to this merge, this was ignored, since we were not setting the -Z config-profile option.

@chordtoll
Copy link
Contributor

I'm not yet sure where that environment variable is set, but my initial impression is that this is likely a misconfiguration in the debian build config. I'll investigate further.

@pnkfelix
Copy link
Member

pnkfelix commented Dec 2, 2022

Visting for P-high review.

Based on the discussion thread here, I am inferring that this is a misconfiguration issue in the debian build config, as stated by @chordtoll above.

(While it would be nice to figure out ways to reduce the disk size overhead of our debuginfo-level=2 generation, that is not a P-high issue, I think.)

Closing as "working as expected"

@pnkfelix pnkfelix closed this as completed Dec 2, 2022
@wesleywiser
Copy link
Member

I agree, this does seem to be expected as a result of more crates being compiled with debuginfo=2. If however, there is some specific set of crates that don't need to be compiled with debuginfo=2 and lowering that would make a noticeable difference in terms of disk space used, I think it would potentially be reasonable to expose a configuration option in config.toml for those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
I-heavy Issue: Problems and improvements with respect to binary size of generated code. ICEBreaker-Cleanup-Crew Helping to "clean up" bugs with minimal examples and bisections P-high High priority regression-from-stable-to-stable Performance or correctness regression from one stable version to another. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

10 participants