Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

haskellPackages.tmp-postgres: Add pginit dependency #32324

Merged
merged 1 commit into from Dec 6, 2017

Conversation

rvl
Copy link
Contributor

@rvl rvl commented Dec 4, 2017

Motivation for this change

Want to use this package but it didn't pass tests due to missing programs.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@@ -984,4 +984,9 @@ self: super: {
};
}).override { language-c = self.language-c_0_7_0; };

# Needs pginit to function and pgrep to verify.
tmp-postgres = overrideCabal super.tmp-postgres (drv: {
libraryToolDepends = [pkgs.postgresql];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably not safe to just replace the current value of these attribute with these new ones. Instead, these newbuild tools should be added to the existing lists, if there are any, to make sure that these overrides still work even if upstream changes the definitions in a new version. For example:

testToolDepends = drv.testToolDepends or [] ++ [pkgs.procps];

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good idea, have fixed it.

@rvl
Copy link
Contributor Author

rvl commented Dec 6, 2017

@peti Do you know some way I can propagate the pginit program (necessary for this library to function) onto the PATH of a nix-shell? Basically, it would be nicer for users if the following program were to work without adding -p postgresql to the command line:

#! /usr/bin/env nix-shell
#! nix-shell -i runghc --pure -p "pkgs.haskellPackages.ghcWithPackages (h: [h.tmp-postgres])"
import Database.Postgres.Temp
import Control.Exception
main = startAndLogToTmp [] >>= either throwIO (putStrLn . connectionString)

@peti peti merged commit fb16604 into NixOS:master Dec 6, 2017
@peti
Copy link
Member

peti commented Dec 6, 2017

Do you know some way I can propagate the pginit program (necessary for this library to function) onto the PATH of a nix-shell?

I don't think there's an easy way to accomplish that. The proper solution for this problem is for tmp-postgres to compile the full path to pginit into it's code rather than relying on $PATH.

@rvl
Copy link
Contributor Author

rvl commented Dec 6, 2017

Thanks, yes that makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants