nix-community / napalm

Support for building npm packages in Nix and lightweight npm registry [maintainer=?]
MIT License
104 stars 17 forks source link

jitsi-meet build fails, ".staging" directories ENOENT #18

Open kolloch opened 4 years ago

kolloch commented 4 years ago

I have tried to build jitsi-meet from source with napalm. I am only interested in the web parts but the repository also contains "react-native" code for iOS and Android.

[...]
jitsi-meet> Runnig npm command: npm install
jitsi-meet> npm WARN tar ENOENT: no such file or directory, open '/build/source/node_modules/.staging/dropbox-7d59b16d/dist/DropboxTeam-sdk.min.d.ts'
jitsi-meet> npm WARN tar ENOENT: no such file or directory, open '/build/source/node_modules/.staging/dropbox-7d59b16d/dist/DropboxTeam-sdk.min.js'
jitsi-meet> npm WARN tar ENOENT: no such file or directory, open '/build/source/node_modules/.staging/@react-native-community/cli-platform-android-df898059/build/commands/runAndroid/g
[... many more ...]
jitsi-meet> npm WARN tar ENOENT: no such file or directory, open '/build/source/node_modules/.staging/bc-css-flags-73d17359/lib/region-flags/svg/US-IA.svg'
jitsi-meet> npm ERR! code ENOENT5mtar ENOENT: no such file or directory, opeope
jitsi-meet> npm ERR! syscall spawn git
jitsi-meet> npm ERR! path git
jitsi-meet> npm ERR! errno ENOENT
jitsi-meet> npm ERR! enoent Error while executing:
jitsi-meet> npm ERR! enoent undefined ls-remote -h -t ssh://git@github.com/jitsi/rnnoise-wasm.git
jitsi-meet> npm ERR! enoent
jitsi-meet> npm ERR! enoent
jitsi-meet> npm ERR! enoent spawn git ENOENT
jitsi-meet> npm ERR! enoent This is related to npm not being able to find a file.
jitsi-meet> npm ERR! enoent
jitsi-meet> 
jitsi-meet> npm ERR! A complete log of this run can be found in:
jitsi-meet> npm ERR!     /build/tmp.fIXNtDnhqr/.npm/_logs/2020-04-28T09_12_28_142Z-debug.log
jitsi-meet> npm install: failure, aborting

Note that if I run npm install (0.12) outside of nix, there are no .staging directories. But apparently, it is normal that npm first downloads new modules there.

To reproduce: either check out napalm-jitsi-meet or follow these steps:

niv init
niv add nmattia/napalm
niv add jitsi/jitsi-meet

default.nix:

{ nixpkgs ? <nixpkgs>
, pkgs ? import nixpkgs {}
, sources ? import ./nix/sources.nix
, napalmSrc ? sources.napalm
, napalm ? pkgs.callPackage napalmSrc {}
, jitsiMeetSrc ? sources.jitsi-meet
}:

napalm.buildPackage jitsiMeetSrc {}

Execute nix build -L

nmattia commented 4 years ago

Interesting. Looks like tar tries to unpack a directory that doesn't exist:

jitsi-meet> npm WARN tar ENOENT: no such file or directory, open '/build/source/node_modules/.staging/dropbox-7d59b16d/dist/DropboxTeam-sdk.min.d.ts'

can you try downloading the package tarball by hand and unpacking it?

kolloch commented 4 years ago

Thank you for your super quick response!

Which tar ball?

  1. That of the dependencies or one of them? Not sure what the URL would be. How do I find out?
  2. Or the original source?
❯ nix build -f default.nix -L
jitsi-meet> unpacking sources
jitsi-meet> unpacking source archive /nix/store/mv22mya4rxlz1xgi7a6mcv90cl8h27y0-source
...
❯ cd /nix/store/mv22mya4rxlz1xgi7a6mcv90cl8h27y0-source
❯ ls -la | head
total 10304
dr-xr-xr-x    19 root root      4096 Jan  1  1970 .
drwxrwxr-t 16843 root nixbld 9396224 Apr 28 11:44 ..
-r--r--r--     1 root root      5927 Jan  1  1970 analytics-ga.js
dr-xr-xr-x     8 root root      4096 Jan  1  1970 android
-r--r--r--     1 root root      1635 Jan  1  1970 app.js
-r--r--r--     1 root root        18 Jan  1  1970 base.html
-r--r--r--     1 root root         0 Jan  1  1970 body.html
-r--r--r--     1 root root       114 Jan  1  1970 .buckconfig
-r--r--r--     1 root root       324 Jan  1  1970 ConferenceEvents.js

Looks normal to me...

kolloch commented 4 years ago

I should maybe mention that npm install works for me outside of nix for this project.