Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Consider renaming debug to generate-symbols in profiles #2373

Open
matklad opened this issue Feb 8, 2016 · 11 comments
Open

Consider renaming debug to generate-symbols in profiles #2373

matklad opened this issue Feb 8, 2016 · 11 comments
Labels
A-debugging Area: debug builds and debugging generated code A-profiles Area: profiles C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-needs-team-input Status: Needs input from team on whether/how to proceed.

Comments

@matklad
Copy link
Member

matklad commented Feb 8, 2016

In profiles, one can use

debug = true # Controls whether the compiler passes -g

The name debug is confounding (at least for me):

  1. It says nothing about "symbols",
  2. It implies "slower code", which is false,
  3. It can be confused with "debug-assertions".

Obviously we can't just rename debug to generate-symbols, but we can add an alias and update docs.

@steveklabnik
Copy link
Member

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.

@matklad
Copy link
Member Author

matklad commented Feb 9, 2016

Yeah, OIBIT happen :)

@alexcrichton
Copy link
Member

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...

@matklad
Copy link
Member Author

matklad commented Feb 9, 2016

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

@matklad
Copy link
Member Author

matklad commented Feb 9, 2016

Yep, and "Controls whether the compiler passes -g" comes from the docs

@matklad
Copy link
Member Author

matklad commented Feb 9, 2016

Some context: #1444 (comment)

@matklad
Copy link
Member Author

matklad commented Feb 9, 2016

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:

  1. Passing -g to rustc
  2. Passing DEBUG env variable to the build script.

At least gcc crate ignores "DEBUG" env var, and uses "PROFILE" for deciding on -g

@alexcrichton
Copy link
Member

Hm maybe that was just the intention and it never got implemented... I thought it was implemented?

@alexcrichton
Copy link
Member

Either way though I think that a more appropriate name for "pass the -g flag" would be "debuginfo".

@carols10cents carols10cents added A-profiles Area: profiles C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` A-debugging Area: debug builds and debugging generated code labels Sep 12, 2017
@luser
Copy link
Contributor

luser commented May 6, 2020

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.

@ghost
Copy link

ghost commented Jun 24, 2020

+1. This confused me for quite a while. I thought flamegraph-rs wanted me to somehow make the release builds be unoptimized.

@epage epage added the S-needs-team-input Status: Needs input from team on whether/how to proceed. label Sep 20, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-debugging Area: debug builds and debugging generated code A-profiles Area: profiles C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-needs-team-input Status: Needs input from team on whether/how to proceed.
Projects
None yet
Development

No branches or pull requests

6 participants