From 3e9fc0661b811bd6227f3f3d1a5027415c7757af Mon Sep 17 00:00:00 2001 From: pancho horrillo Date: Wed, 8 Jul 2026 14:29:32 +0200 Subject: [PATCH] diun: fix env.CGO_ENABLED set to "" instead of 0 env.CGO_ENABLED should be either 1 or 0, not a boolean. If set to false, it is then rendered as an empty string, which can be verified by running $ nix derivation show nixpkgs#diun | jq '.derivations[].env | {CGO_ENABLED}' { "CGO_ENABLED": "" } Also, the executable is, in fact, a dynamic one: $ nix shell nixpkgs#diun $ which diun /nix/store/q8mc73sp6nz113m7ggb2m10r4brak82y-diun-4.33.0/bin/diun $ ldd $(which diun) linux-vdso.so.1 (0x000076b5e6e4e000) libresolv.so.2 => /nix/store/8kvxvr3pmsypxiypq4g8zy13glnfr7nx-glibc-2.42-67/lib/libresolv.so.2 (0x000076b5e6e33000) libpthread.so.0 => /nix/store/8kvxvr3pmsypxiypq4g8zy13glnfr7nx-glibc-2.42-67/lib/libpthread.so.0 (0x000076b5e6e2e000) libc.so.6 => /nix/store/8kvxvr3pmsypxiypq4g8zy13glnfr7nx-glibc-2.42-67/lib/libc.so.6 (0x000076b5e6c00000) /nix/store/8kvxvr3pmsypxiypq4g8zy13glnfr7nx-glibc-2.42-67/lib/ld-linux-x86-64.so.2 => /nix/store/8kvxvr3pmsypxiypq4g8zy13glnfr7nx-glibc-2.42-67/lib64/ld-linux-x86-64.so.2 (0x000076b5e6e50000) After setting it to 0, $ nix derivation show .#diun | jq '.derivations[].env | {CGO_ENABLED}' { "CGO_ENABLED": "0" } and the executable: $ ldd $(which diun) not a dynamic executable which is the intended effect. --- pkgs/by-name/di/diun/package.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/by-name/di/diun/package.nix b/pkgs/by-name/di/diun/package.nix index 29fa92935ccc..baa92a0cc4e2 100644 --- a/pkgs/by-name/di/diun/package.nix +++ b/pkgs/by-name/di/diun/package.nix @@ -19,7 +19,7 @@ buildGoModule (finalAttrs: { # upstream disable CGO in release build # https://github.com/crazy-max/diun/blob/76c0fe99212adc58d6a3433bbcde1ffa9fb879c4/Dockerfile#L11 - env.CGO_ENABLED = false; + env.CGO_ENABLED = 0; ldflags = [ "-s"