Skip to content

Postgresql extraPlugins require /bin dir to exist in extension directory #22653

@spinus

Description

@spinus

Issue description

I was packaging pgjwt postgresql extension and found small issue. When packaged extension don't have a /bin directory, buildEnv function which builds new environment for postgresql-with-plugins fails due to rm permission issues.

It looks like buildEnv calculate output based on /bin directories, when postgresql extension does not have /bin, buildEnv uses "old" postgresql-with-plugins derivation, but in the built script, there is rm command to remove "/bin/*" and copy files again. rm fails because /nix/store doesn't allow it to write/delete anything in already built derivation.

Attached pull request with "patched" extension:
#22644

Steps to reproduce

Add this to nixos configuration and rebuild:

service.postgresql.enabled=true;
service.postgresql.extraPlugins = [X];
# where X is any derivation without a /bin directory

Technical details

  • System: (NixOS: 17.03pre99626.f1ba2c8)
  • Nix version: nix-env (Nix) 1.11.6
  • Nixpkgs version: 17.03pre100479.f7b7d8

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions