GNU bug report logs -
#77431
[PATCH] gnu: zig: Set rss_max to unlimited
Previous Next
Reported by: Tommy Langhelle <tomlanghe <at> gmail.com>
Date: Tue, 1 Apr 2025 14:00:15 UTC
Severity: normal
Tags: patch
Done: Hilton Chain <hako <at> ultrarare.space>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 77431 in the body.
You can then email your comments to 77431 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#77431
; Package
guix-patches
.
(Tue, 01 Apr 2025 14:00:16 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Tommy Langhelle <tomlanghe <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Tue, 01 Apr 2025 14:00:16 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
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.
* 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.
---
gnu/local.mk | 1 +
...ax_rss-to-unlimited-for-building-zig.patch | 31 +++++++++++++++++++
gnu/packages/zig.scm | 3 +-
3 files changed, 34 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/zig-0.14-set-max_rss-to-unlimited-for-building-zig.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index f03fcb14fc..63e87a232e 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -2473,6 +2473,7 @@ dist_patch_DATA = \
%D%/packages/patches/zig-0.14-fix-runpath.patch \
%D%/packages/patches/zig-0.14-use-baseline-cpu-by-default.patch \
%D%/packages/patches/zig-0.14-use-system-paths.patch \
+ %D%/packages/patches/zig-0.14-set-max_rss-to-unlimited-for-building-zig.patch \
%D%/packages/patches/zsh-egrep-failing-test.patch \
%D%/packages/patches/zuo-bin-sh.patch
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 <tomlanghe <at> gmail.com>
+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
+
diff --git a/gnu/packages/zig.scm b/gnu/packages/zig.scm
index 733251242e..eb7bda8c62 100644
--- a/gnu/packages/zig.scm
+++ b/gnu/packages/zig.scm
@@ -1871,7 +1871,8 @@ (define-public zig-0.14
(search-patches
"zig-0.14-use-baseline-cpu-by-default.patch"
"zig-0.14-use-system-paths.patch"
- "zig-0.14-fix-runpath.patch"))))
+ "zig-0.14-fix-runpath.patch"
+ "zig-0.14-set-max_rss-to-unlimited-for-building-zig.patch"))))
(inputs
(modify-inputs (package-inputs zig-0.13)
(replace "clang" clang-19)
base-commit: e7aeec67feaa5cf888f0aae14400fc015390aa8e
--
2.41.0
Information forwarded
to
guix-patches <at> gnu.org
:
bug#77431
; Package
guix-patches
.
(Tue, 01 Apr 2025 15:27:02 GMT)
Full text and
rfc822 format available.
Message #8 received at 77431 <at> debbugs.gnu.org (full text, mbox):
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 <tomlanghe <at> gmail.com>
> +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
Information forwarded
to
guix-patches <at> gnu.org
:
bug#77431
; Package
guix-patches
.
(Fri, 04 Apr 2025 12:35:02 GMT)
Full text and
rfc822 format available.
Message #11 received at 77431 <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Sure! Here is the relevant section of the log:
[ 73%] Running zig1.wasm to produce
/tmp/guix-build-zig-0.14.0.drv-0/source/zig2.c
[ 78%] Running zig1.wasm to produce
/tmp/guix-build-zig-0.14.0.drv-0/source/compiler_rt.c
/tmp/guix-build-zig-0.14.0.drv-0/source/zig1
/tmp/guix-build-zig-0.14.0.drv-0/source/lib build-exe -ofmt=c -lc
-OReleaseSmall --name zig2
-femit-bin="/tmp/guix-build-zig-0.14.0.drv-0/source/zig2.c" -target
aarch64-linux-gnu --dep build_options --dep aro -Mroot=src/main.zig
-Mbuild_options=/tmp/guix-build-zig-0.14.0.drv-0/source/config.zig
-Maro=lib/compiler/aro/aro.zig
/tmp/guix-build-zig-0.14.0.drv-0/source/zig1
/tmp/guix-build-zig-0.14.0.drv-0/source/lib build-obj -ofmt=c
-OReleaseSmall --name compiler_rt
-femit-bin="/tmp/guix-build-zig-0.14.0.drv-0/source/compiler_rt.c" -target
aarch64-linux-gnu -Mroot=lib/compiler_rt.zig
cd /tmp/guix-build-zig-0.14.0.drv-0/source &&
/gnu/store/1mjsh0bmxpr1ivvwagyjv0plk066b211-cmake-minimal-3.24.2/bin/cmake
-E cmake_depends "Unix Makefiles" /tmp/guix-build-zig-0.14.0.drv-0/source
/tmp/guix-build-zig-0.14.0.drv-0/source
/tmp/guix-build-zig-0.14.0.drv-0/source
/tmp/guix-build-zig-0.14.0.drv-0/source
/tmp/guix-build-zig-0.14.0.drv-0/source/CMakeFiles/zig2.dir/DependInfo.cmake
--color=
make[2]: Leaving directory '/tmp/guix-build-zig-0.14.0.drv-0/source'
make -f CMakeFiles/zig2.dir/build.make CMakeFiles/zig2.dir/build
make[2]: Entering directory '/tmp/guix-build-zig-0.14.0.drv-0/source'
[ 89%] Building C object CMakeFiles/zig2.dir/compiler_rt.c.o
[ 89%] Building C object CMakeFiles/zig2.dir/zig2.c.o
/gnu/store/zcvhj876402zaz3cd2j6s2k4y4fnzdf7-gcc-11.4.0/bin/gcc
-D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
-D__STDC_LIMIT_MACROS -I/tmp/guix-build-zig-0.14.0.drv-0/source/stage1 -O2
-g -DNDEBUG -std=c99 -O0 -fno-stack-protector -MD -MT
CMakeFiles/zig2.dir/zig2.c.o -MF CMakeFiles/zig2.dir/zig2.c.o.d -o
CMakeFiles/zig2.dir/zig2.c.o -c
/tmp/guix-build-zig-0.14.0.drv-0/source/zig2.c
/gnu/store/zcvhj876402zaz3cd2j6s2k4y4fnzdf7-gcc-11.4.0/bin/gcc
-D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS
-D__STDC_LIMIT_MACROS -I/tmp/guix-build-zig-0.14.0.drv-0/source/stage1 -O2
-g -DNDEBUG -std=c99 -O0 -fno-stack-protector -MD -MT
CMakeFiles/zig2.dir/compiler_rt.c.o -MF
CMakeFiles/zig2.dir/compiler_rt.c.o.d -o
CMakeFiles/zig2.dir/compiler_rt.c.o -c
/tmp/guix-build-zig-0.14.0.drv-0/source/compiler_rt.c
[ 94%] Linking CXX executable zig2
/gnu/store/1mjsh0bmxpr1ivvwagyjv0plk066b211-cmake-minimal-3.24.2/bin/cmake
-E cmake_link_script CMakeFiles/zig2.dir/link.txt --verbose=1
/gnu/store/zcvhj876402zaz3cd2j6s2k4y4fnzdf7-gcc-11.4.0/bin/c++ -O2 -g
-DNDEBUG -Wl,-z,stack-size=0x10000000 CMakeFiles/zig2.dir/zig2.c.o
CMakeFiles/zig2.dir/compiler_rt.c.o -o zig2 zigcpp/libzigcpp.a
/gnu/store/700f3b2d6m77xsxpp8dqjv2f4fif723z-clang-19.1.7/lib/libclang-cpp.so.19.1
/gnu/store/0ca4w71pz4dmfikzwb5j3qly3gbikjld-lld-19.1.7/lib/liblldMinGW.a
/gnu/store/0ca4w71pz4dmfikzwb5j3qly3gbikjld-lld-19.1.7/lib/liblldELF.a
/gnu/store/0ca4w71pz4dmfikzwb5j3qly3gbikjld-lld-19.1.7/lib/liblldCOFF.a
/gnu/store/0ca4w71pz4dmfikzwb5j3qly3gbikjld-lld-19.1.7/lib/liblldWasm.a
/gnu/store/0ca4w71pz4dmfikzwb5j3qly3gbikjld-lld-19.1.7/lib/liblldMachO.a
/gnu/store/0ca4w71pz4dmfikzwb5j3qly3gbikjld-lld-19.1.7/lib/liblldCommon.a
/gnu/store/rq7nyisff6cz7ysbrkcyfqnglzyzk1d8-llvm-19.1.7/lib/libLLVM-19.so
-lrt -ldl -lm -lz
make[2]: Leaving directory '/tmp/guix-build-zig-0.14.0.drv-0/source'
[ 94%] Built target zig2
make -f CMakeFiles/stage3.dir/build.make CMakeFiles/stage3.dir/depend
make[2]: Entering directory '/tmp/guix-build-zig-0.14.0.drv-0/source'
cd /tmp/guix-build-zig-0.14.0.drv-0/source &&
/gnu/store/1mjsh0bmxpr1ivvwagyjv0plk066b211-cmake-minimal-3.24.2/bin/cmake
-E cmake_depends "Unix Makefiles" /tmp/guix-build-zig-0.14.0.drv-0/source
/tmp/guix-build-zig-0.14.0.drv-0/source
/tmp/guix-build-zig-0.14.0.drv-0/source
/tmp/guix-build-zig-0.14.0.drv-0/source
/tmp/guix-build-zig-0.14.0.drv-0/source/CMakeFiles/stage3.dir/DependInfo.cmake
--color=
make[2]: Leaving directory '/tmp/guix-build-zig-0.14.0.drv-0/source'
make -f CMakeFiles/stage3.dir/build.make CMakeFiles/stage3.dir/build
make[2]: Entering directory '/tmp/guix-build-zig-0.14.0.drv-0/source'
[100%] Building stage3
/tmp/guix-build-zig-0.14.0.drv-0/source/zig2 build --prefix
/tmp/guix-build-zig-0.14.0.drv-0/source/stage3 --zig-lib-dir
/tmp/guix-build-zig-0.14.0.drv-0/source/lib -Dversion-string=0.14.0
-Dtarget=aarch64-linux-gnu -Dcpu=baseline -Denable-llvm
-Dconfig_h=/tmp/guix-build-zig-0.14.0.drv-0/source/config.h -Dno-langref
-Doptimize=ReleaseFast
install
+- install zig
+- zig build-exe zig ReleaseFast aarch64-linux-gnu failure
error: memory usage peaked at 8708960256 bytes, exceeding the declared
upper bound of 7800000000
Build Summary: 2/5 steps succeeded; 1 failed
install transitive failure
+- install zig transitive failure
+- zig build-exe zig ReleaseFast aarch64-linux-gnu failure
error: the following build command failed with exit code 1:
/tmp/zig-cache/o/ba585b8503da6c37d6ae47a94f10099d/build
/tmp/guix-build-zig-0.14.0.drv-0/source/zig2
/tmp/guix-build-zig-0.14.0.drv-0/source/lib
/tmp/guix-build-zig-0.14.0.drv-0/source /tmp/zig-cache /tmp/zig-cache
--seed 0x8ea5a1a -Zb5c4d8b9dc38645c --prefix
/tmp/guix-build-zig-0.14.0.drv-0/source/stage3 -Dversion-string=0.14.0
-Dtarget=aarch64-linux-gnu -Dcpu=baseline -Denable-llvm
-Dconfig_h=/tmp/guix-build-zig-0.14.0.drv-0/source/config.h -Dno-langref
-Doptimize=ReleaseFast
make[2]: *** [CMakeFiles/stage3.dir/build.make:76: stage3/bin/zig] Error 1
make[2]: Leaving directory '/tmp/guix-build-zig-0.14.0.drv-0/source'
make[1]: *** [CMakeFiles/Makefile2:199: CMakeFiles/stage3.dir/all] Error 2
make[1]: Leaving directory '/tmp/guix-build-zig-0.14.0.drv-0/source'
make: *** [Makefile:139: all] Error 2
error: in phase 'build': uncaught exception:
%exception #<&invoke-error program: "make" arguments: ("-j" "4")
exit-status: 2 term-signal: #f stop-signal: #f>
phase `build' failed after 1007.4 seconds
command "make" "-j" "4" failed with status 2
build process 6 exited with status 256
The critical output is this:
error: memory usage peaked at 8708960256 bytes, exceeding the declared
upper bound of 7800000000
I've got the full log if you want it, but this should be enough.
tir. 1. apr. 2025 kl. 17:25 skrev Hilton Chain <hako <at> ultrarare.space>:
> 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 <tomlanghe <at> gmail.com>
> > +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
>
[Message part 2 (text/html, inline)]
Information forwarded
to
guix-patches <at> gnu.org
:
bug#77431
; Package
guix-patches
.
(Fri, 04 Apr 2025 12:35:02 GMT)
Full text and
rfc822 format available.
Message #14 received at 77431 <at> debbugs.gnu.org (full text, mbox):
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.
* gnu/packages/zig.scm (zig-0.14)[source]: Set max_rss to unlimited.
---
gnu/packages/zig.scm | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/gnu/packages/zig.scm b/gnu/packages/zig.scm
index 733251242e..17c859ad70 100644
--- a/gnu/packages/zig.scm
+++ b/gnu/packages/zig.scm
@@ -1871,7 +1871,12 @@ (define-public zig-0.14
(search-patches
"zig-0.14-use-baseline-cpu-by-default.patch"
"zig-0.14-use-system-paths.patch"
- "zig-0.14-fix-runpath.patch"))))
+ "zig-0.14-fix-runpath.patch"))
+ (snippet
+ #~(begin
+ #$(origin-snippet (package-source zig-0.13))
+ (substitute* "build.zig"
+ ((".max_rss = [0-9_]+,") ".max_rss = 0,"))))))
(inputs
(modify-inputs (package-inputs zig-0.13)
(replace "clang" clang-19)
base-commit: e7aeec67feaa5cf888f0aae14400fc015390aa8e
--
2.41.0
Reply sent
to
Hilton Chain <hako <at> ultrarare.space>
:
You have taken responsibility.
(Sat, 05 Apr 2025 00:51:03 GMT)
Full text and
rfc822 format available.
Notification sent
to
Tommy Langhelle <tomlanghe <at> gmail.com>
:
bug acknowledged by developer.
(Sat, 05 Apr 2025 00:51:03 GMT)
Full text and
rfc822 format available.
Message #19 received at 77431-done <at> debbugs.gnu.org (full text, mbox):
On Fri, 04 Apr 2025 19:53:19 +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.
>
> * gnu/packages/zig.scm (zig-0.14)[source]: Set max_rss to unlimited.
> ---
> gnu/packages/zig.scm | 7 ++++++-
> 1 file changed, 6 insertions(+), 1 deletion(-)
Applied as f3a8c28f3f7b5daf95e11826b7cada713c8bfef3, thanks!
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Sat, 03 May 2025 11:24:12 GMT)
Full text and
rfc822 format available.
This bug report was last modified 49 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.