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

nix-generate-from-cpan: remove "unkown" license and improve core module detection #82541

Merged
merged 2 commits into from Mar 15, 2020

Conversation

ydlr
Copy link
Contributor

@ydlr ydlr commented Mar 14, 2020

Motivation for this change

Fixed a couple small annoyances with nix-generate-from-cpan script. Removed the "unknown" license from package meta and improved core module detection.

Things done
  • Remove license meta if license is not provided. Leave the warning in place. This is consistent with cpan2nix (https://github.com/volth/cpan2nix) used for generating top-level Perl packages.
  • Use Module::CoreList to detect and filter core modules. Prevents false negatives that were happening with previous method.
  • 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.

Leave license empty when it is not provided. This prevents packages from
failing to build because the license is set to
`stdenv.lib.licenses.unkown`.

There will still be a warning about the unkown license.
The previous way of detecting core modules failed to filter "if" and
possibly other core modules.
@ydlr ydlr changed the title Nix generate from cpan nix-generate-from-cpan: remove "unkown" license and improve core module detection Mar 14, 2020
@Mic92 Mic92 requested a review from volth March 14, 2020 07:48
@rycee
Copy link
Member

rycee commented Mar 14, 2020

I claim no ownership of this script 🙂 Indeed, I think Eelco wrote it originally.

I haven't used Perl for a few years by now but the changes in the PR look OK to me.

@rycee rycee merged commit 2fc67ac into NixOS:master Mar 15, 2020
@rycee
Copy link
Member

rycee commented Mar 15, 2020

Tried the changes out and it seems to work fine so I merged 👍

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

3 participants