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

Document .override (old: ...) #66546

Open
nh2 opened this issue Aug 13, 2019 · 7 comments
Open

Document .override (old: ...) #66546

nh2 opened this issue Aug 13, 2019 · 7 comments
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 9.needs: documentation

Comments

@nh2
Copy link
Contributor

nh2 commented Aug 13, 2019

.override for packages has 2 forms: .override {} and .override (old: {}).

These aren't properly documented in the nixpkgs manual, especially not the latter.

I think it's extra important to document what old contains in this case, because it has supriring behaviour:

It lacks e.g. defaulted boolean (enableX ? true) flags.

For example for curl,

, zlibSupport ? true, zlib ? null

When you use curl.override (old: builtins.trace old.zlibSupport ...) it complains that zlibSupport does not exist on old. However old.zlib exists.

I suspect that what's happening is that only those things are in old that were passed from outside, and that ? defaultvalue arguments are not in there.

This badly surprised me here and probably also @oxij here.

We should document how it works, and recommend how to handle such cases (e.g. using old.enableX or true if the default value in the package is ? true), or "fix" the fact that default values are not present.

@oxij
Copy link
Member

oxij commented Aug 13, 2019 via email

@nh2
Copy link
Contributor Author

nh2 commented Aug 13, 2019

Alternatively, we can fix it to do the unsurprising thing

👍 @oxij I'm not familiar enough with this to judge your fix, do you want to post it as a PR to get proper scrutiny, and perhaps some contributed fixes for the Haskell infra?

@stale
Copy link

stale bot commented Jun 2, 2020

Thank you for your contributions.

This has been automatically marked as stale because it has had no activity for 180 days.

If this is still important to you, we ask that you leave a comment below. Your comment can be as simple as "still important to me". This lets people see that at least one person still cares about this. Someone will have to do this at most twice a year if there is no other activity.

Here are suggestions that might help resolve this more quickly:

  1. Search for maintainers and people that previously touched the related code and @ mention them in a comment.
  2. Ask on the NixOS Discourse.
  3. Ask on the #nixos channel on irc.freenode.net.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 2, 2020
@nh2
Copy link
Contributor Author

nh2 commented Jun 2, 2020

still important to me

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 2, 2020
@stale
Copy link

stale bot commented Nov 29, 2020

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 29, 2020
@nh2
Copy link
Contributor Author

nh2 commented Nov 29, 2020

still important to me

@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 29, 2020
@stale
Copy link

stale bot commented Jun 3, 2021

I marked this as stale due to inactivity. → More info

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Jun 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md 9.needs: documentation
Projects
None yet
Development

No branches or pull requests

2 participants