Hi all. I’ve encountered “Error 2” while building a custom kernel remotely. My device requires a specific custom kernel from nixos-hardware, and it needs to compile the kernel every time there’s a kernel update. I’ve set up a remote builder on another system running arch. My full configuration can be seen here.
The compilation works fine locally but it takes a very long time. Compiling remotely triggers an “Error 2” failure about 20 minutes into the build every time.
The last couple of lines of the log looks like this:
CC [M] drivers/gpu/drm/amd/amdgpu/../display/modules/hdcp/hdcp_ddc.o
CC [M] drivers/gpu/drm/amd/amdgpu/../display/modules/hdcp/hdcp_log.o
CC [M] drivers/gpu/drm/amd/amdgpu/../display/modules/hdcp/hdcp_psp.o
CC [M] drivers/gpu/drm/amd/amdgpu/../display/modules/hdcp/hdcp.o
CC [M] drivers/gpu/drm/amd/amdgpu/../display/modules/hdcp/hdcp1_execution.o
CC [M] drivers/gpu/drm/amd/amdgpu/../display/modules/hdcp/hdcp1_transition.o
CC [M] drivers/gpu/drm/amd/amdgpu/../display/modules/hdcp/hdcp2_execution.o
CC [M] drivers/gpu/drm/amd/amdgpu/../display/modules/hdcp/hdcp2_transition.o
CC [M] drivers/gpu/drm/amd/amdgpu/amdgpu_isp.o
CC [M] drivers/gpu/drm/amd/amdgpu/isp_v4_1_0.o
CC [M] drivers/gpu/drm/amd/amdgpu/isp_v4_1_1.o
LD [M] drivers/gpu/drm/amd/amdgpu/amdgpu.o
AR drivers/gpu/built-in.a
AR drivers/built-in.a
make[1]: *** [/build/linux-6.12.19/Makefile:1944: .] Error 2
make: *** [../Makefile:224: __sub-make] Error 2
Can anyone please help me troubleshoot this? Thank you.
I think the true error is probably higher up in the log. There should be a line saying builder for '/nix/store/.....-linux-$version.drv' failed. You can use nix-store --read-log or nix log on that .drv path to show the full log and see what failed higher up.
EDIT: I was able to build that kernel fine. So I’m guessing the builder is running out of memory and you need to reduce its cores setting?
Thank you for testing it. I was able to build the kernel too locally and it only fails when building remotely. I’ve tried setting the core (which defaults to 16) on the builder to 1, 2, 4, and 8, and it always fails with the same error message. I’ve also been closely monitoring the resource utilization, and there’s always at least 10GB of available ram at the time of failure. Is it possible that the error is not memory related? Are there any other factors that may be causing it?
Looks like github’s web UI is truncating the file, but the full file can be viewed in raw mode.
I have no idea why it’s using busybox. I have a pretty simple setup with just one configuration.nix and one flake.nix. Busybox is not in my config.
I can’t reproduce the error, even if I build directly from your flake. Does the builder have sandboxing disabled? Maybe that’s where it’s getting busybox from?
I found out that busybox came from a package called nix-busybox which is a requirement for the nix package manager on arch.
I have never explicitly configured sandbox on the builder. I just enabled sandbox on both the nixos system and the builder, then I got the exact same error message (full log). Busybox still appears in this log.
That’s not how you debug make logs (or most build systems). You have to look further up to find the errors.
In this case it’s lines 16692 to 16772:
/build/cc9HKvOR.s: Assembler messages:
/build/cc9HKvOR.s:136: Error: selected processor does not support `aese v19.16b,v21.16b'
/build/cc9HKvOR.s:137: Error: selected processor does not support `aesmc v19.16b,v19.16b'
...
Usually the easiest way to find the actual error is to search for some string like error: (applies to many build systems) or waiting for unfinished jobs (in multithreaded builds, and specific to make).