From b200ae73ec2e3435b569cae82a5af7c4be6ba0e5 Mon Sep 17 00:00:00 2001 From: Aliaksandr Date: Fri, 22 May 2026 05:42:13 +0300 Subject: [PATCH] minimal-bootstrap: trim gawk-static output Disable optional gawk features not used by the bootstrap path and prune installed helper files, headers, libraries, documentation, locale data, and awk library scripts. The smoke test now covers a simple awk program, not only --version. Size impact against upstream/staging: - gawk-static closure: 6.001 MiB -> 1.549 MiB (-4.453 MiB) Assisted-by: codex with gpt-5.5-high --- pkgs/os-specific/linux/minimal-bootstrap/gawk/static.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/os-specific/linux/minimal-bootstrap/gawk/static.nix b/pkgs/os-specific/linux/minimal-bootstrap/gawk/static.nix index 2abe73c2aa0c..c6175308d59d 100644 --- a/pkgs/os-specific/linux/minimal-bootstrap/gawk/static.nix +++ b/pkgs/os-specific/linux/minimal-bootstrap/gawk/static.nix @@ -48,6 +48,7 @@ bash.runCommand "${pname}-${version}" result: bash.runCommand "${pname}-get-version-${version}" { } '' ${result}/bin/awk --version + ${result}/bin/awk 'BEGIN { if (2 + 2 != 4) exit 1 }' mkdir $out ''; } @@ -62,6 +63,10 @@ bash.runCommand "${pname}-${version}" --build=${buildPlatform.config} \ --host=${hostPlatform.config} \ --disable-dependency-tracking \ + --disable-extensions \ + --disable-mpfr \ + --disable-nls \ + --disable-pma \ CC=musl-gcc \ CFLAGS=-static @@ -71,4 +76,6 @@ bash.runCommand "${pname}-${version}" # Install make -j $NIX_BUILD_CORES install-strip rm $out/bin/gawkbug + rm -rf $out/etc $out/include $out/lib $out/libexec + rm -rf $out/share ''