Open matklad opened 8 years ago
This is one of those "history is weird" things. -g
is short for "generate debug symbols", and so gets called the "debug flag" by people.
We've changed names of things that are historically important before, so it's not the end of the world, but that's some context at least.
Yeah, OIBIT happen :)
The term "debug" here was generally meant to encompass a number of options for debugging, for example right now it implies debuginfo and debug-assertions. We may want to add more options over time, but each individual option should also have its own key for tuning (I think debuginfo is missing one right now)
The documentation may need to be updated...
it implies debuginfo and debug-assertions.
Hm, not sure. At least this
[profile.release]
debug = true
fn main() {
debug_assert!(false);
println!("Hello, world!");
}
runs fine in --release
Yep, and "Controls whether the compiler passes -g" comes from the docs
Ok, quick grep reveals that debug
in TomlProfile
is used only to set debuginfo
in Profile
.
The debuginfo
is itself used only for two things:
-g
to rustc
DEBUG
env variable to the build script.At least gcc
crate ignores "DEBUG" env var, and uses "PROFILE" for deciding on -g
Hm maybe that was just the intention and it never got implemented... I thought it was implemented?
Either way though I think that a more appropriate name for "pass the -g
flag" would be "debuginfo".
Commenting on this extremely old issue to say that we had exactly this same confusion with Firefox builds a long time ago so we added an --enable-debug-symbols
option to configure and made it so --enable-debug
(which also enabled extra debug assertions) implied --enable-debug-symbols
.
+1. This confused me for quite a while. I thought flamegraph-rs
wanted me to somehow make the release builds be unoptimized.
In profiles, one can use
debug = true # Controls whether the compiler passes -g
The name
debug
is confounding (at least for me):Obviously we can't just rename
debug
togenerate-symbols
, but we can add an alias and update docs.