From faee3dd46cf1c2b40b3a3c043d8575b8b0858838 Mon Sep 17 00:00:00 2001 From: Brian McGillion Date: Tue, 25 Nov 2025 09:23:41 +0400 Subject: [PATCH] containerd: Fix pkgsCross build failure Fixes: #464806 pkgsCross.aarch64-multiplatform.containerd is failing dure to missing dependencies caused by static make flags. Signed-off-by: Brian McGillion --- pkgs/by-name/co/containerd/package.nix | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pkgs/by-name/co/containerd/package.nix b/pkgs/by-name/co/containerd/package.nix index 178b7c51a741..841963e19876 100644 --- a/pkgs/by-name/co/containerd/package.nix +++ b/pkgs/by-name/co/containerd/package.nix @@ -31,7 +31,15 @@ buildGoModule rec { hash = "sha256-LXBGA03FTrrbxlH+DxPBFtp3/AYQf096YE2rpe6A+WM="; }; - postPatch = "patchShebangs ."; + postPatch = '' + patchShebangs . + '' + + lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' + # When cross-compiling with CGO_ENABLED=0, we can't use -extldflags "-static" + # Remove it from SHIM_GO_LDFLAGS to avoid linking errors + substituteInPlace Makefile \ + --replace-fail '-extldflags "-static"' "" + ''; vendorHash = null;