From 027c3c99a91c4d54a216bd39ed1a291185a46f02 Mon Sep 17 00:00:00 2001 From: Jared Baur Date: Tue, 2 Dec 2025 08:58:12 -0800 Subject: [PATCH] coredns: fix cross For some reason, go generate attempts to pull in the C compiler available in the environment. Setting CC to empty fixes the build when cross-compiling, since running the intermediate executables `go generate` creates would not work when using a C compiler build for the wrong architecture. --- pkgs/by-name/co/coredns/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/co/coredns/package.nix b/pkgs/by-name/co/coredns/package.nix index fe8733125926..449c0ee660d8 100644 --- a/pkgs/by-name/co/coredns/package.nix +++ b/pkgs/by-name/co/coredns/package.nix @@ -76,7 +76,7 @@ buildGoModule (finalAttrs: { } diff -u plugin.cfg.orig plugin.cfg || true for src in ${toString (attrsToSources externalPlugins)}; do go get $src; done - GOOS= GOARCH= go generate + CC= GOOS= GOARCH= go generate go mod tidy go mod vendor ''; @@ -90,7 +90,7 @@ buildGoModule (finalAttrs: { chmod -R u+w vendor mv -t . vendor/go.{mod,sum} vendor/plugin.cfg - GOOS= GOARCH= go generate + CC= GOOS= GOARCH= go generate ''; postPatch = ''