treewide: add meta.mainProgram to many packages#166865
Merged
Lassulus merged 1 commit intoNixOS:masterfrom Apr 15, 2022
Merged
Conversation
Member
Author
|
Oops, looks like there's a bunch of trailing whitespace, dealing with that now. |
bc802e0 to
924c085
Compare
teto
reviewed
Apr 1, 2022
924c085 to
f3827b5
Compare
f3827b5 to
e167143
Compare
Mindavi
approved these changes
Apr 14, 2022
Lassulus
approved these changes
Apr 14, 2022
e167143 to
0e802ea
Compare
Member
|
This was incorrect for fulcio |
Member
Author
|
@06kellyjac, interesting, looks like it was changed in 0.2.0, and my |
Member
|
No problem. I thought id let you know incase you run the script again |
13 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of changes
I often like to use
nix runto use a package that's currently not installed on my system. Sometimes I run into cases wherenix runfails due to the package's name differing from that of the executable. I've filed a few PRs manually addingmainProgramto few packages'metaattribute set to get them working withnix run. This is kind of annoying to do, so I got to thinking about whether there was a way I could automate this. This is my first attempt.I created a hacky script that uses
nix-{index,locate}to try and:/bin;nixpkgs; andmetaattribute set contained amainProgramattribute; andmainProgramattribute, set to the name of the single executable.I excluded packages defined in places like
pkgs/development/{libraries,haskell-modules}and a few others to reduce false positives.I then manually looked through the diff to sanity check the changes, spot checking many with
nix run(especially the ones that looked the most suspect) and removed a few where the single executable didn't really make sense to define as themainProgram.This process will have missed a bunch of cases, e.g.,
/binwith the suffix "-wrapped";sedfailed;But even at that, this PR should enable
nix runto work with 143 additional packages.Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes