4 ms·
That's just a poor default, I guess. Rust compiles debug builds unless you tell it not to.
by saagarjha 7y ago
That's just a poor default, I guess. Rust compiles debug builds unless you tell it not to.
- neutronicus 7y agoThis may have changed since the days of my youth
- umanwizard 7y agoWhether a build is debug or release is independent of whether it contains debug symbols. Both `cargo build` and `cargo build --release` produce builds with debug symbols.
- saagarjha 7y agoDon't you need to add [profile.release] debug = true to make this work?
- umanwizard 7y agoOh, you may be right. My company's main codebase does indeed have that; I had assumed it was the default.
- Freaky 7y agoI think you still get symbols for libstd without that. I can see why that would lead to confusion - stripping a plain --release build still saves a few MB.
- steveklabnik 7y agoIIRC this is correct, libstd is built in release mode but with debuginfo.
- ComputerGuru 7y agoC/C++ compile some weird default of neither debug nor optimized, basically the least helpful thing anyone could want (no performance optimizations, no debug symbols, and maybe-maybe-not asserts depending on if the standard library you’re using or the libraries you’re depending on used #if NDEBUG or #if DEBUG to gate the assertion checks. And not optimized for size either, if that’s what you were wondering).