zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit b9469345761bbac5dcb95f2ba662d4ddd7fc567e (tree)
parent 644baa0f5bde6e51304dee46aa9e7eae1e46c863
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Thu, 21 Jul 2022 12:20:50 -0700

build.zig: 32 MiB stack size

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

Diffstat:
Mbuild.zig | 3+++
Mtest/cases/compile_errors/endless_loop_in_function_evaluation.zig | 2+-
2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/build.zig b/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(); diff --git a/test/cases/compile_errors/endless_loop_in_function_evaluation.zig b/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