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

node2nix-derived build fails #309

Open
mrobbetts opened this issue Nov 9, 2022 · 2 comments
Open

node2nix-derived build fails #309

mrobbetts opened this issue Nov 9, 2022 · 2 comments

Comments

@mrobbetts
Copy link

This is my first time using node2nix, sorry if I am missing something silly.

I am trying to package Shinobi CCTV, and have successfully invoked node2nix to generate the relevant nix files. I then include them in my new derivation in the normal way, and then try to get the package to build.

There was a ton of new dependencies to build, and a big chunk of them built fine. But one fails reliably:

# nix-build /nix/store/ad2rizzv3l02f55nn1g8l6wj51q4k1vi-onvif-9742ea1.drv
this derivation will be built:
  /nix/store/ad2rizzv3l02f55nn1g8l6wj51q4k1vi-onvif-9742ea1.drv
building '/nix/store/ad2rizzv3l02f55nn1g8l6wj51q4k1vi-onvif-9742ea1.drv'...
exporting ssh://[email protected]/agsh/onvif.git (rev 9742ea117b2d19eb31deb54cfb9e2b98f21f9d1f) into /nix/store/shwh7c2i0gnv1fmhfjmmxs2i3yzn9nbs-onvif-9742ea1
Initialized empty Git repository in /nix/store/shwh7c2i0gnv1fmhfjmmxs2i3yzn9nbs-onvif-9742ea1/.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 9742ea117b2d19eb31deb54cfb9e2b98f21f9d1f from ssh://[email protected]/agsh/onvif.git.
error: builder for '/nix/store/ad2rizzv3l02f55nn1g8l6wj51q4k1vi-onvif-9742ea1.drv' failed with exit code 1

I have no idea why this might be failing to find ssh? Is this an obvious error on my part?

The relevant snippet of my node-packages.nix for this dep is:

"onvif-git+ssh://[email protected]/agsh/onvif.git#9742ea117b2d19eb31deb54cfb9e2b98f21f9d1f" = {
  name = "onvif";
  packageName = "onvif";
  version = "0.6.5";
  src = fetchgit {
    url = "ssh://[email protected]/agsh/onvif.git";
    rev = "9742ea117b2d19eb31deb54cfb9e2b98f21f9d1f";
    sha256 = "037fb1769c2f594d00eb8e96f295c33ccd480bfe2100cb15075836dbc4b62a2c";
  };
};

and it's referenced later in that file with:

(sources."onvif-git+ssh://[email protected]/agsh/onvif.git#9742ea117b2d19eb31deb54cfb9e2b98f21f9d1f" // {
  dependencies = [
    sources."xml2js-0.4.23"
    sources."xmlbuilder-11.0.1"
  ];
})

I do note that this is the only dep in the entire file using fetchgit and not fetchurl. Something?

@vivlim
Copy link

vivlim commented Jan 23, 2023

I was seeing this issue too. I tried manually replacing instances of fetchgit with builtins.fetchGit in node-packages.nix (and removing the sha256, since builtins.fetchGit doesn't have that attribute) and that worked for me.

It's not great to have that as a manual step, this might be another reason to merge #298.

@klarkc
Copy link

klarkc commented Mar 7, 2024

This is affecting me, I can't use github repos in any package.json.

As #298 won't happen, what about giving the user the option to enable fetchGit instead of forcing the usage of fetchgit?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants