Skip to content

Commit b473ce3

Browse files
committed
rustc: Obey RUST_MIN_STACK env var
A lot of people are hitting stack overflows in rustc. This will make it easier to experiment with stack size.
1 parent c20b906 commit b473ce3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/librustc/rustc.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,13 @@ pub fn monitor(f: ~fn(diagnostic::Emitter)) {
319319
let ch_capture = ch.clone();
320320
let mut task_builder = task::task();
321321
task_builder.supervised();
322-
task_builder.opts.stack_size = Some(STACK_SIZE);
322+
323+
// XXX: Hacks on hacks. If the env is trying to override the stack size
324+
// then *don't* set it explicitly.
325+
if os::getenv("RUST_MIN_STACK").is_none() {
326+
task_builder.opts.stack_size = Some(STACK_SIZE);
327+
}
328+
323329
match do task_builder.try {
324330
let ch = ch_capture.clone();
325331
let ch_capture = ch.clone();

0 commit comments

Comments
 (0)