Description
Already have panic = "abort"
in cargo, and it doesn't seem to leave the panic!() strings out of the compiled binary, even on --release
build. I don't care about panic strings, I just want a slim generated exe that fails if something goes wrong.
tokio
, crossbeam
and chrono
are adding a lot of useless strings in the .rdata
on Windows, for example. also opt-level = "s"
(and "z"
)
tried to use panic::set_hook
as well, it didn't do anything. tried to make the long path names using remap-path-prefix
but it seemed to have no effect (the paths are still full absolute paths to current user folder/.cargo/registry). doesn't matter if I use windows paths (eg: C:\Users or Unix C:/Users) and besides the #40552 that's two years old, but a minor issue when you need to rely on std and size optimizations.
also tried a lot of other stuff (like link-arg=-s
, debuginfo=0
, no-landing-pads
, etc), while the generated exe is smaller than a full blown cargo build --release
, so it's really an unexpected output from the compiler