Commit b946934576

Andrew Kelley <andrew@ziglang.org>
2022-07-21 21:20:50
build.zig: 32 MiB stack size
This gives more headroom for comptime recursion, especially for debug builds of Zig.
1 parent 644baa0
Changed files (2)
test/cases/compile_errors/endless_loop_in_function_evaluation.zig
@@ -7,7 +7,7 @@ export fn entry() usize { return @sizeOf(@TypeOf(&seventh_fib_number)); }
 
 // error
 // backend=stage2
-// target=x86_64-linux
+// target=native
 //
 // :3:21: error: evaluation exceeded 1000 backwards branches
 // :3:21: note: use @setEvalBranchQuota() to raise the branch limit from 1000
build.zig
@@ -11,6 +11,7 @@ const InstallDirectoryOptions = std.build.InstallDirectoryOptions;
 const assert = std.debug.assert;
 
 const zig_version = std.builtin.Version{ .major = 0, .minor = 10, .patch = 0 };
+const stack_size = 32 * 1024 * 1024;
 
 pub fn build(b: *Builder) !void {
     b.setPreferredReleaseMode(.ReleaseFast);
@@ -41,6 +42,7 @@ pub fn build(b: *Builder) !void {
     const toolchain_step = b.step("test-toolchain", "Run the tests for the toolchain");
 
     var test_cases = b.addTest("src/test.zig");
+    test_cases.stack_size = stack_size;
     test_cases.setBuildMode(mode);
     test_cases.addPackagePath("test_cases", "test/cases.zig");
     test_cases.single_threaded = single_threaded;
@@ -141,6 +143,7 @@ pub fn build(b: *Builder) !void {
     };
 
     const exe = b.addExecutable("zig", main_file);
+    exe.stack_size = stack_size;
     exe.strip = strip;
     exe.build_id = b.option(bool, "build-id", "Include a build id note") orelse false;
     exe.install();