-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
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
Need help resolving node-gyp issue for new package (scrypted) #372605
Comments
I would also post this on https://discourse.nixos.org (or at least link to it). You'll likely find more help there. |
i did so, https://discourse.nixos.org/t/need-help-resolving-node-gyp-issue-node-addon-api-not-available/58618, still no luck so far. |
I'm having similar issues trying to create a package for frappe books, an electron accounting app. It appears the intended build behaviour is to fetch some header files from the internet, but it can't due to the nix build environment. This is the error message I'm given:
I found a GitHub issue on the node-gyp repo here but I'm unsure how that would be implemented in a nix-build environment where the header file and hash may change. Additionally, the header version seems to differ from the actual nodejs version used, so I'm really confused on where to go from here |
You can download things from the internet, but you'll have to specify the output hash after you download your inputs. This is known as a fixed-output derivation (this is how our source fetchers like Github, etc. work). Here is a good intro to it: https://bmcgee.ie/posts/2023/02/nix-what-are-fixed-output-derivations-and-why-use-them/ Here's an example recently where Caddy needs to download and build plugins: nixpkgs/pkgs/by-name/ca/caddy/plugins.nix Lines 79 to 81 in 90a1f92
Here's the manual reference for |
Issue description
I am in the process of creating a package for Scrypted which would also fulfill #220494.
Scrypted uses a Node/npm environment, and I have managed to configure most of it. You can view the progress of the package derivation at my current testing branch not based on nixpkgs.
Scrypted depends on
@scrypted/node-pty
, which usesnode-gyp
. When building my derivation, I encounter the following error related to node-gyp:The full log output can be found in this gist: https://gist.github.com/omares/3ccb8ff65dc455849dabd11849f51d6a.
Based on my research, I theorize that the
node-gyp
dependency of@scrypted/node-pty
attempts to download header files, which fails due to the enabled sandboxing mode. I tried applying various "patches" I found during my research to resolve the issue, but without success. As information is scarce, and I am still learning, I hope to receive support through this issue request.Thank you!
Steps to reproduce
nix build .#scrypted --system x86_64-linux -L --show-trace
Technical details
My host machine is a
aarch64-darwin
system, although my package is built on ax86_64-linux
remote builder.Attached the nix-info output of said builder
The text was updated successfully, but these errors were encountered: