svanderburg / node2nix

Generate Nix expressions to build NPM packages
MIT License
527 stars 100 forks source link

Running into a problem using nodes v16 #300

Closed anandsuresh closed 2 years ago

anandsuresh commented 2 years ago

I'm trying to build a nodejs package using node v16.15.0. However, it throws a completely random error that makes no sense to me.

The repo in question (github.com/FabricLabs/fabric.git) is a public repository. I have checked and verified that the ssh binary is in fact available. Have tried providing it by running nix-build in a nix-shell -p nodejs openssh environment as well.

This only started happened when I upgraded to nodejs from v12 to v16. So I'm wondering if this a known issue with node2nix using nodejs v16.

$ nix-build -A package
these 8 derivations will be built:
  /nix/store/3zcpyg0s4qajc9ripkg4f746pv25p49m-fast-json-patch-2.0.7.tgz.drv
  /nix/store/b5lm9laggr0bjl93q6a3h4sggpzg9vkp-fabric-http-48b491c.drv
  /nix/store/bndy6lg45zcf4gpz6mldgbl0gc7h6s4n-merkletreejs-0.1.6.tgz.drv
  /nix/store/csjs9k9wiv0hqfkwsphjw1dp57pihnqm-ts-morph-10.0.2.tgz.drv
  /nix/store/l89i1cg80hnmx97nkp2fplmabf6wc832-jayson-3.4.4.tgz.drv
  /nix/store/mp7lnkxcj50gh9h3690hcqal5sqsvnv7-fabric-809828c.drv
  /nix/store/qxw10x7kjz23mwi0ig3iy71r47r41wi8-json-pointer-0.6.0.tgz.drv
  /nix/store/00alwpa0baajlc4w4vclk70m7jc8a5pn-_at_fabric_slash_faucet-0.2.0-dev.drv
building '/nix/store/mp7lnkxcj50gh9h3690hcqal5sqsvnv7-fabric-809828c.drv'...
exporting ssh://git@github.com/FabricLabs/fabric.git (rev 809828c35176da5d7183e2a4b276d8964f2e00f0) into /nix/store/m3g98b3nw4nnjcsvs8v2j283g867kdzh-fabric-809828c
Initialized empty Git repository in /nix/store/m3g98b3nw4nnjcsvs8v2j283g867kdzh-fabric-809828c/.git/
error: cannot run ssh: No such file or directory
fatal: unable to fork
error: cannot run ssh: No such file or directory
fatal: unable to fork
error: cannot run ssh: No such file or directory
fatal: unable to fork
Unable to checkout 809828c35176da5d7183e2a4b276d8964f2e00f0 from ssh://git@github.com/FabricLabs/fabric.git.
error: builder for '/nix/store/mp7lnkxcj50gh9h3690hcqal5sqsvnv7-fabric-809828c.drv' failed with exit code 1;
       last 9 log lines:
       > exporting ssh://git@github.com/FabricLabs/fabric.git (rev 809828c35176da5d7183e2a4b276d8964f2e00f0) into /nix/store/m3g98b3nw4nnjcsvs8v2j283g867kdzh-fabric-809828c
       > Initialized empty Git repository in /nix/store/m3g98b3nw4nnjcsvs8v2j283g867kdzh-fabric-809828c/.git/
       > error: cannot run ssh: No such file or directory
       > fatal: unable to fork
       > error: cannot run ssh: No such file or directory
       > fatal: unable to fork
       > error: cannot run ssh: No such file or directory
       > fatal: unable to fork
       > Unable to checkout 809828c35176da5d7183e2a4b276d8964f2e00f0 from ssh://git@github.com/FabricLabs/fabric.git.
       For full logs, run 'nix log /nix/store/mp7lnkxcj50gh9h3690hcqal5sqsvnv7-fabric-809828c.drv'.
error: 1 dependencies of derivation '/nix/store/00alwpa0baajlc4w4vclk70m7jc8a5pn-_at_fabric_slash_faucet-0.2.0-dev.drv' failed to build
anandsuresh commented 2 years ago

Forgot to mention that I generated the nix code using node2nix --nodejs-16 --input package.json --lock package-lock.json after making sure that the package lock is up-to-date.

anandsuresh commented 2 years ago

Fixed itself after a rebuild of the package-lock.