-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
treewide: systemdSupport: use lib.meta.availableOn #192197
Conversation
I don't think this is a good idea. Systemd is an init system, that's way removed from an intrinsic property of the platform. What we should instead have is something that works for any package, like systemdSupport ? systemd.meta.canBuild indeed, we used to have something like that. Not sure why it was removed. |
This comment was marked as resolved.
This comment was marked as resolved.
Ah, I see, you meant Please see latest push. In particular, it was necessary for 2daa429cc3205033a0ea7164aaff2a5117551fe7 to extend |
Squashed. |
Many packages have some kind of flag indicating whether or not to build with systemd support. Most of these default to `stdenv.isLinux`, but systemd does not build on (and is marked `broken` for) `isStatic`. Only a few packages have the needed `&& !isStatic` in the default value for their parameter. This commit moves the logic for the default value of these flags into `systemd.meta.{platforms,badPlatforms}` and evaluates those conditions using `lib.meta.availableOn`. This provides three benefits: 1. The default values are set correctly (i.e. including `&& isStatic`) 2. The default values are set consistently 3. The way is paved for any future non-Linux systemd platforms (FreeBSD is reported to have experimental systemd support)
Resolved merge conflict. |
Thanks for your patience, and sorry this took so long! |
…temd NixOS#192197 broke these packages by adding systemd as a dependency. This meant that the included package was no longer the python3 systemd package, but the general systemd derivation. This broke the packages at runtime. This PR fixes that.
Allowing functions in Can In any case I think the documentation for |
Yeah, and Nix's fragile function equality is not something we should expand our reliance upon. @sternenseemann has documented the full extent of how crazy it is, which goes way beyond just
Not trivially. But I do think it is possible and was thinking of attempting it. @ncfavier would you be willing to review the result? If it turns out to be possible, I will include a revert of b7d0974 in that PR. Handling |
Jesus. 🤯
Willing, sure. Capable, we'll see.
How about the stuff in |
Yes; in fact the predicate functions are generated from the patterns. Except for Mainly because it's the only part of a |
I don't like seeing this change and generally more often depending on |
…temd NixOS#192197 broke these packages by adding systemd as a dependency. This meant that the included package was no longer the python3 systemd package, but the general systemd derivation. This broke the packages at runtime. This PR fixes that.
I'm surprised to see |
Only
In a lazy language like Nix everything needs to be evaluated:
I think you meant to say something like "it's not metadata if you can't run The long-term fix is to fix |
It's a bit rough, but this could be the long-term fix: |
I'm worried about package options that look at |
Description of changes
Many packages have some kind of flag indicating whether or not to build with systemd support. Most of these default to
stdenv.isLinux
, but systemd does not build on (and is markedbroken
for)isStatic
. Only a few packages have the needed&& !isStatic
in the default value for their parameter.This PR moves the logic for the default value of these flags into
systemd.meta.{platforms,badPlatforms}
and evaluates those conditions usinglib.meta.availableOn
.This provides three benefits:
&& isStatic
)Things done