Skip to content

Commit 685d555

Browse files
committed
postgresql musl: single output to work around Determinate Nix bug
Multi-output derivations on macOS (APFS) fail to register in the Nix DB — build completes but outputs remain orphaned. sync-before-registering = true did not fix this. Merging all outputs into "out" avoids the multi-output registration path. Consumers only need lib/ and pg_config.
1 parent 4b0b314 commit 685d555

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

flake.nix

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -162,20 +162,20 @@
162162
doCheck = false;
163163
outputChecks = {};
164164
separateDebugInfo = false;
165-
# generic.nix sets disallowedReferences = [ stdenv'.cc ] which
166-
# scans outputs for references to the C compiler AFTER all build
167-
# phases complete. For musl cross-compilation, .pc files or .la
168-
# files may retain references to the cross-compiler, causing a
169-
# silent post-fixup failure (all phases complete, no error in
170-
# build log, but build recorded as failed).
171165
disallowedReferences = [];
172-
# Force new drv hash to bypass hydra queue runner's persistent
173-
# failure cache. Previous builds succeeded but outputs were not
174-
# registered in the Nix DB (Determinate Nix orphaned store path
175-
# bug). Orphaned paths cleaned and sync-before-registering deployed.
176-
preBuild = (old.preBuild or "") + ''
177-
# cache breaker v2: sync-before-registering deployed 2026-02-17
178-
true
166+
# Merge all outputs into "out" to work around Determinate Nix
167+
# orphaned store path bug on macOS (APFS). Multi-output derivations
168+
# fail to register atomically in the Nix DB — the build completes
169+
# but outputs remain orphaned (exist on disk, not valid in DB).
170+
# sync-before-registering = true did not fix this. Single-output
171+
# avoids the multi-output registration path entirely. Consumers
172+
# (haskell.nix libpq) only need lib/ and bin/pg_config anyway.
173+
outputs = [ "out" ];
174+
# Replace the upstream postInstall which splits outputs and
175+
# removes pg_config from $out. We need everything in $out.
176+
postInstall = ''
177+
make -C src/common pg_config.env
178+
install -D src/common/pg_config.env "$out/nix-support/pg_config.env"
179179
'';
180180
});
181181
});

0 commit comments

Comments
 (0)