authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-07-21 12:20:50-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2022-07-21 12:23:33-07:00
logb9469345761bbac5dcb95f2ba662d4ddd7fc567e
tree0cc66d47447c30a407d15421186e039ec83d29d3
parent644baa0f5bde6e51304dee46aa9e7eae1e46c863

build.zig: 32 MiB stack size

This gives more headroom for comptime recursion, especially for debug builds of Zig.

2 files changed, 4 insertions(+), 1 deletions(-)

build.zig+3
...@@ -11,6 +11,7 @@ const InstallDirectoryOptions = std.build.InstallDirectoryOptions;...@@ -11,6 +11,7 @@ const InstallDirectoryOptions = std.build.InstallDirectoryOptions;
11const assert = std.debug.assert;11const assert = std.debug.assert;
1212
13const zig_version = std.builtin.Version{ .major = 0, .minor = 10, .patch = 0 };13const zig_version = std.builtin.Version{ .major = 0, .minor = 10, .patch = 0 };
14const stack_size = 32 * 1024 * 1024;
1415
15pub fn build(b: *Builder) !void {16pub fn build(b: *Builder) !void {
16 b.setPreferredReleaseMode(.ReleaseFast);17 b.setPreferredReleaseMode(.ReleaseFast);
...@@ -41,6 +42,7 @@ pub fn build(b: *Builder) !void {...@@ -41,6 +42,7 @@ pub fn build(b: *Builder) !void {
41 const toolchain_step = b.step("test-toolchain", "Run the tests for the toolchain");42 const toolchain_step = b.step("test-toolchain", "Run the tests for the toolchain");
4243
43 var test_cases = b.addTest("src/test.zig");44 var test_cases = b.addTest("src/test.zig");
45 test_cases.stack_size = stack_size;
44 test_cases.setBuildMode(mode);46 test_cases.setBuildMode(mode);
45 test_cases.addPackagePath("test_cases", "test/cases.zig");47 test_cases.addPackagePath("test_cases", "test/cases.zig");
46 test_cases.single_threaded = single_threaded;48 test_cases.single_threaded = single_threaded;
...@@ -141,6 +143,7 @@ pub fn build(b: *Builder) !void {...@@ -141,6 +143,7 @@ pub fn build(b: *Builder) !void {
141 };143 };
142144
143 const exe = b.addExecutable("zig", main_file);145 const exe = b.addExecutable("zig", main_file);
146 exe.stack_size = stack_size;
144 exe.strip = strip;147 exe.strip = strip;
145 exe.build_id = b.option(bool, "build-id", "Include a build id note") orelse false;148 exe.build_id = b.option(bool, "build-id", "Include a build id note") orelse false;
146 exe.install();149 exe.install();
test/cases/compile_errors/endless_loop_in_function_evaluation.zig+1-1
...@@ -7,7 +7,7 @@ export fn entry() usize { return @sizeOf(@TypeOf(&seventh_fib_number)); }...@@ -7,7 +7,7 @@ export fn entry() usize { return @sizeOf(@TypeOf(&seventh_fib_number)); }
77
8// error8// error
9// backend=stage29// backend=stage2
10// target=x86_64-linux10// target=native
11//11//
12// :3:21: error: evaluation exceeded 1000 backwards branches12// :3:21: error: evaluation exceeded 1000 backwards branches
13// :3:21: note: use @setEvalBranchQuota() to raise the branch limit from 100013// :3:21: note: use @setEvalBranchQuota() to raise the branch limit from 1000