Closed vi closed 2 years ago
-Z build-std
?
Yes.
Activating e.g. -Zbuild-std-features=panic_immediate_abort
can drastically reduce bloat when aiming at sub-50kb executables, and analysing what still remains after removing libstd's string formatting and other debugging features can be benefitial.
Yes, I know what this option do. I'm saying you need a space after -Z
.
It does not work either way:
Error: unused arguments left: -Z, build-std=panic_abort,std, -Z, build-std-features=panic_immediate_abort.
Error: unused arguments left: -Zbuild-std=panic_abort,std, -Zbuild-std-features=panic_immediate_abort.
It Cargo, it works both with and without the space between -Z
and subargument.
Are you sure you're using the latest cargo bloat?
Something like cargo +nightly bloat --release -Z build-std --target aarch64-apple-darwin --crates
works just fine for me.
Indeed, I was using 0.10
and after upgrading to 0.11
-Z build-std
started working.
-Zbuild-std
also works, but produces different result (as if the option were not specified at all).
Maybe Warning: unused arguments left: ["-Zbuild-std=pa
should be error by default, unless some --force
is specified?
I will think about it.
It does not accept
-Z
option. And if I omit it, it start rebuilding the crate again instead of just analysing already built crate.