-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
postgresql: Make systemd support configurable #61581
postgresql: Make systemd support configurable #61581
Conversation
Based on the discussion in #61580, I'd restructure this all to look something like this: { version
, useSystemd ? true
...
}:
let
# systemd doesn't build with musl, and can't work on darwin
# see #61580 for information & discussion about musl support
systemdCompatibleEnv = !stdenv.isDarwin && !stdenv.hostPlatform.isMusl;
# only postgresql 9.6 and later support systemd notifications
systemdServerSupport = stdenv.lib.versionAtLeast "9.6" version;
# enable if asked, iff the prior conditions are met
shouldEnableSystemd = useSystemd && systemdCompatibleEnv && systemdServerSupport;
in
# ...
buildInputs = ... lib.optional shouldEnableSystemd [ systemd ] ... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(See prior notes)
And, actually: in this case, of adopting my suggested change from the last comment -- I probably would just not even include I wouldn't block this change if it was left in -- it's just that I don't think it's very useful at all, given the proposed change, and if we add it, we can't easily remove it later since someone might use it (even for odd or strange reasons), effectively locking us into supporting it. |
On by default, as was before. The systemd dependency means that all libraries or applications using only libpq will also pull systemd into their closures. Further, no application or library using libpq can be built against musl, as systemd relies on glibc-only features and thus does not build with musl. With it being configurable, packages that need only the library can at least turn it off to reduce their closure size.
c234313
to
549ad30
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't harm IMO.
@@ -6,6 +6,9 @@ let | |||
, glibc, zlib, readline, openssl, icu, systemd, libossp_uuid | |||
, pkgconfig, libxml2, tzdata | |||
|
|||
# This is important to obtain a version of `libpq` that does not depend on systemd. | |||
, enableSystemd ? (lib.versionAtLeast "9.6" version && !stdenv.isDarwin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe also add an assert that systemd can't be null when enableSystemd = true
. Though this is minor
This breaks systemd support for postgresql on master resulting in the systemd service being killed due to timeout because postgresql won't notify systemd, see this journal log:
|
Fixed on master (290cfc7). Note that even the NixOS tests for postgresql fail with the original change that was merged. Please run NixOS tests as part of PR reviews. |
See comments in NixOS#61581. versionAtLeast was called with arguments in the wrong order.
sorry, will do |
Motivation for this change
See #61580.
On by default, as was before. No evaluations should change.
The systemd dependency means that all libraries or applications using only libpq
will also pull systemd into their closures.
Further, no application or library using libpq can be built against musl, as
systemd relies on glibc-only features and thus does not build with musl.
With it being configurable, packages that need only the library can at
least turn it off to reduce their closure size.
Things done
sandbox
innix.conf
on non-NixOS)nix-shell -p nix-review --run "nix-review wip"
./result/bin/
)nix path-info -S
before and after)