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

Allow configuring -C debug-assertions setting #1398

Closed
rprichard opened this issue Mar 10, 2015 · 0 comments · Fixed by #1444
Closed

Allow configuring -C debug-assertions setting #1398

rprichard opened this issue Mar 10, 2015 · 0 comments · Fixed by #1444
Labels
A-configuration Area: cargo config files and env vars E-easy Experience: Easy

Comments

@rprichard
Copy link

cargo currently passes -g when debugging is on and --cfg ndebug when debugging is off:

if profile.debug() {
    cmd.arg("-g");
} else {
    cmd.args(&["--cfg", "ndebug"]);
}

The rust compiler recently stopped using --cfg ndebug to control debug_assert! and instead uses #[cfg(debug_assertions)], enabled when the optimization-level is 0, and overridable using -C debug-assertions (RFC 563)

We may want to add a debug_assertions profile setting like the existing opt-level and debug settings. Even if we don't, though, we should at least stop passing --cfg ndebug.

@alexcrichton alexcrichton added E-easy Experience: Easy A-configuration Area: cargo config files and env vars labels Mar 10, 2015
alexcrichton added a commit to alexcrichton/cargo that referenced this issue Mar 24, 2015
This commit removes the ndebug support from Cargo and also adds a new
configuration option for profiles, `debug-assertions`, which controls whether
debug assertions in the compiler are turned on or not.

Closes rust-lang#1398
bors added a commit that referenced this issue Mar 24, 2015
This commit removes the ndebug support from Cargo and also adds a new
configuration option for profiles, `debug-assertions`, which controls whether
debug assertions in the compiler are turned on or not.

Closes #1398
alexcrichton added a commit to alexcrichton/cargo that referenced this issue Mar 24, 2015
This commit removes the ndebug support from Cargo and also adds a new
configuration option for profiles, `debug-assertions`, which controls whether
debug assertions in the compiler are turned on or not.

Closes rust-lang#1398
bors added a commit that referenced this issue Mar 24, 2015
This commit removes the ndebug support from Cargo and also adds a new
configuration option for profiles, `debug-assertions`, which controls whether
debug assertions in the compiler are turned on or not.

Closes #1398
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-configuration Area: cargo config files and env vars E-easy Experience: Easy
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants