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

nodePackages.'@captainsafia/legit': init at 2.0.1 #23509

Closed
wants to merge 2 commits into from
Closed

nodePackages.'@captainsafia/legit': init at 2.0.1 #23509

wants to merge 2 commits into from

Conversation

Ma27
Copy link
Member

@Ma27 Ma27 commented Mar 5, 2017

Motivation for this change

legit is a simple Node.js package which generates LICENSE files which makes bootstrapping new projects locally much easier.

Short note before merging it: this package is a scoped package, I built it locally using nix-build -A "nodePackages.@captainsafia/legit". The executable in ./result/bin is named legit.

Since this seems to be the first NPM package in the nixpkgs repo which is scoped, I'm unsure whether I'm missing something.

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@Mic92
Copy link
Member

Mic92 commented Mar 6, 2017

I would add an alias to all-packages.nix:

  legit = nodePackages.'@captainsafia/legit';

@Ma27
Copy link
Member Author

Ma27 commented Mar 6, 2017 via email

@Ma27
Copy link
Member Author

Ma27 commented Mar 6, 2017

@Mic92 done...

@Ma27
Copy link
Member Author

Ma27 commented Mar 7, 2017

rebased onto current master

@Mic92
Copy link
Member

Mic92 commented Mar 12, 2017

$ legit list

is empty, because /nix/store/87dv738w4kdwc5648vlwz924lskqyyz3-node-_at_captainsafia_slash_legit-2.0.1/lib/node_modules/@captainsafia/legit/licenses is empty too. Should there be license files present in the module?

@Ma27
Copy link
Member Author

Ma27 commented Mar 12, 2017

not sure right now, will test this tonight :-)

@Ma27
Copy link
Member Author

Ma27 commented Mar 13, 2017

@Mic92 when I run nix-build -A legit on my local checkout of my nixpkgs fork, it seems to work perfectly:

→ ./result/bin/legit list
agpl-3.0
apache-2.0
bsd-2-clause
bsd-3-clause
epl-1.0
gpl-2.0
gpl-3.0
lgpl-2.1
lgpl-3.0
mit
mpl-2.0
unlicense

am I missing something?

@Mic92
Copy link
Member

Mic92 commented Mar 13, 2017

Just notices, when I build the package with sandbox enabled, I get the following unhandled error:

> @captainsafia/legit@2.0.1 postinstall /nix/store/87dv738w4kdwc5648vlwz924lskqyyz3-node-_at_captainsafia_slash_legit-2.0.1/lib/node_modules/@captainsafia/legit
> mkdir -p licenses && node src/load-licenses.js

{ FetchError: request to https://api.github.com/licenses failed, reason: getaddrinfo ENOTFOUND api.github.com api.github.com:443
    at ClientRequest.<anonymous> (/nix/store/87dv738w4kdwc5648vlwz924lskqyyz3-node-_at_captainsafia_slash_legit-2.0.1/lib/node_modules/@captainsafia/legit/node_modules/node-fetch/index.js:133:11)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at TLSSocket.socketErrorListener (_http_client.js:310:9)
    at emitOne (events.js:96:13)
    at TLSSocket.emit (events.js:188:7)
    at connectErrorNT (net.js:1022:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    at process._tickCallback (internal/process/next_tick.js:98:9)
  name: 'FetchError',
  message: 'request to https://api.github.com/licenses failed, reason: getaddrinfo ENOTFOUND api.github.com api.github.com:443',
  type: 'system',
  errno: 'ENOTFOUND',
  code: 'ENOTFOUND' }
(node:675) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: Cannot read property 'forEach' of undefined
npm WARN @captainsafia/legit@2.0.1 No repository field.
post-installation fixup
shrinking RPATHs of ELF executables and libraries in /nix/store/87dv738w4kdwc5648vlwz924lskqyyz3-node-_at_captainsafia_slash_legit-2.0.1
patching script interpreter paths in /nix/store/87dv738w4kdwc5648vlwz924lskqyyz3-node-_at_captainsafia_slash_legit-2.0.1

But it seems that this error can be easily fixed with a download during build.

@Mic92
Copy link
Member

Mic92 commented Mar 13, 2017

The licenses from github api can be also downloaded from here: https://github.com/github/choosealicense.com/tree/gh-pages/_licenses

@Ma27
Copy link
Member Author

Ma27 commented Jul 23, 2017

closing for now. Due to a new package format in node2nix this change contains huge merge conflicts and lack of time to work on the issues coming with this change.

@Ma27 Ma27 closed this Jul 23, 2017
@Ma27 Ma27 deleted the new-package/nodePackages.legit branch July 23, 2017 07:28
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