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

maintainers/build: skip packages without meta #97514

Merged
merged 1 commit into from Sep 9, 2020

Conversation

fgaz
Copy link
Member

@fgaz fgaz commented Sep 9, 2020

Motivation for this change

Some packages do not have a meta attribute, and made the script crash.
This will be useful for ZHF: #97479

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

Some packages do not have a meta attribute, and made the script crash.
@fgaz fgaz mentioned this pull request Sep 9, 2020
@das-g
Copy link
Member

das-g commented Sep 9, 2020

Result of nixpkgs-review pr 97514 1

@domenkozar domenkozar merged commit 309d47a into NixOS:master Sep 9, 2020
@fgaz fgaz deleted the maintainers-build-fix branch September 9, 2020 09:57
@sikmir
Copy link
Member

sikmir commented Sep 9, 2020

@fgaz I would like to use nix-build maintainers/scripts/build.nix --argstr maintainer username on darwin. Is it possible to adjust this script to skip all packages not supported on current platform (darwin)?

@fgaz
Copy link
Member Author

fgaz commented Sep 9, 2020

@sikmir yes, you could add a check here after the ):

then (
if builtins.isList pkg.meta.maintainers
then builtins.elem maintainer_ pkg.meta.maintainers
else maintainer_ == pkg.meta.maintainers
)

something like && (includesDarwin pkg.meta.platforms) (not sure how to implement inlcudesDarwin. there's probably a function somewhere in nixpkgs that can do that)

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

4 participants