Skip to content

Commit 19a1e56

Browse files
committed
chore: improve reproducibility of postgresql builds
Do not create postgresql package that depends on the runtime evaluation context as that harms reproducibility.
1 parent 840005b commit 19a1e56

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

nix/postgresql/generic.nix

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ let
2121
libxml2,
2222
tzdata,
2323
libkrb5,
24-
substituteAll,
2524
darwin,
2625
linux-pam,
2726
#orioledb specific
@@ -187,11 +186,7 @@ let
187186
./patches/paths-for-split-outputs.patch
188187
./patches/specify_pkglibdir_at_runtime.patch
189188
./patches/paths-with-postgresql-suffix.patch
190-
191-
(substituteAll {
192-
src = ./patches/locale-binary-path.patch;
193-
locale = "${if stdenv.isDarwin then darwin.adv_cmds else lib.getBin stdenv.cc.libc}/bin/locale";
194-
})
189+
./patches/locale-binary-path.patch
195190
]
196191
++ lib.optionals stdenv'.hostPlatform.isMusl (
197192
# Using fetchurl instead of fetchpatch on purpose: https://github.com/NixOS/nixpkgs/issues/240141
@@ -207,6 +202,9 @@ let
207202
''
208203
# Hardcode the path to pgxs so pg_config returns the path in $out
209204
substituteInPlace "src/common/config_info.c" --subst-var out
205+
substituteInPlace "src/backend/commands/collationcmds.c" --replace-fail '@locale@' '${
206+
if stdenv.isDarwin then darwin.adv_cmds else lib.getBin stdenv.cc.libc
207+
}/bin/locale'
210208
''
211209
+ lib.optionalString jitSupport ''
212210
# Force lookup of jit stuff in $out instead of $lib

0 commit comments

Comments
 (0)