Stream: t-compiler/rust-analyzer

Topic: `target` dir grows too quickly


Jonas Schievink [he/him] (Jan 18 2021 at 19:03, on Zulip):

I noticed that my target dir is over 100 GB in size again. That's more than double the size of all crates on crates.io, which seems unreasonable. Are we doing anything wrong? Is this because we update dependencies so often?

Lukas Wirth (Jan 18 2021 at 19:06, on Zulip):

That and I think running tests on only some sub crates specifically(via -p crate) cause some dependencies to recompile due to feature flags, at least I tend to see some stuff recompile depending on what crate I run tests on. But I'm not entirely sure on that one, might be misremembering.

cynecx (Jan 18 2021 at 19:07, on Zulip):

are u regularely running cargo clean? cargo doesn't seem to cleanup when you eg. update your toolchain or when it has to recompile stuff

Jonas Schievink [he/him] (Jan 18 2021 at 19:07, on Zulip):

Running cargo check, cargo test, and cargo build --release (part of my usual workflow), my target dir is only at 5.2G, so 100 certainly seems excessive.

matklad (Jan 18 2021 at 19:07, on Zulip):

heh, and that's with debug = 0...

Lukas Wirth (Jan 18 2021 at 19:08, on Zulip):

Mine currently sits at 32gb :sweat_smile:

matklad (Jan 18 2021 at 19:08, on Zulip):

Could it be the incremental dir?

matklad (Jan 18 2021 at 19:08, on Zulip):

36gb btw

Lukas Wirth (Jan 18 2021 at 19:08, on Zulip):

target/debug/incremental sits at 20gb for me

matklad (Jan 18 2021 at 19:09, on Zulip):

Although I rm -rf library -- finally got my 12 core ryzen :D

Jonas Schievink [he/him] (Jan 18 2021 at 19:10, on Zulip):

oh nice, 5900X?

matklad (Jan 18 2021 at 19:11, on Zulip):

yup

matklad (Jan 18 2021 at 19:12, on Zulip):

I now hate serde -- it's a sequential bottleneck

Jonas Schievink [he/him] (Jan 26 2021 at 19:00, on Zulip):

I'm already back up to 39 GB now

matklad (Jan 26 2021 at 19:02, on Zulip):

image.png

matklad (Jan 26 2021 at 19:02, on Zulip):

I wonder why these are duplicated?

Jonas Schievink [he/him] (Jan 26 2021 at 19:02, on Zulip):

why does the hash keep changing?

Jonas Schievink [he/him] (Jan 26 2021 at 19:03, on Zulip):

that normally happens when the crate version differs, the Rust version used to build it differs, or a different cargo profile was used

Jonas Schievink [he/him] (Jan 26 2021 at 19:04, on Zulip):

but I don't really expect it to crate so many versions during normal development

matklad (Jan 30 2021 at 13:45, on Zulip):

@Jonas Schievink looks like that if you update dependency, the hash changes

matklad (Jan 30 2021 at 13:45, on Zulip):

ie, updating rowan dupes every rust-analyzer crate

Jonas Schievink [he/him] (Jan 30 2021 at 13:48, on Zulip):

oh, that makes sense

Last update: Jul 27 2021 at 22:15UTC