Skip to content

Commit f8ce434

Browse files
committed
Fix postgresql musl: disable pythonSupport/tclSupport to reduce outputs
The postgresql build for musl cross-compilation was producing 7 outputs (out, dev, doc, lib, man, plpython3, pltcl) because pythonSupport and tclSupport default to true when !isStatic && canExecute. Since pkgsCross.musl64 doesn't set isStatic=true, these were enabled. Each extra output widens the nix-copy window between build completion and output transfer, exacerbating the min-free GC race on darwin builders where outputs vanish before they can be copied to hydra. Reducing from 7 to 5 outputs (removing plpython3 and pltcl) should help. These PL extensions are unnecessary for musl cross-builds anyway.
1 parent c62060b commit f8ce434

File tree

2 files changed

+26
-18
lines changed

2 files changed

+26
-18
lines changed

CLAUDE.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,14 @@ pkgs.runCommand "devx" {} ''
6868
- **Jobset:** input-output-hk-devx:pullrequest-220
6969
- **URL:** https://ci.zw3rk.com/jobset/input-output-hk-devx/pullrequest-220
7070

71-
### Latest Update (2026-02-13)
71+
### Latest Update (2026-02-14)
7272

73-
**Eval 384** (commit 02fd4d4): 563/643 succeeded, 75 failed, 5 building.
74-
Root causes: gcc-14.3.0 (34, infra), postgresql-musl (31), hadrian (10 cached).
75-
nghttp3, libev, tzdata ALL FIXED in this eval.
73+
**Eval 389** (commit c62060b): 568/643 succeeded, 59 dep-failed, 16 building.
74+
Root causes: postgresql-musl GC race (both arches), GCC-14.3.0 (infra), hadrian (stale cache).
75+
All code-level build failures (nghttp3, libev, tzdata, openssl, postgresql LTO) are FIXED.
7676

77-
**Latest commit** ca89062 — disables LTO for postgresql (fixes .ltrans link failure).
77+
**Latest commit** (pending push) — disables pythonSupport/tclSupport for postgresql musl,
78+
reducing outputs from 7 (out,dev,doc,lib,man,plpython3,pltcl) to 5 (out,dev,doc,lib,man).
7879

7980
**Summary of all fixes applied (in overlay order):**
8081
1. **happy disallowGhcReference** (build-fixes): Disable GHC reference check for
@@ -90,22 +91,28 @@ nghttp3, libev, tzdata ALL FIXED in this eval.
9091
6. **PostgreSQL musl** (musl overlay): Multiple issues fixed:
9192
- `jitSupport = false`: removes --with-llvm and LLVM build inputs
9293
- `perlSupport = false`: musl perl lacks shared libperl
93-
- `hardeningDisable = ["lto"]`: GCC LTO + GNU ld is broken for postgresql
94-
(undefined refs in .ltrans); the nixpkgs stdenv switch to LLVM bintools
95-
exists specifically for ld.lld, just disable LTO instead
94+
- `pythonSupport = false`: removes plpython3 output (unnecessary for musl cross)
95+
- `tclSupport = false`: removes pltcl output (unnecessary for musl cross)
96+
- `NIX_CFLAGS_COMPILE = "-fno-lto"`: GCC LTO + GNU ld is broken for postgresql
97+
(.ltrans link failures). Can't use hardeningDisable=["lto"] because "lto" is
98+
not a recognized hardening flag on musl cross stdenv.
99+
- `llvmPackages_20` override to prevent LLVM stdenv switch (avoids LLVM dep)
96100
- `outputChecks = {}`: removes unconditional LLVM disallowedRequisites refs
97101
- `doCheck = false`: dict_snowball.so relocation fails in musl static
102+
- `separateDebugInfo = false`: eliminates massive -debug output that causes
103+
nix-copy transfer to race against builder min-free auto-GC
98104

99105
**Remaining infra issues:**
100106
- **GCC 14.3.0** (34 Windows builds): `/usr/include` missing — darwin builders
101107
claim x86_64-linux support but GCC's fixincludes expects real Linux host.
102108
Fix: infra change to builder system type config, not a devx overlay.
103-
- **hadrian** (10 builds): stale failure cache despite outputs existing in store.
104-
Queue runner keeps re-caching. May need investigation of cache mechanism.
109+
- **hadrian**: stale failure cache despite outputs existing in store.
110+
Queue runner keeps re-caching after restart.
105111

106112
**Key discovery:** nixpkgs-2511 `pkgsCross.musl64` doesn't set `isStatic = true`.
107113
This causes ALL optional features guarded by `!isStatic` to default to true,
108-
including jitSupport, perlSupport, and the LTO stdenv switch in postgresql.
114+
including jitSupport, perlSupport, pythonSupport, tclSupport, and the
115+
LTO stdenv switch in postgresql.
109116

110117
The -env job generation using `devShellTools` is working correctly.
111118

flake.nix

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,23 @@
130130
#
131131
# 1. jitSupport defaults true → pulls in LLVM build inputs.
132132
# 2. perlSupport defaults true → musl perl lacks shared libperl.
133-
# 3. generic.nix switches to LLVM stdenv+bintools for LTO when
133+
# 3. pythonSupport/tclSupport default true → adds plpython3/pltcl
134+
# outputs. These are unnecessary for musl cross-builds and
135+
# each extra output widens the nix-copy window, exacerbating
136+
# the min-free GC race on darwin builders.
137+
# 4. generic.nix switches to LLVM stdenv+bintools for LTO when
134138
# GCC is used. Cross-compiled LLVM 20 OOMs on darwin builders.
135139
# We override llvmPackages_20 to prevent the switch (avoids
136140
# LLVM dependency), then explicitly disable LTO with -fno-lto
137141
# since GCC LTO + GNU ld is broken for postgresql (.ltrans
138142
# link failures). Can't use hardeningDisable=["lto"] because
139143
# "lto" is not a recognized hardening flag on musl cross.
140-
# 4. outputChecks unconditionally reference llvmPackages.llvm.
144+
# 5. outputChecks unconditionally reference llvmPackages.llvm.
141145
postgresql = (prev.postgresql.override {
142146
jitSupport = false;
143147
perlSupport = false;
148+
pythonSupport = false;
149+
tclSupport = false;
144150
# Prevent the LTO stdenv switch: provide normal GCC-based
145151
# musl stdenv as llvmPackages_20, making the switch a no-op.
146152
llvmPackages_20 = prev.llvmPackages_20 // {
@@ -155,11 +161,6 @@
155161
};
156162
doCheck = false;
157163
outputChecks = {};
158-
# Disable separateDebugInfo to avoid massive -debug output
159-
# with hundreds of symlinks. The debug output size causes
160-
# nix-copy transfers to take too long, racing against the
161-
# builder's min-free auto-GC which deletes the outputs
162-
# before they can be transferred to the hydra machine.
163164
separateDebugInfo = false;
164165
});
165166
});

0 commit comments

Comments
 (0)