Subject: Re: [bug#77431] [PATCH] gnu: zig: Set rss_max to unlimited

From: Hilton Chain <[email-masked]>
Date: Tue, 01 Apr 2025 23:25:22 +0800

Hi Tommy,

On Tue, 01 Apr 2025 16:33:36 +0800,
Tommy Langhelle wrote:
>
> Upstream sets this for CI purposes, but it fails my ARM builds. The
> limit itself doesn't make too much sense as long as zig builds and the
> build host is big enough, so simply allowing unlimited rss should be
> fine.

Can you share build log for your failed build?

> * gnu/packages/patches/zig-0.14-set-max_rss-to-unlimited-for-building-zig.patch: New file.
> * gnu/packages/zig.scm (zig-0.14)[source]: Add patch.
> * gnu/local.mk (dist_patch_DATA): Register it.
> ---
> [...]
> diff --git a/gnu/packages/patches/zig-0.14-set-max_rss-to-unlimited-for-building-zig.patch b/gnu/packages/patches/zig-0.14-set-max_rss-to-unlimited-for-building-zig.patch
> new file mode 100644
> index 0000000000..d944827353
> --- /dev/null
> +++ b/gnu/packages/patches/zig-0.14-set-max_rss-to-unlimited-for-building-zig.patch
> @@ -0,0 +1,31 @@
> +From 408722e084edf0a86066344e29bdfced70679129 Mon Sep 17 00:00:00 2001
> +From: Tommy Langhelle <[email-masked]>
> +Date: Mon, 31 Mar 2025 11:47:12 +0200
> +Subject: [PATCH] Set max_rss to unlimited for building zig
> +
> +https://github.com/ziglang/zig/issues/18263
> +
> +Upstream sets this for CI purposes, but it fails my ARM builds. The
> +limit itself doesn't make too much sense as long as zig builds and the
> +build host is big enough, so simply allowing unlimited rss should be
> +fine.
> +---
> + build.zig | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/build.zig b/build.zig
> +index 375cb6df09..16862fc5f9 100644
> +--- a/build.zig
> ++++ b/build.zig
> +@@ -703,7 +703,7 @@ fn addCompilerStep(b: *std.Build, options: AddCompilerStepOptions) *std.Build.St
> +
> +     const exe = b.addExecutable(.{
> +         .name = "zig",
> +-        .max_rss = 7_800_000_000,
> ++        .max_rss = 0,
> +         .root_module = compiler_mod,
> +     });
> +     exe.stack_size = stack_size;
> +--
> +2.41.0

For this change a snippet should be sufficient.  Can you turn this patch into a
snippet and send an updated revision?

Thanks