Skip to content

Commit 3875abe

Browse files
committed
Added RUSTC_GRAPHVIZ_FONT environment variable
Overrides the debugging_opts.graphviz_font setting.
1 parent 5c29332 commit 3875abe

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

compiler/rustc_session/src/config.rs

+4
Original file line numberDiff line numberDiff line change
@@ -1762,6 +1762,10 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {
17621762
debugging_opts.symbol_mangling_version = SymbolManglingVersion::V0;
17631763
}
17641764

1765+
if let Ok(graphviz_font) = std::env::var("RUSTC_GRAPHVIZ_FONT") {
1766+
debugging_opts.graphviz_font = graphviz_font;
1767+
}
1768+
17651769
if !cg.embed_bitcode {
17661770
match cg.lto {
17671771
LtoCli::No | LtoCli::Unspecified => {}

compiler/rustc_session/src/options.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,8 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
910910
graphviz_dark_mode: bool = (false, parse_bool, [UNTRACKED],
911911
"use dark-themed colors in graphviz output (default: no)"),
912912
graphviz_font: String = ("Courier, monospace".to_string(), parse_string, [UNTRACKED],
913-
"use the given `fontname` in graphviz output (default: `Courier, monospace`)"),
913+
"use the given `fontname` in graphviz output; can be overridden by setting \
914+
environment variable `RUSTC_GRAPHVIZ_FONT` (default: `Courier, monospace`)"),
914915
hir_stats: bool = (false, parse_bool, [UNTRACKED],
915916
"print some statistics about AST and HIR (default: no)"),
916917
human_readable_cgu_names: bool = (false, parse_bool, [TRACKED],

0 commit comments

Comments
 (0)