Skip to content

Reported size of cargo clean is incorrect? #15823

@RandomInsano

Description

@RandomInsano

Problem

The reported amount of disk space cleaned is not the same as reported by du -sh . on Mac and Linux.

Hopefully this isn't a megabyte versus mebibyte problem...

Steps

Run the following:

git clone https://github.com/rust-lang/cargo
cd cargo
cargo build --release
echo "Size before cleaning:"
du -sh .
cargo clean
echo "Size after cleaning:"
du -sh .

Possible Solution(s)

No response

Notes

Here are the results of my run on macOS:

Size before cleaning:
705M    .
     Removed 2811 files, 614.4MiB total
Size after cleaning:
 82M    .

705-614 = 91MB

Here's the results on Debian Linux 12:

Size before cleaning:
700M    .
     Removed 2938 files, 702.2MiB total
Size after cleaning:
 94M    .

700 - 702 = -2

Version

macOS: 1.89.0
Linux: 1.89.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bugCommand-cleanS-triageStatus: This issue is waiting on initial triage.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions