Skip to content

perlPackages: add meta.mainProgram to many packages#172413

Merged
zimbatm merged 3 commits intoNixOS:masterfrom
malob:perlPackages-mainProgram
Jun 21, 2022
Merged

perlPackages: add meta.mainProgram to many packages#172413
zimbatm merged 3 commits intoNixOS:masterfrom
malob:perlPackages-mainProgram

Conversation

@malob
Copy link
Copy Markdown
Member

@malob malob commented May 10, 2022

Description of changes

Add meta.mainProgram for packages in perlPackages where the package provides a single executable and that executable's name differs from the package's name or pname, for all packages available on {aarch64,x86_64}-darwin and x86_64-linux. Also add meta.mainProgram for packages with multiple executables where none of the executables match the package's name or pname, and one of the executables is the obvious mainProgram.

This will allow nix run to work with 160 additional packages.

If a package I touched was missing key meta attributes like, license or description, I added them when the information was easy to find. I also fixed some indentation issues, and made a few other minor formatting tweaks/fixes.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 22.05 Release Notes (or backporting 21.11 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@malob malob requested review from stigtsp and zakame as code owners May 10, 2022 23:20
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels May 10, 2022
@malob

This comment was marked as duplicate.

Copy link
Copy Markdown
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

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

Please remove all changes where meta.mainProgram = pname.

@malob malob requested a review from SuperSandro2000 May 13, 2022 20:59
@malob
Copy link
Copy Markdown
Member Author

malob commented May 14, 2022

@stigtsp, @zakame, any concerns here?

Copy link
Copy Markdown
Member

@zakame zakame left a comment

Choose a reason for hiding this comment

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

Thanks @malob! On a cursory review it looks good so far - could you provide a result for

  • Tested basic functionality of all binary files as called with nix run $name

@malob
Copy link
Copy Markdown
Member Author

malob commented May 16, 2022

@zakame, the additions of meta.mainProgram definitions were done using a script I created to identify packages in nixpkgs that provide a single executable in bin/ where the name of that executable differs from the package's name or pname, and then automatically insert the meta.mainProgram definition for those packages.

I used the script to generate the changes in this PR, then I manually reviewed the changes focusing on cases where the executable's name in the added meta.mainProgram was surprising to me given the package's name or description. For those cases I researched the executables more, and removed the meta.mainProgram definitions if it really didn't make any sense to me for them to be blessed as the mainProgram (as well as added them to a list of packages to exclude in the future). While reviewing the changes I also did a little cleanup as mentioned in the PR's description, and I did spot check a few of the new meta.mainProgram definitions by running nix run.

Just mentioning all that in case you were concerned that I performed all these edits manually, which would be a lot more error prone.

My goal, in creating this script, and using it to generate this PR (and past PRs, e.g., #172949, which collectively have added meta.mainProgram definitions to a few hundred packages now), is to get nix run working with as many packages as possible in nixpkgs. It's definitely possible that this process could result in a few erroneous additions of meta.mainProgram definitions. However, given that the cost of such errors is very minor (e.g., nix run failing to find an executable that matches what was defined for the packages mainProgram), and that manually running nix run for each package (168 packages for this PR) is very time consuming, I don't think the tradeoff is worth it.

@malob malob requested a review from zakame May 16, 2022 21:16
@malob malob force-pushed the perlPackages-mainProgram branch from 81bf7c8 to da4814a Compare May 17, 2022 10:24
@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label May 17, 2022
@malob malob force-pushed the perlPackages-mainProgram branch from da4814a to ba64b43 Compare May 17, 2022 10:34
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label May 17, 2022
@malob
Copy link
Copy Markdown
Member Author

malob commented May 19, 2022

@SuperSandro2000 or @zakame, just a polite poke in case this has fallen through the cracks.

@malob
Copy link
Copy Markdown
Member Author

malob commented May 30, 2022

@SuperSandro2000, anything I can do here to get this merged?

@SuperSandro2000
Copy link
Copy Markdown
Member

I am not sure. I would appreciate @stigtsp 's feedback.

@zakame
Copy link
Copy Markdown
Member

zakame commented Jun 6, 2022

@malob see also #176398 from @zimbatm

Copy link
Copy Markdown
Member

@stigtsp stigtsp left a comment

Choose a reason for hiding this comment

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

Looks sensible to me, but also not familiar with implications of adding mainProgram. Are there tests that check if mainProgram resolves/executes somewhere?

@SuperSandro2000
Copy link
Copy Markdown
Member

also not familiar with implications of adding mainProgram

Just meta information for nix run.

Are there tests that check if mainProgram resolves/executes somewhere?

nope

Copy link
Copy Markdown
Member

@stigtsp stigtsp left a comment

Choose a reason for hiding this comment

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

Hi there, the mainProgram changes LGTM.

However, I've had a look at the diff and found a few unrelated changes in perl-packages.nix. Mainly:

  • Indentation changes
  • Changed order of some attributes
  • Changes to dependencies for MacPasteboard Was confused by attribute order change 😕
  • Additional meta (no biggie)

The indentation changes makes it a bit difficult to review what has actually changed, and could cause merge problems imho.

@malob malob force-pushed the perlPackages-mainProgram branch from ba64b43 to 7ecfdc4 Compare June 7, 2022 21:51
malob added 3 commits June 7, 2022 14:53
where the executable's name differs from the packages `name` or `pname`
where none of the executables match the package's `name` or `pname`, and
one of the executables is the obvious `mainProgram`.
@malob malob force-pushed the perlPackages-mainProgram branch from 7ecfdc4 to 1a5f941 Compare June 7, 2022 21:53
@ofborg ofborg bot requested a review from stigtsp June 7, 2022 22:10
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Jun 7, 2022
@malob
Copy link
Copy Markdown
Member Author

malob commented Jun 7, 2022

Alrighty I've,

@stigtsp, sorry if the indentation changes and the reshuffling of attributes made the commits harder to review. I have (what I think is generally a good) habit of making small fixes/improvements unrelated to the changes I want to make when I notice opportunities to do so. In many cases these changes are minor enough that they don't warrant a separate commit, or like in the case of reshuffling the attributes, I wouldn't bother to make those improvements if I had to put them all into a separate commit (since it's annoying to note them all down, and come back to them separately).

So for changes like the shuffling of attributes, I usually lean towards including them, even if it makes the commit a little harder to review, since the alternative of in my case would be to just leave those changes off (which seems worse, at least to me, overall).

However, I agree with you that the indentation changes in particular definitely deserved a separate commit since the indentation errors are easy to find on correct on their own, and they made reviewing the other changes a lot more annoying.

@bobby285271 bobby285271 added the 12.approvals: 1 This PR was reviewed and approved by one person. label Jun 12, 2022
@malob
Copy link
Copy Markdown
Member Author

malob commented Jun 15, 2022

Politely poking @stigtsp and/or @SuperSandro2000

@malob malob added 12.approvals: 2 This PR was reviewed and approved by two persons. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Jun 17, 2022
@zimbatm zimbatm merged commit 7a66c1f into NixOS:master Jun 21, 2022
@malob malob deleted the perlPackages-mainProgram branch June 21, 2022 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants