mrustc icon indicating copy to clipboard operation
mrustc copied to clipboard

Reducing disk usage to bootstrap rustc

Open catap opened this issue 3 years ago • 4 comments

Right now build script never cleanup build artefacts from previous steps which increases disc usage.

Maybe it is possible to clean things up?

catap avatar Aug 30 '22 14:08 catap

Can you clarify which artefacts you feel could/should be automatically cleaned up? In general, they're kept around so that a failed build can be restarted cleanly... although that sometimes doesn't really apply.

thepowersgang avatar Aug 31 '22 12:08 thepowersgang

@thepowersgang I'm thinking about something like bootstrap-lean from gcc build. The idea of bootstrap-lean is remove all compiling objects after the step's artefact is ready. And when step's artefact doesn't required anymore => remove it also.

catap avatar Sep 03 '22 11:09 catap

What I'm thinking.

  1. output-1.54.0/rustc-build can be removed after output-1.54.0/rustc is ready (that reduces disk usage for more than 6Gb);
  2. output-1.54.0/cargo-build can be removed after output-1.54.0/cargo is ready (that reduces disk usage for more than 1Gb);
  3. output-1.54.0 can be removed after run_rustc/output-1.54.0/prefix/bin/cargo and run_rustc/output-1.54.0/prefix-s/bin/rustc is ready (that reduces disk usage for another ~0.8Gb)
  4. run_rustc/output-1.54.0/... can be removed then not needed.

To be honest (1) and (2) or just (3) makes huge win. Saves ~8Gb from ~14Gb of disk space usage.

What do you think?

catap avatar Sep 03 '22 20:09 catap

A good idea, but that's not something I'd like to add to the default scripts as it'd make debugging much slower.

thepowersgang avatar Sep 04 '22 01:09 thepowersgang