Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

add config option to add only debug! (and not trace!) calls #76752

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions compiler/rustc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ features = ['unprefixed_malloc_on_supported_platforms']
jemalloc = ['jemalloc-sys']
llvm = ['rustc_driver/llvm']
max_level_info = ['rustc_driver/max_level_info']
max_level_debug = ['rustc_driver/max_level_debug']
1 change: 1 addition & 0 deletions compiler/rustc_driver/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ winapi = { version = "0.3", features = ["consoleapi", "debugapi", "processenv"]
[features]
llvm = ['rustc_interface/llvm']
max_level_info = ['tracing/max_level_info']
max_level_debug = ['tracing/max_level_debug']
5 changes: 5 additions & 0 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ pub struct Config {
pub rust_debug_assertions: bool,
pub rust_debug_assertions_std: bool,
pub rust_debug_logging: bool,
pub rust_trace_logging: bool,
pub rust_debuginfo_level_rustc: u32,
pub rust_debuginfo_level_std: u32,
pub rust_debuginfo_level_tools: u32,
Expand Down Expand Up @@ -394,6 +395,7 @@ struct Rust {
debug_assertions: Option<bool>,
debug_assertions_std: Option<bool>,
debug_logging: Option<bool>,
trace_logging: Option<bool>,
debuginfo_level: Option<u32>,
debuginfo_level_rustc: Option<u32>,
debuginfo_level_std: Option<u32>,
Expand Down Expand Up @@ -603,6 +605,7 @@ impl Config {
let mut debug_assertions = None;
let mut debug_assertions_std = None;
let mut debug_logging = None;
let mut trace_logging = None;
let mut debuginfo_level = None;
let mut debuginfo_level_rustc = None;
let mut debuginfo_level_std = None;
Expand Down Expand Up @@ -684,6 +687,7 @@ impl Config {
debug_assertions = rust.debug_assertions;
debug_assertions_std = rust.debug_assertions_std;
debug_logging = rust.debug_logging;
trace_logging = rust.trace_logging;
debuginfo_level = rust.debuginfo_level;
debuginfo_level_rustc = rust.debuginfo_level_rustc;
debuginfo_level_std = rust.debuginfo_level_std;
Expand Down Expand Up @@ -802,6 +806,7 @@ impl Config {
debug_assertions_std.unwrap_or(config.rust_debug_assertions);

config.rust_debug_logging = debug_logging.unwrap_or(config.rust_debug_assertions);
config.rust_trace_logging = trace_logging.unwrap_or(config.rust_debug_logging);

let with_defaults = |debuginfo_level_specific: Option<u32>| {
debuginfo_level_specific.or(debuginfo_level).unwrap_or(if debug == Some(true) {
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -549,6 +549,8 @@ impl Build {
// as well as tracing *ignoring* this feature when debug_assertions is on
if !self.config.rust_debug_logging {
features.push_str(" max_level_info");
} else if !self.config.rust_trace_logging {
features.push_str(" max_level_debug");
}

features
Expand Down