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

some recurseIntoAttrs hackery #45841

Closed
wants to merge 4 commits into from

Conversation

oxij
Copy link
Member

@oxij oxij commented Aug 31, 2018

What?

Apply this, put { recurseIntoAttrs = [ "all" ]; } into your config.nix, do nix-env -qa/nix search, see all the packages (or, alternatively, consume all the memory and crash).

Motivation for this change
  1. I wanted to have a nice way to force nix-env -qa to list all the packages for measurements and to toggle that feature on and off for package subsets.
  2. I wanted metrics.nix to count packages.

I started making it specifically for #38635 (comment), but, I think, it turned out to be generally useful by itself.

I made dontRecurseIntoAttrs as a joke to guide myself via search, but now kinda like it too.

Things done
  • It's a noop.

@vcunat
Copy link
Member

vcunat commented Aug 31, 2018

This can be also approached as a wrapper without touching nixpkgs, though perhaps with a little worse performance – a function that imports nixpkgs and recursively adds the attribute everywhere (all is lazy, of course). Something similar is done in ./maintainers/scripts/rebuild-amount.sh but the aim is different there.

@edolstra
Copy link
Member

edolstra commented Sep 5, 2018

Also recurseIntoAttrs is an ugly name. Something like enableAllPackages would be more descriptive.

@oxij oxij force-pushed the treewide/recurse-into-attrs branch from 97ab6cb to 0dac30c Compare September 6, 2018 19:10
@oxij
Copy link
Member Author

oxij commented Sep 6, 2018

@vcunat @edolstra regardless of the recurseIntoAttrs hackery, what about the new metric? Would you merge that if I split in into a separate PR?

The problem with #38635 (comment) is that hydra metrics graphs like memory consumption and etc don't make too much sense without knowing the number of packages it tried to evaluate.

@oxij
Copy link
Member Author

oxij commented Jan 18, 2019

ping. The metric thing was merged in #49863. What can be done to have the rest merged? Is the config option name the only problem here?

This is pretty useful for measuring massive changes like #50643.

@oxij
Copy link
Member Author

oxij commented Feb 20, 2019

The last commit was merged as #49863. The first commit now has a separate PR #56105.

@danbst
Copy link
Contributor

danbst commented Mar 17, 2019

should this be rebased or closed now?

@oxij
Copy link
Member Author

oxij commented Mar 17, 2019 via email

@danbst
Copy link
Contributor

danbst commented Mar 17, 2019

My opinion on naming:

  • recurseIntoAttrs should be called hydraPackageSet :: Attrset -> Attrset
  • dontRecurseIntoAttrs should be called packageSet :: String -> Attrset -> Attrset
  • recurseIntoAttrsMaybe should be called packageSet. Can you provide an insight on why some are "dont", and others are "maybe"? Is "all" your personal choice of "interesting" attrsets?

Also, a minor nitpick, I can suggest the following refactor to propagate package set name automatically:

inherit (lib.mapAttrs packageSet {
  nodePackages_10_x = callPackage ../development/node-packages/default-v10.nix { };
  nodePackages_8_x = callPackage ../development/node-packages/default-v8.nix { };
  nodePackages = nodePackages_8_x;
})
  nodePackages_10_x
  nodePackages_8_x
  nodePackages
;

@oxij
Copy link
Member Author

oxij commented Mar 24, 2019 via email

@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 Oct 3, 2020
@stale
Copy link

stale bot commented Apr 7, 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 Apr 7, 2021
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

7 participants