Open srghma opened 5 years ago
ok, I found, it threw because postgres wasnt in $PATH
e.g. it fails with this $PATH
PATH =
let
env = pkgs.buildEnv {
name = "system-path";
paths = with pkgs; [
perlPackages.TAPParserSourceHandlerpgTAP # pg_prove
];
};
in "${env}/bin:/bin:/run/system/bin";
but it doesn't fail with this $PATH
PATH =
let
env = pkgs.buildEnv {
name = "system-path";
paths = with pkgs; [
postgresql
perlPackages.TAPParserSourceHandlerpgTAP # pg_prove
];
};
in "${env}/bin:/bin:/run/system/bin";
I'm fine with this behavior because it allows to execute pg_prove with different postgres versions in path
actually I'm not sure about my desition. Is it better to:
{ stdenv, postgresql, perlPackages, makeWrapper, lib }:
# pgql is required to be in $PATH (https://github.com/NixOS/nixpkgs/issues/55663)
stdenv.mkDerivation rec {
name = "pg_prove";
nativeBuildInputs = [ makeWrapper ];
phases = [ "installPhase" ];
installPhase = ''
mkdir -p $out/bin
makeWrapper ${perlPackages.TAPParserSourceHandlerpgTAP}/bin/pg_prove $out/bin/pg_prove \
--prefix PATH : ${lib.makeBinPath [ postgresql ]}
makeWrapper ${perlPackages.TAPParserSourceHandlerpgTAP}/bin/pg_tapgen $out/bin/pg_tapgen \
--prefix PATH : ${lib.makeBinPath [ postgresql ]}
'';
}
OR
perlPackages.TAPParserSourceHandlerpgTAP.override {
postgres = postgres10;
};
Thank you for your contributions.
This has been automatically marked as stale because it has had no activity for 180 days.
If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.
Here are suggestions that might help resolve this more quickly:
Issue description
Steps to reproduce
Technical details
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the results.