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

all-packages.nix: cleanup, remove res. (next stage super) #56119

Closed
wants to merge 2 commits into from

Conversation

oxij
Copy link
Member

@oxij oxij commented Feb 21, 2019

What? Why?

#55061, but with tests still evaluating, as far as I can see.

git log

  • libxml2Python: move from all-packages.nix

  • all-packages.nix: kill all noop uses of res

nix-instantiate environment

  • Host OS: Linux 4.9, SLNOS 19.03
  • Nix: nix-env (Nix) 2.1.3
  • Multi-user: yes
  • Sandbox: yes
  • NIXPKGS_CONFIG:
{
  checkMeta = true;
  doCheckByDefault = true;
}

nix-env -qaP diffs

  • On x86_64-linux: noop
  • On aarch64-linux: noop
  • On x86_64-darwin: noop

/cc @Ericson2314 @danbst @infinisil from #55061

@@ -4823,27 +4823,29 @@ in

phodav = callPackage ../tools/networking/phodav { };

pinentry = callPackage ../tools/security/pinentry {
pinentry-real = callPackage ../tools/security/pinentry {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for doing this? I'd prefer to not introduce any new names like pinentry-real.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #55061 (comment) and above discussion.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess I'd rather have res. than have to deal with the -real derivations. You could also fix the no-x-libs.nix thing by just overriding like:

pinentry = super.pinentry.override {
  gtk2 = null;
}

in no-x-libs.nix

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i suppose this isn't so bad for now. Could you call it pinentry_gtk2 to a be a little more descriptive?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What worries me though is having to have a "real" version for every package with an override. That looks like it is needed for the a = a_<flavor>; type overrides to work.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been replaced by a multiple outputs on a single derivation. While that's horrible for derivation closure size and rebuilds, it makes this discussion irrelevant for now.

@danbst
Copy link
Contributor

danbst commented Feb 21, 2019

The problem is not with just removing res, but with overrides in general. I've described an example at #55061 (comment), which this PR doesn't touch at all (but problem exists!)

I imagine another solution (at least for pinentry case):

inherit (rec {
  pinentry = callPackage ../tools/security/pinentry {
    libcap = if stdenv.isDarwin then null else libcap;
  };
  pinentry_ncurses = pinentry.override {
    gtk2 = null;
  };

  pinentry_emacs = pinentry.override {
    enableEmacs = true;
  };

  pinentry_gnome = pinentry.override {
    inherit gcr;
  };

  pinentry_qt4 = pinentry.override {
    qt = qt4;
  };

  pinentry_qt5 = pinentry.override {
    qt = qt5.qtbase;
  };  
})
  pinentry
  pinentry_ncurses
  pinentry_emacs
  pinentry_gnome
  pinentry_qt4
  pinentry_qt5
;

In that case there will be no common ancestor, so overrides will behave better (for a while). It is also slightly more verbose, to discourage such pattern use in all-packages.nix.

The changes, which don't use override are fine IMO.

@Ericson2314
Copy link
Member

@matthewbauer I don't like res because it's such a global solution to a local problem: nothing else that doesn't need it should be confused by some big extra fix point.

I don't think super will work because the tests would add an overlay after, and pinentry is defined in the same overlay as the super reference so the super will be resolved by "looping back around" to hit the final self. (I'm not totally sure I got this right though.)

The *-real style solution is nice because while it does leak a new name, this allow overriding all at once, which is nice if one wants do a non-variant-specific change. I suggested the "real" suffix because I thought of pinentry as a metapackage like libc vs glibc. But since there's only one pinentry, but many configuration options, something like pinentryBase might be better.

If we don't care about overriding all at once, then @danbst's is the best solution of all as it's truely local. Great idea @danbst!!

@matthewbauer
Copy link
Member

matthewbauer commented Feb 21, 2019

I don't like res because it's such a global solution to a local problem: nothing else that doesn't need it should be confused by some big extra fix point.

It doesn't sound that local to me. It sounds like anything using an override (or even aliases) within all-packages.nix could run into this problem. @danbst would work okay, but this would be a lot of recs introduced to support all of the override cases.

My ideal solution would be to move all of these overrides to pkgs/top-level/overrides.nix and make that a proper overlay. I had a PR to do this but I can't find it right now (and it's probably out of date). I think there were some objections to that though. res is basically doing the same thing for us though.

Otherwise, maybe we should just move back to using callPackage multiple times? I prefer using override because it makes it more clear what the "true" package is but we don't want to have this kind of thing broken...

@Ericson2314
Copy link
Member

Err my local I meant each instance of the problem, i.e. only the other pinentries need to worry about the base one, be it be given its own name or thrown away as a temporary.

@oxij
Copy link
Member Author

oxij commented Feb 21, 2019 via email

@danbst
Copy link
Contributor

danbst commented Feb 21, 2019

agree about callPackage and moving common stuff to package itself.

@Ericson2314
Copy link
Member

Ericson2314 commented Jun 11, 2019

@matthewbauer did you change your mind on this?

@jtojnar
Copy link
Contributor

jtojnar commented Jun 11, 2019

Regarding pinentry, #49270 will split it into multiple outputs instead of overrides.

@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
@stale stale bot removed the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Aug 8, 2021
@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Nov 2, 2022
@AndersonTorres
Copy link
Member

Closing as dead.

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

Successfully merging this pull request may close these issues.

None yet

10 participants