-
-
Notifications
You must be signed in to change notification settings - Fork 14.3k
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
makeOverridable forces its original attrset rendering assert+override unusable #53487
Comments
Oh well, lighttpd is no supported on Darwin anyway :(. |
@kirelagin
This seems to prove that the I tried to tweak the implementation of Another way would be to get rid of the asserts that are now polluting the nixpkgs. For example I was always puzzled by these:
Is it really a concern that someone will accidentally evaluate this in a context where cups = null and that will cause a subtle failure?
The asserts stand in the way of naively evaluating nixpkgs and this complicates a lot of the introspection that can be done. Those few that actually implement some more sensible constraints can be implemented via |
Well, see #36229 |
@veprbl Hmmm, yes, I think, you are right. |
Yea, attrsets are strict in the keys, lazy in the values. So it must call the function to determine what keys will be present before it can add any keys like |
Lazy attribute names support discussed here NixOS/nix#4090 |
makeOverridable
is not being lazy enough and forces a call to the function with the original set of arguments before adding the.override
attr. This behaviour rendersassert feature -> dep != null
(which is a common pattern innixpkgs
) somewhat useless: it is impossible to disable a feature whose dependency is missing with an.override
as the original assert will trigger in any case.I discovered this trying to install
lighttpd
(which doesassert enableWebDAV -> libuuid != null
) on darwin, but it won’t let me unsetenableWebDAV
or even overridelibuuid
with some implementation.AFAICT, @edolstra’s original
makeOverridable
made.override
available before forcing anything, which is what I would expect, but this was changed in 9e4202d (@urkud) so that it can work on functions.P.S. To be honest, I am not sure that my analysis is correct, as this change is 8.5 (😮) years old and, apparently, no one noticed, which seems unlikely, but 🤷♂️. I’m not sure if there is any policy in place that says that all dep+feature asserts should evaluate to
true
by default, but if there is one, then it is probably what helps here, but then thelighttpd
expression violates it (#40623, @rkoe, @xeji).(FYI @shlevy @ElvishJerricco as I saw you work on
makeOverridable
)The text was updated successfully, but these errors were encountered: