Skip to content

Commit 9355df5

Browse files
committed
Fix postgresql-musl: also break lib↔out reference cycle
Previous fix (eee10e3) broke the dev↔out cycle by stripping dev refs from both $out and $lib. Testing on hydra (standard Nix) revealed a second cycle: lib↔out. lib embeds out paths (share/locale references in libpq), and out links against lib. Strip out refs from lib since shared libraries don't need the binary directory at runtime.
1 parent eee10e3 commit 9355df5

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

flake.nix

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,15 +173,20 @@
173173
outputChecks = {};
174174
separateDebugInfo = false;
175175
disallowedReferences = [];
176-
# Break the dev↔out reference cycle: dev references out (via
177-
# .pc -L flags), and out references dev (via baked-in paths
178-
# in binaries/libs). Strip dev refs from both out and lib
179-
# outputs since neither needs dev at runtime.
176+
# Break multi-output reference cycles. Nix refuses to register
177+
# outputs that form cycles. The cycles are:
178+
# dev ↔ out: dev has .pc files referencing out; out has
179+
# baked-in dev paths from configure
180+
# lib ↔ out: lib has embedded out paths (share/locale refs
181+
# in libpq); out links against lib
182+
# Fix: strip dev refs from out+lib, strip out refs from lib.
183+
# out→lib is the only legitimate runtime dependency.
180184
postFixup = (old.postFixup or "") + ''
181185
find "$out" -name '*.la' -delete
182186
find "$out" -type f -exec remove-references-to -t "$dev" {} +
183187
find "$lib" -name '*.la' -delete
184188
find "$lib" -type f -exec remove-references-to -t "$dev" {} +
189+
find "$lib" -type f -exec remove-references-to -t "$out" {} +
185190
'';
186191
});
187192
});

0 commit comments

Comments
 (0)